litellm/tests/test_litellm/llms/vertex_ai/gemini
Sameer Kankute 75c72c51e2
fix(vertex_ai): omit function_call id on Vertex Gemini 3.5+ tool turns (#28324)
* fix(vertex_ai): omit function_call id on Vertex Gemini 3.5+ tool turns

Vertex AI rejects `id` on function_call/function_response parts; only Google AI Studio accepts it for Gemini 3.5+ strict tool matching.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Update litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* fix(vertex_ai): forward custom_llm_provider in context caching

Pass custom_llm_provider through to _gemini_convert_messages_with_history
in the context caching path so Gemini 3.5+ tool-call `id` forwarding
behaves consistently between cached and non-cached completions on Google
AI Studio.

Co-authored-by: Claude <claude@anthropic.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <claude@anthropic.com>
(cherry picked from commit fecf212d70)
2026-05-20 18:50:59 -07:00
..
test_context_circulation.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_function_call_args_serialization.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_gemini_streaming_tool_call_finish_reason.py fix(vertex): streaming finish_reason="stop" instead of "tool_calls" for gemini-3.1-flash-lite-preview 2026-03-17 17:47:01 -03:00
test_thought_signature_in_tool_call_id.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_vertex_ai_gemini_transformation.py chore: reject bare str at file-input sinks to prevent local-file read (#27762) 2026-05-12 16:40:07 -07:00
test_vertex_and_google_ai_studio_gemini.py fix(vertex_ai): omit function_call id on Vertex Gemini 3.5+ tool turns (#28324) 2026-05-20 18:50:59 -07:00
test_vertex_gemini_unbound_local_error.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00