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 running chat-with-wikipedia flow, I'm encountering the following error:
...
File "/usr/local/lib/python3.9/site-packages/promptflow/tracing/_trace.py", line 145, in <dictcomp>
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'
How To Reproduce the bug
Steps to reproduce the behavior, how frequent can you experience the bug:
I used Open in GitHub Codespaces option to use the pre-built environment
Run the examples/flows/chat/chat-with-wikipedia flow, using Run it with standard mode option
The command I see in the terminal is: /usr/local/bin/python3 -m promptflow._cli._pf.entry flow test --flow /workspaces/promptflow/examples/flows/chat/chat-with-wikipedia --user-agent "prompt-flow-extension/1.20.2 (linux; x64) VSCode/1.94.2"
The following error comes every single time this flow is run
2024-10-25 14:55:25 +0000 17101 execution.flow INFO Executing node augmented_chat. node run id: edeaf1be-c107-4555-851f-38d5706e7a30_augmented_chat_0
WARNING:opentelemetry.attributes:Invalid type dict for attribute '__computed__.cumulative_token_count.completion' value. Expected one of ['bool', 'str', 'bytes', 'int', 'float'] or a sequence of those types
WARNING:opentelemetry.attributes:Invalid type dict for attribute '__computed__.cumulative_token_count.prompt' value. Expected one of ['bool', 'str', 'bytes', 'int', 'float'] or a sequence of those types
WARNING:opentelemetry.attributes:Invalid type dict for attribute 'llm.usage.completion_tokens_details' value. Expected one of ['bool', 'str', 'bytes', 'int', 'float'] or a sequence of those types
WARNING:opentelemetry.attributes:Invalid type dict for attribute 'llm.usage.prompt_tokens_details' value. Expected one of ['bool', 'str', 'bytes', 'int', 'float'] or a sequence of those types
WARNING:opentelemetry.attributes:Invalid type dict for attribute '__computed__.cumulative_token_count.completion' value. Expected one of ['bool', 'str', 'bytes', 'int', 'float'] or a sequence of those types
WARNING:opentelemetry.attributes:Invalid type dict for attribute '__computed__.cumulative_token_count.prompt' value. Expected one of ['bool', 'str', 'bytes', 'int', 'float'] or a sequence of those types
2024-10-25 14:55:26 +0000 17101 execution ERROR Node augmented_chat in line 0 failed. Exception: Execution failure in 'augmented_chat': (TypeError) unsupported operand type(s) for +: 'dict' and 'dict'.
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/promptflow/_core/flow_execution_context.py", line 182, in _invoke_tool_inner
return f(**kwargs)
File "/usr/local/lib/python3.9/site-packages/promptflow/executor/flow_executor.py", line 1344, in wrapper
return f(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/promptflow/tracing/_trace.py", line 562, in wrapped
token_collector.collect_openai_tokens_for_parent_span(span)
File "/usr/local/lib/python3.9/site-packages/promptflow/tracing/_trace.py", line 143, in collect_openai_tokens_for_parent_span
merged_tokens = {
File "/usr/local/lib/python3.9/site-packages/promptflow/tracing/_trace.py", line 145, in <dictcomp>
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'
Expected behavior
I am expecting the flow to run without any errors
Screenshots
I'm attaching two screenshots to show the error
Running Information(please complete the following information):
Promptflow Package Version using pf -v: [e.g. 0.0.102309906]
Operating System: Linux (GitHub Codespaces) - Debian GNU/Linux 11 (bullseye)
Python Version using python --version: Python 3.9.20
Additional context
This is my first time using GitHub Codespaces as well as Prompt flow, so if there's some additional initialization/config that I had to run, please let me know
The text was updated successfully, but these errors were encountered:
I also tried setting the tracing to none thinking it won't go to _trace.py but that didn't make any difference. But when I set the PF_DISABLE_TRACING environment variable to true (in the same terminal) and re-ran the flow command, I didn't get this error as the tracing code didn't run in that case.
Describe the bug
When running
chat-with-wikipedia
flow, I'm encountering the following error:How To Reproduce the bug
Steps to reproduce the behavior, how frequent can you experience the bug:
Open in GitHub Codespaces
option to use the pre-built environmentexamples/flows/chat/chat-with-wikipedia
flow, usingRun it with standard mode
option/usr/local/bin/python3 -m promptflow._cli._pf.entry flow test --flow /workspaces/promptflow/examples/flows/chat/chat-with-wikipedia --user-agent "prompt-flow-extension/1.20.2 (linux; x64) VSCode/1.94.2"
Expected behavior
I am expecting the flow to run without any errors
Screenshots
I'm attaching two screenshots to show the error
Running Information(please complete the following information):
pf -v
: [e.g. 0.0.102309906]Debian GNU/Linux 11 (bullseye)
python --version
:Python 3.9.20
Additional context
This is my first time using GitHub Codespaces as well as Prompt flow, so if there's some additional initialization/config that I had to run, please let me know
The text was updated successfully, but these errors were encountered: