-
Notifications
You must be signed in to change notification settings - Fork 207
feat(google): preserve thought signatures for Gemini 3+ function calling #921
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
base: main
Are you sure you want to change the base?
Conversation
|
|
I also made an issue here #920 |
|
Wait, I've got a few issues, do not merge |
- Add thoughtSignature field to FunctionCall class in chat_context.ts - Capture thoughtSignature from API response in google plugin llm.ts - Include thoughtSignature when converting back to Google format - Preserve thoughtSignature in voice/generation.ts when recreating FunctionCall - Update @google/genai to v1.34.0 for thoughtSignature support
b99fa73 to
80138a6
Compare
|
Ok ready for review :D |
|
@toubatbrian Could you please review, not having this is blocking me |
|
Also do I need a changeset? |
toubatbrian
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG to me!
|
Hey @tomc98 thanks for the PR! I'm currently OOO and review might be slower. Please add a patch changeset on google plugin, thanks! Also, could you run the agent with current changes using gemini model and see if the voice interaction works as usual? Just to make sure no regression is introduced. |
Summary
Gemini 3+ models require thought signatures to be preserved and returned when using function calling with thinking mode enabled. Without this fix, the API returns a 400 error:
Changes
thoughtSignatureoptional field toFunctionCallclassthoughtSignaturefrom Gemini API response in Google plugin's#parsePartmethodthoughtSignaturewhen converting chat context back to Google formatisEquivalentto comparethoughtSignaturefor function callsModels affected
This fix enables compatibility with:
gemini-3-flash-previewgemini-3-flash-lite-previewgemini-3-pro-previewReferences
Test plan