Skip to content

Conversation

@HaiyiMei
Copy link

Summary

This PR adds support for Gemini 3 models' required thoughtSignature field in tool calls and optimizes the token counting implementation.

Changes

  • Added _is_gemini_3_or_newer() helper function to detect Gemini 3 models
  • Updated convert_to_gemini_tool_call_invoke() to inject thoughtSignature for Gemini 3 models when not provided
  • Propagated model parameter through transformation functions to enable version detection
  • Optimized _clean_contents_for_gemini_api() by removing dependency on google.genai.types.FunctionResponse

Details

Testing

  • Changes maintain backward compatibility with existing Gemini models
  • Token counting optimization removes unnecessary dependency

@vercel
Copy link

vercel bot commented Nov 19, 2025

@HaiyiMei is attempting to deploy a commit to the CLERKIEAI Team on Vercel.

A member of the Team first needs to authorize it.

@HaiyiMei HaiyiMei mentioned this pull request Nov 19, 2025
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