Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.x] OpenAI: Ignore chunks with an empty `choices` list (e…
…lastic#192951) (elastic#192960) # Backport This will backport the following commits from `main` to `8.x`: - [OpenAI: Ignore chunks with an empty `choices` list (elastic#192951)](elastic#192951) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Pierre Gayvallet","email":"pierre.gayvallet@elastic.co"},"sourceCommit":{"committedDate":"2024-09-15T18:28:44Z","message":"OpenAI: Ignore chunks with an empty `choices` list (elastic#192951)\n\n## Summary\r\n\r\nOpenAI added usage stats to their APIs recently:\r\nhttps://community.openai.com/t/usage-stats-now-available-when-using-streaming-with-the-chat-completions-api-or-completions-api/738156\r\n\r\nHowever, it's somewhat non BWC:\r\n\r\n> Note that this usage-specific chunk will have choices: [], so if you\r\nturn this feature on, you may need to update any code that accesses\r\n\r\n(Héhéhé)\r\n\r\nLeveraging this feature is for another day. This PR is just about\r\navoiding the whole thing to explode.","sha":"8bffd618059aacc30d6190a0d143d8b0c7217faf","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","Team:Obs AI Assistant","ci:project-deploy-observability","v8.16.0","Team:AI Infra"],"title":"OpenAI: Ignore chunks with an empty `choices` list","number":192951,"url":"https://github.com/elastic/kibana/pull/192951","mergeCommit":{"message":"OpenAI: Ignore chunks with an empty `choices` list (elastic#192951)\n\n## Summary\r\n\r\nOpenAI added usage stats to their APIs recently:\r\nhttps://community.openai.com/t/usage-stats-now-available-when-using-streaming-with-the-chat-completions-api-or-completions-api/738156\r\n\r\nHowever, it's somewhat non BWC:\r\n\r\n> Note that this usage-specific chunk will have choices: [], so if you\r\nturn this feature on, you may need to update any code that accesses\r\n\r\n(Héhéhé)\r\n\r\nLeveraging this feature is for another day. This PR is just about\r\navoiding the whole thing to explode.","sha":"8bffd618059aacc30d6190a0d143d8b0c7217faf"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/192951","number":192951,"mergeCommit":{"message":"OpenAI: Ignore chunks with an empty `choices` list (elastic#192951)\n\n## Summary\r\n\r\nOpenAI added usage stats to their APIs recently:\r\nhttps://community.openai.com/t/usage-stats-now-available-when-using-streaming-with-the-chat-completions-api-or-completions-api/738156\r\n\r\nHowever, it's somewhat non BWC:\r\n\r\n> Note that this usage-specific chunk will have choices: [], so if you\r\nturn this feature on, you may need to update any code that accesses\r\n\r\n(Héhéhé)\r\n\r\nLeveraging this feature is for another day. This PR is just about\r\navoiding the whole thing to explode.","sha":"8bffd618059aacc30d6190a0d143d8b0c7217faf"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Pierre Gayvallet <pierre.gayvallet@elastic.co>
- Loading branch information