fix: make sure choices is not nil or None to make it compatible with OpenAI#1975
Merged
yuzisun merged 2 commits intoenvoyproxy:mainfrom Mar 20, 2026
Merged
fix: make sure choices is not nil or None to make it compatible with OpenAI#1975yuzisun merged 2 commits intoenvoyproxy:mainfrom
yuzisun merged 2 commits intoenvoyproxy:mainfrom
Conversation
|
Related Documentation 1 document(s) may need updating based on files changed in this PR: Envoy's Space connect-providers
|
8dd5f24 to
0baca27
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1975 +/- ##
=======================================
Coverage 84.33% 84.33%
=======================================
Files 130 130
Lines 17986 17987 +1
=======================================
+ Hits 15169 15170 +1
Misses 1873 1873
Partials 944 944 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
/retest |
yuzisun
approved these changes
Mar 19, 2026
Signed-off-by: yxia216 <yxia216@bloomberg.net>
d12117e to
f9f310c
Compare
Contributor
Author
|
/retest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Currently, it sets
omitemptyfor choices, it would cause choices to beNone, which is not compatible with OpenAI and caused programs to crash.see openai-go: https://github.com/openai/openai-go/blob/6723d0b464f1d6898d7242efad6b94cc3ad7dfe6/chatcompletion.go#L183-L184
Fix: remove the
omitempty