Skip to content

feat(gemini): support thought_signature preservation, tool role, and update default model to gemini-2.0-flash - #45

Merged
getdownandcode merged 2 commits into
mainfrom
feat/gemini-tool-calling-fix
Oct 1, 2026
Merged

getdownandcode merged 2 commits into
mainfrom
feat/gemini-tool-calling-fix

Conversation

@getdownandcode

Copy link
Copy Markdown
Owner

Summary

  • Added thought_signature field to ToolCall model to support Gemini 2.x/3.x reasoning models.
  • Preserved thought_signature from Gemini candidate responses and forward it in subsequent conversation turns on Part(function_call=..., thought_signature=...).
  • Resolved tool name properly from assistant message history when constructing Role.TOOL function responses, and use role="tool" matching the official Google GenAI SDK.
  • Changed default Gemini model from obsolete/unavailable gemini-2.5-flash to active gemini-2.0-flash across config, factory, env, and docker-compose.
  • Updated RedisMemoryStore serialization to use model_dump(mode="json") for safe base64 encoding of bytes fields.

Verification

  • ruff check . passed
  • ruff format --check . passed
  • mypy agentkit tests examples passed
  • pytest --cov=agentkit --cov-fail-under=85 passed (91.58% coverage)

@getdownandcode getdownandcode left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

LGTM: Strict review complete.

  • Thought signature field added cleanly to ToolCall with bytes | None type.
  • Candidate thought_signature extracted and preserved across assistant turns.
  • Role.TOOL messages use role='tool' and map tool_call_id to actual function name for Gemini SDK compliance.
  • Default model updated to active gemini-2.0-flash across config, factory, env, and docker-compose.
  • RedisMemoryStore uses mode='json' to cleanly encode bytes fields.
  • 100% clean passes for ruff, strict mypy, and unit test suite.

@getdownandcode
getdownandcode merged commit dfd1c38 into main Oct 1, 2026
1 check passed
@getdownandcode
getdownandcode deleted the feat/gemini-tool-calling-fix branch October 1, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant