Skip to content

Conversation

@hustxiayang
Copy link
Contributor

@hustxiayang hustxiayang commented Nov 20, 2025

Description
Some new features were introduced in gemini3:
1 thinking_level:
https://ai.google.dev/gemini-api/docs/gemini-3?thinking=low#thinking_level
This is similar to reasoning_effort of openai, thus, unified them.

2 media_resolution
https://ai.google.dev/gemini-api/docs/gemini-3?thinking=low#media_resolution
This is similar to detail in openai, thus, unified them.

The difference is that openai does not provide a global config of media_resolution. Thus, added it as gcp specific, but still use detail to make the name consistent.

Some related PRs:
thinking_budget is in
#1461
thinking_level and thinking_budget are both supported, but can not use them together.

Other features under review:
1 web search:
#1526

2 parse the thought summary:
#1521

@hustxiayang hustxiayang requested a review from a team as a code owner November 20, 2025 14:20
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Nov 20, 2025
@hustxiayang hustxiayang changed the title feat: add new features of gemini3 feat: add new features(thinking_level and media_resolution) of gemini3 Nov 20, 2025
@codecov-commenter
Copy link

codecov-commenter commented Nov 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.22%. Comparing base (54301da) to head (eb79d90).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1554      +/-   ##
==========================================
+ Coverage   84.18%   84.22%   +0.04%     
==========================================
  Files         150      150              
  Lines       13005    13041      +36     
==========================================
+ Hits        10948    10984      +36     
  Misses       1436     1436              
  Partials      621      621              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hustxiayang
Copy link
Contributor Author

/retest

ThinkingConfig *genai.ThinkingConfig `json:"thinkingConfig,omitzero"`

// Detail is media resolution in gemini models
Detail genai.MediaResolution `json:"detail,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add the reference link?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added, thanks for the comment

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this filed should be added to the image part details

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the link is wrong, it points to the caching API

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this filed should be added to the image part details is already in openai' spec

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it points to the caching API I think the definition is the same

@hustxiayang
Copy link
Contributor Author

/retest

1 similar comment
@hustxiayang
Copy link
Contributor Author

/retest

ThinkingConfig *genai.ThinkingConfig `json:"thinkingConfig,omitzero"`

// Detail here is to set global media resolution in gemini models: https://ai.google.dev/api/caching#MediaResolution
Detail genai.MediaResolution `json:"detail,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

details can be confusing without context at the top level, since it is in the GCP vendor field section we should keep the name medium_resolution.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated.

hustxiayang and others added 6 commits November 21, 2025 15:06
Signed-off-by: yxia216 <[email protected]>
**Description**
update anthropic -> translation code to correctly translate token usage

---------

Signed-off-by: Alexa Griffith <[email protected]>
Signed-off-by: yxia216 <[email protected]>
Signed-off-by: yxia216 <[email protected]>
…#1536)

**Description**
The SSE event spec supports 3 different delimiters (pair of CRLF / LF /
CR). This PR updates the stream processing translator for GCP VertexAI
to support all 3 delimiters.

[SSE docs] about delimiters
> **Note:** The docs define an event as `event = *( comment / field )
end-of-line`
`end-of-line` is defined as a single CRLF or LF or CR (not a pair)
But the `comment` and `field` definitions also end in `end-of-line`
implying that an event always ends in a pair of CRLR / CR / LF

[SSE docs]:
https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream

---------

Signed-off-by: Sukumar Gaonkar <[email protected]>
Co-authored-by: Ignasi Barrera <[email protected]>
Signed-off-by: yxia216 <[email protected]>
Signed-off-by: yxia216 <[email protected]>
Signed-off-by: yxia216 <[email protected]>
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Nov 21, 2025
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Nov 21, 2025
@yuzisun yuzisun merged commit 5059dfc into envoyproxy:main Nov 21, 2025
47 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants