fix: add thoughtSignature for schema.Toolcall to adapt Gemini3 #623
+13
−1
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.
Problem
Gemini 3 uses thought signatures to maintain reasoning context across API calls. These signatures are encrypted representations of the model's internal thinking process. To ensure the model retains its reasoning capabilities, users must return these signatures unchanged in subsequent requests to the model.
Currently, the ToolCall struct in eino does not have a field to store this thought signature, making it impossible to properly support Gemini 3's reasoning context preservation feature.
Solution
Add a ThoughtSignature field to the ToolCall struct to store Gemini 3's thought signature. This field will be:
Serialized as thought_signature in JSON
Treated as an atomic field (not split across streaming chunks)
Properly merged during stream concatenation
Implementation
schema/message.go: Added ThoughtSignature field and updated concatToolCalls