openai-go
openai-go copied to clipboard
Set the 'Include Usage' parameter under 'Stream Options' to true in the 'chat-completion-accumulating' example
Summary
This pull request adds the missingStreamOptions.IncludeUsage option in the example code that should be set to true to retrieve accurate token usage information from the API. Without this parameter, the example currently returns a token usage of 0.
Changes Made
- Updated the relevant example request options to include the missing parameter with a value of
true.
Issue Reference
Fixes #124
Testing
- Ran the example after adding the parameter and confirmed that token usage is now reported accurately.
Additional Context
This change ensures users get accurate usage data when using the example code.
Thanks, we'll merge this.
Hello @jacobzim-stl, any update on when this would be merged?