test(provider/google): add thoughtSignature cross-namespace regression tests#12576
Open
test(provider/google): add thoughtSignature cross-namespace regression tests#12576
Conversation
…ests add tests verifying thoughtSignature is correctly included in API request body for multi-turn tool call conversations, covering both google and vertex (cross-namespace) providers in doGenerate and doStream
add generateText and streamText examples that exercise multi-step tool calls with thoughtSignature on gemini-3-flash-preview, both direct google provider and via ai gateway
| only: ['google'], | ||
| }, | ||
| vertex: { | ||
| safetySettings: [ |
Contributor
There was a problem hiding this comment.
the combination of passing vertex providerOptions to the google provider fails passing those options. when you run this example, you will notice that no safety ratings are set.
however passing google providerOptions to vertex provider will work, and the safety ratings will be observed.
Solution:
the conversion of the key from vertex to google needs to happen when gateway falls back to google provider from vertex
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.
background
follow-up to #12403 - customers reported issues with gemini models on ai gateway when switching between google and vertex providers. the
thoughtSignaturemetadata was stored under different namespace keys (googlevsvertex), causing failures on multi-turn tool call conversations. adding regression tests and examples to prevent future breakagesummary
thoughtSignatureis correctly included in the API request body for multi-turn tool call conversationsdoGenerateanddoStreamgenerate-text/google-thinking-roundtrip.ts(direct google)generate-text/gateway-google-thinking-roundtrip.ts(via gateway)stream-text/google-thinking-roundtrip.ts(direct google)stream-text/gateway-google-thinking-roundtrip.ts(via gateway)verification
all google package tests pass (260 tests)
all 4 examples complete multi-step tool calls with thoughtSignature
checklist
pnpm changesetin root)related issues
follow-up to #12403