Azure/azure-sdk-for-go

Add support for usage stats when streaming chat completion

Closed this issue · 2 comments

Feature Request

Do we have any plan to support this feature as stated in #22940?

Thank you for your feedback. Tagging and routing to the team member best able to assist.

As of the latest package you can set IncludeUsage in the StreamOptions field:

https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/ai/azopenai#ChatCompletionsStreamOptions

body.StreamOptions = &azopenai.ChatCompletionStreamOptions{
    IncludeUsage: to.Ptr(true),
}