feat(google): add thought_signature support for Gemini 2.0+#112
Open
Gabbosaur wants to merge 1 commit intodatapizza-labs:mainfrom
Open
feat(google): add thought_signature support for Gemini 2.0+#112Gabbosaur wants to merge 1 commit intodatapizza-labs:mainfrom
Gabbosaur wants to merge 1 commit intodatapizza-labs:mainfrom
Conversation
Federaffo
previously requested changes
Feb 23, 2026
Contributor
There was a problem hiding this comment.
Thanks for the contribution. The PR currently fails CI due to formatting only: (blank line contains whitespace) in
Can you run the repo pre-commit pipeline locally and push the formatting fix?
Suggested commands:
- uvx ruff check . --fix
- pre-commit run --all-files
Federaffo
requested changes
Feb 23, 2026
Contributor
Federaffo
left a comment
There was a problem hiding this comment.
Thanks for the contribution. The PR currently fails CI due to formatting only:\n\n- W293 (blank line contains whitespace) in datapizza-ai-clients/datapizza-ai-clients-google/datapizza/clients/google/google_client.py:620\n\nCan you run the repo pre-commit pipeline locally and push the formatting fix?\nSuggested commands:\n- uvx ruff check . --fix\n- pre-commit run --all-files
Dismissing accidental duplicate review caused by command formatting.
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.
Summary
Add support for
thought_signaturein Google/Gemini client to enable function calling with Gemini 2.0+ models.Problem
Gemini 2.0 and newer models (including
gemini-2.0-flash) requirethought_signatureto be preserved and returned during multi-turn function calling conversations. Without this, the API returns:Solution
FunctionCallBlock- Added optionalthought_signaturefieldGoogleClient._response_to_client_response- Extractthought_signaturefrom response partsGoogleMemoryAdapter._turn_to_message- Includethought_signaturewhen converting back to API formatChanges
datapizza-ai-core/datapizza/type/type.pydatapizza-ai-clients-google/datapizza/clients/google/google_client.pydatapizza-ai-clients-google/datapizza/clients/google/memory_adapter.pyReferences
Testing
Tested with
gemini-2.0-flashmodel using multi-turn function calling.