-
Notifications
You must be signed in to change notification settings - Fork 122
fix: make usage chunk in stream mode of gemini compatible with openai #1503
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
Open
hustxiayang
wants to merge
7
commits into
envoyproxy:main
Choose a base branch
from
hustxiayang:gemini-usage
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
Signed-off-by: yxia216 <yxia216@bloomberg.net>
…envoyproxy#1494) **Description** - ai gateway mutating webhook should default failurePolicy to Fail **Related Issues/PRs (if applicable)** fixes: envoyproxy#1493 **Special notes for reviewers (if applicable)** Signed-off-by: googs1025 <googs1025@gmail.com> Signed-off-by: yxia216 <yxia216@bloomberg.net>
**Description** fix: envoyproxy#1485 **Related Issues/PRs (if applicable)** **Special notes for reviewers (if applicable)** Signed-off-by: googs1025 <googs1025@gmail.com> Signed-off-by: yxia216 <yxia216@bloomberg.net>
… a tool call (envoyproxy#1486) **Description** Finish reason should be tool calls if the model returns a tool call response. In vertex api, there is no tool call finish reason, thus need a work around to make it compatible. --------- Signed-off-by: yxia216 <yxia216@bloomberg.net> Co-authored-by: Dan Sun <dsun20@bloomberg.net> Signed-off-by: yxia216 <yxia216@bloomberg.net>
…oxy#1491) **Description** This decouples backendauth & headermutator packages from extproc specifics. As we are looking to migrate to dynamic modules, this is a necessary refactoring work to make the code as reusable as possible. **Related Issues/PRs (if applicable)** Preliminary for envoyproxy#90 --------- Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com> Signed-off-by: yxia216 <yxia216@bloomberg.net>
3fc0bf1 to
35bff4c
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1503 +/- ##
==========================================
- Coverage 83.91% 83.89% -0.03%
==========================================
Files 144 144
Lines 12659 12670 +11
==========================================
+ Hits 10623 10629 +6
- Misses 1419 1423 +4
- Partials 617 618 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
/retest |
Contributor
|
@yuzisun can you take a look at this one? |
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
Users found the simply use "usgae" information does not work for streaming responses of gemini models.

This is because for openai models, the usage chunk would be a separate chunk. For example, this is an example response from gpt-4o:
There is a finish_reason chunk, and then a usage chunk.
Thus, want to make it compatible with Openai. (Actually, in anthropic translation, it's already compatible)