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
Additional context
The cause is clear. The last chunk can sometimes have choice as 0, but it is being skipped entirely with continue. In the implementation of OpenAI, if usage is included, the chunk is processed appropriately.
github-actionsbot
changed the title
Bug: Python When using Azure OpenAI, even if stream options are enabled, it is not reflected in the usage.
Python: Bug: Python When using Azure OpenAI, even if stream options are enabled, it is not reflected in the usage.
Nov 19, 2024
yuichiromukaiyama
changed the title
Python: Bug: Python When using Azure OpenAI, even if stream options are enabled, it is not reflected in the usage.
Python: Bug: When using Azure OpenAI, even if stream options are enabled, it is not reflected in the usage.
Nov 19, 2024
Describe the bug
By setting stream_options.include_usage to true, the token usage is supposed to be returned, but it always ends up being None.
model: azure openai gpt 4o/4omini
api version: 2024-10-21
To Reproduce
Expected behavior
Screenshots
none
Platform
Additional context
The cause is clear. The last chunk can sometimes have choice as 0, but it is being skipped entirely with continue. In the implementation of OpenAI, if usage is included, the chunk is processed appropriately.
azure
semantic-kernel/python/semantic_kernel/connectors/ai/open_ai/services/azure_chat_completion.py
Line 151 in 5197f0b
openai
semantic-kernel/python/semantic_kernel/connectors/ai/open_ai/services/open_ai_chat_completion_base.py
Line 113 in 5197f0b
The text was updated successfully, but these errors were encountered: