[BUG] StreamOptions is always set to null - it makes it impossible to get token usage with streaming mode #46407
Labels
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
needs-team-attention
Workflow: This issue needs attention from Azure service team or SDK team
OpenAI
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Service Attention
Workflow: This issue is responsible by Azure service team.
Library name and version
Azure.AI.OpenAI 2.0.0
Describe the bug
is never sent to OpenAI API.
Please check CompleteChatStreamingAsync method in AzureChatClient.
It contains call to
PostfixClearStreamOptions
which always sets ChatCompletionOptions StreamOptions to null.https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureChatClient.cs#L66
As it is internal API, it is impossible to set the value.
Expected behavior
PostfixClearStreamOptions should not be called.
And ideally, setting StreamOptions should be possible with public API.
Actual behavior
PostfixClearStreamOptions is called and StreamOptions is always set to null.
Reproduction Steps
Call ChatClient.CompleteChatStreamingAsync
Environment
No response
The text was updated successfully, but these errors were encountered: