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
Two related issues in token collection:
AttributeError: 'TokenCollector' object has no attribute 'try_get_openai_tokens'
OpenTelemetry warnings about invalid token value types (dict and NoneType values where numeric values are expected)
How To Reproduce the bug
Steps to reproduce the behavior:
Run any LLM flow with token tracking enabled
The error occurs consistently on every run
Check logs for OpenTelemetry warnings about invalid attribute types
Flow execution fails with AttributeError for try_get_openai_tokens
Expected behavior
TokenCollector should properly track and collect token usage
Token values should be properly typed (numeric values)
No OpenTelemetry warnings about invalid types
No AttributeErrors during token collection
Screenshots
Error logs show:
CopyWARNING:opentelemetry.attributes:Invalid type dict for attribute 'computed.cumulative_token_count.completion'
...
TypeError: unsupported operand type(s) for +: 'NoneType' and 'dict'
...
AttributeError: 'TokenCollector' object has no attribute 'try_get_openai_tokens'
Running Information
Issue appears related to token tracking in tracing functionality
Occurs with Azure OpenAI service integration
Problem stems from method indentation error and inconsistent type handling
Affects both streaming and non-streaming LLM calls
The text was updated successfully, but these errors were encountered:
Describe the bug
Two related issues in token collection:
AttributeError: 'TokenCollector' object has no attribute 'try_get_openai_tokens'
OpenTelemetry warnings about invalid token value types (dict and NoneType values where numeric values are expected)
How To Reproduce the bug
Steps to reproduce the behavior:
Run any LLM flow with token tracking enabled
The error occurs consistently on every run
Check logs for OpenTelemetry warnings about invalid attribute types
Flow execution fails with AttributeError for try_get_openai_tokens
Expected behavior
TokenCollector should properly track and collect token usage
Token values should be properly typed (numeric values)
No OpenTelemetry warnings about invalid types
No AttributeErrors during token collection
Screenshots
Error logs show:
CopyWARNING:opentelemetry.attributes:Invalid type dict for attribute 'computed.cumulative_token_count.completion'
...
TypeError: unsupported operand type(s) for +: 'NoneType' and 'dict'
...
AttributeError: 'TokenCollector' object has no attribute 'try_get_openai_tokens'
Running Information
Promptflow Package Version: 1.16
Operating System: Windows
Python Version: Python 3.9
Additional context
Issue appears related to token tracking in tracing functionality
Occurs with Azure OpenAI service integration
Problem stems from method indentation error and inconsistent type handling
Affects both streaming and non-streaming LLM calls
The text was updated successfully, but these errors were encountered: