You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using LangGraph within Prompt Flow, nodes that invoke a graph error out when Prompt Flow tracing is turned on.
How To Reproduce the bug
Steps to reproduce the behavior, how frequent can you experience the bug:
Create node that calls a LangGraph graph (graph.invoke(input))
Run Prompt Flow graph
Expected behavior
No error
Screenshots
N/A
Running Information(please complete the following information):
Promptflow Package Version: promptflow==1.16.1
Operating System: Windows 11
Python Version: 3.13.0
Additional context
Running graph.invoke(input) works when setting PF_DISABLE_TRACING=true
Without setting this env variable, we get the following message:
File **"C:\Users\MattY\Code\PromptFlowSandbox\PrmtFlPyVenv\Lib\site-packages\promptflow\tracing\_trace.py"**, line 145, in collect_openai_tokens_for_parent_span
**key: (self._span_id_to_tokens[parent_span_id].get(key, 0) or 0) + (tokens.get(key, 0) or 0)**
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'dict' and 'dict'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\MattY\Code\PromptFlowSandbox\PrmtFlPyVenv\Lib\site-packages\promptflow\_core\flow_execution_context.py", line 90, in invoke_tool
result = self._invoke_tool_inner(node, f, kwargs)
File "C:\Users\MattY\Code\PromptFlowSandbox\PrmtFlPyVenv\Lib\site-packages\promptflow\_core\flow_execution_context.py", line 206, in _invoke_tool_inner
raise ToolExecutionError(node_name=node_name, module=module) from e
promptflow._core._errors.ToolExecutionError: Execution failure in 'python_concat': (TypeError) unsupported operand type(s) for +: 'dict' and 'dict'
2024-11-11 14:29:39 -0500 8824 execution.flow WARNING Failed to calculate metrics due to exception: unsupported operand type(s) for +: 'int' and 'dict'.
2024-11-11 14:29:39 -0500 8824 execution.flow WARNING Failed to calculate metrics due to exception: unsupported operand type(s) for +: 'int' and 'dict'.
2024-11-11 14:29:39 -0500 8824 execution.flow ERROR Flow execution has failed. Cancelling all running nodes: python_concat.
pf.flow.test failed with UserErrorException: TypeError: **Execution failure in 'python_concat': (TypeError) unsupported operand type(s) for +: 'dict' and 'dict'**
WARNING:azure.monitor.opentelemetry.exporter.export._base:Retrying due to server request error: <urllib3.connection.HTTPSConnection object at 0x000001EE56BA7ED0>: Failed to resolve 'eastus-8.in.applicationinsights.azure.com' ([Errno 11001] getaddrinfo failed).
The text was updated successfully, but these errors were encountered:
Describe the bug
When using LangGraph within Prompt Flow, nodes that invoke a graph error out when Prompt Flow tracing is turned on.
How To Reproduce the bug
Steps to reproduce the behavior, how frequent can you experience the bug:
Expected behavior
No error
Screenshots
N/A
Running Information(please complete the following information):
Additional context
Running graph.invoke(input) works when setting PF_DISABLE_TRACING=true
Without setting this env variable, we get the following message:
The text was updated successfully, but these errors were encountered: