Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] OpenAI: Ignore chunks with an empty `choices` list (#192951) #192960

Merged
merged 1 commit into from
Sep 15, 2024

Conversation

kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

## Summary

OpenAI added usage stats to their APIs recently:
https://community.openai.com/t/usage-stats-now-available-when-using-streaming-with-the-chat-completions-api-or-completions-api/738156

However, it's somewhat non BWC:

> Note that this usage-specific chunk will have choices: [], so if you
turn this feature on, you may need to update any code that accesses

(Héhéhé)

Leveraging this feature is for another day. This PR is just about
avoiding the whole thing to explode.

(cherry picked from commit 8bffd61)
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @pgayvallet

@kibanamachine kibanamachine merged commit 5f8e564 into elastic:8.x Sep 15, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport ci:project-deploy-observability Create an Observability project Team:Obs AI Assistant Observability AI Assistant
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants