Skip to content

set tools to any when gemini request comes with allowed tools#4875

Merged
GabrielBianconi merged 3 commits intomainfrom
viraj/fix-4872
Nov 27, 2025
Merged

set tools to any when gemini request comes with allowed tools#4875
GabrielBianconi merged 3 commits intomainfrom
viraj/fix-4872

Conversation

@virajmehta
Copy link
Member

@virajmehta virajmehta commented Nov 26, 2025

Closes #4872


Important

Set tool mode to Any for Gemini requests with auto mode and allowed tools to prevent errors.

  • Behavior:
    • In gcp_vertex_gemini/mod.rs and google_ai_studio_gemini.rs, set mode to Any if allowed_function_names is set in ToolChoice::Auto to prevent errors.
    • Update tests in gcp_vertex_gemini.rs and google_ai_studio_gemini.rs to verify Any mode is used when allowed_tools is specified with auto.
  • Tests:
    • Add test_gcp_vertex_gemini_tool_choice_auto_with_allowed_tools in gcp_vertex_gemini.rs to verify tool call behavior.
    • Add test_google_ai_studio_gemini_tool_choice_auto_with_allowed_tools in google_ai_studio_gemini.rs to ensure correct tool call behavior.
  • Misc:
    • Update comments in tests to reflect new behavior.

This description was created by Ellipsis for 33937f2. You can customize this summary. It will automatically update as commits are pushed.

@GabrielBianconi GabrielBianconi added this pull request to the merge queue Nov 27, 2025
Merged via the queue into main with commit 437ba75 Nov 27, 2025
55 checks passed
@GabrielBianconi GabrielBianconi deleted the viraj/fix-4872 branch November 27, 2025 04:28
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.

In google AI studio / vertex gemini, set function call config mode to Any if allowed tools is set

2 participants