Repository navigation
[Feat] Add tool calling support for gemini and vertex ai live api #26590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mateo-berri
merged 90 commits into
litellm_internal_staging
from
litellm_live_api_tool_calling_support
May 26, 2026
Merged
Changes from 83 commits
Commits
Show all changes
90 commits
Select commit
Hold shift + click to select a range
d3e3754
Add tool calling support for gemini and vertex ai live api
Sameerlite eb3ab4b
Fix greptile reviews
Sameerlite b591729
Add new functionality behind flag
Sameerlite 7882f80
fix greptile issues
Sameerlite c6a51d0
Fix greptile review
Sameerlite 7a989bb
Fix greptile review
Sameerlite 5f6f3e6
Fix greptile review
Sameerlite f94e5e3
Fix greptile review
Sameerlite b719e35
Fix greptile review
Sameerlite 817792c
fix lint
Sameerlite 86f5c21
fix(realtime): address P1 issues - guardrail timing and inputAudioTra…
Sameerlite 6274bc0
fix(realtime): inject turn_detection into first session.update for de…
Sameerlite 77571e8
fix(realtime): emit response.created preamble before tool-call events
Sameerlite 4fb0833
fix(realtime): add response.output_item.done to complete tool-call se…
Sameerlite 4af845d
fix(realtime): emit response.done after tool-call sequence (P0 CRITICAL)
Sameerlite 6fb312f
fix(realtime): include function name in toolResponse (P1)
Sameerlite 54f352c
Merge litellm_internal_staging into litellm_live_api_tool_calling_sup…
Sameerlite f942c8c
fix: resolve merge conflict markers in UI build chunk
Sameerlite 25a5ebe
fix(vertex_ai/realtime): call super().__init__() to initialize tool c…
cursoragent 165fedd
fix(realtime): correct guardrail flag and event-mapping fallback
cursoragent f5ecff2
fix(gemini/realtime): reset response IDs after tool-call response.done
Sameerlite b12f52a
fix lint
Sameerlite df7c3da
fix(realtime): log injected message and forward guardrail VAD-disable…
cursoragent 8df4d53
fix(gemini/realtime): resolve mypy TypedDict errors in transformation
Sameerlite cb49dd9
fix(realtime): forward turn_detection updates for Vertex; respect par…
cursoragent abb7080
fix(realtime): consolidate send-and-cache, guard session.update looku…
cursoragent c1647f6
fix(gemini realtime): pop tool_call_id mapping after use to bound memory
cursoragent 86ace3e
Merge branch 'litellm_internal_staging' into litellm_live_api_tool_ca…
Sameerlite 24af926
fix(realtime): correct deferred-setup session.created modalities and …
cursoragent 8e6fe6c
fix(gemini-realtime): preserve nested turn_detection through map_open…
cursoragent 76225f3
fix(realtime): normalize Vertex AI nested turn_detection and unify se…
cursoragent 38e822e
fix(realtime): tolerate non-dict turn_detection in guardrail injection
mateo-berri 159982a
fix(gemini realtime): default synthetic session.created modalities to…
cursoragent bcba880
fix(vertex_ai/realtime): drop follow-up session.update to avoid 1007 …
mateo-berri 2f0d808
fix(gemini realtime): default responseModalities to AUDIO in delta ev…
cursoragent b721714
fix(gemini realtime): default response.done modalities to AUDIO and c…
mateo-berri 6f45b5d
fix(realtime): set guardrail turn_detection flag only after successfu…
cursoragent 8cf3f4e
fix(vertex_ai realtime): keep VAD enabled when guardrails inject crea…
cursoragent 2325041
fix(gemini realtime): normalize GA-remapped session fields before map…
cursoragent fb93542
fix(vertex_ai/realtime): normalize all GA-remapped session fields bef…
mateo-berri f2d8a2a
fix(realtime): force create_response=False in all client session.upda…
mateo-berri 00cde9d
fix(lint): silence PLR0915 on client_ack_messages
mateo-berri 50ef9c8
fix(gemini realtime): preserve original setup config on follow-up ses…
cursoragent 36f6d84
fix(realtime): avoid double-serialization and normalize non-dict turn…
cursoragent 24b8e17
test(gemini realtime): exercise toolCall → function_call_output name …
mateo-berri 9efcc02
fix(realtime): correct conversation_id, VAD disable, modality state, …
cursoragent ba75de7
fix(realtime): preserve client session.update fields on follow-up Gem…
mateo-berri 76a8244
fix(gemini realtime): include usage on tool-call response.done; coerc…
cursoragent a004349
fix(gemini realtime): deep-merge nested config in follow-up session u…
cursoragent 3efd803
fix(gemini realtime): default conversation_id before tool-call respon…
mateo-berri 615a7da
fix(realtime): deep-merge generationConfig and refresh cache on follo…
mateo-berri b60cc95
fix(gemini realtime): mirror modalities/temperature/max_output_tokens…
mateo-berri c59260f
fix(gemini realtime): keep call_id→name mapping across function_call_…
mateo-berri 0780e5f
fix(gemini realtime): empty toolCall must not terminate the WebSocket
mateo-berri d56d875
fix(vertex realtime): warn when dropping guardrail turn-detection update
mateo-berri 459c197
fix(gemini realtime): deep-merge automaticActivityDetection on follow…
mateo-berri 20764dd
fix(realtime): record synthetic session.created in deferred-setup mode
mateo-berri e5ffd02
fix(gemini realtime): bound _tool_call_id_to_name with an LRU; exerci…
mateo-berri bafc187
test(gemini realtime): wrap remaining cached session configs in setup…
mateo-berri d1a9da3
fix(gemini realtime): cast merged realtimeInputConfig for typeddict a…
mateo-berri 42169c8
test(gemini realtime): wrap test_gemini_tool_call_resets_ids fixture …
mateo-berri 2c41400
fix(gemini realtime): skip unknown sibling keys in transform loop
cursoragent 61928b9
fix(gemini realtime): scope dotted-key event lookup and propagate ses…
cursoragent 6299633
fix(gemini realtime): cast maxOutputTokens to int for typeddict assig…
mateo-berri 3a1a5ae
fix(gemini realtime): use camelCase maxOutputTokens in response.done
cursoragent 1a838a1
fix(gemini realtime): cast maxOutputTokens to int for typeddict assig…
mateo-berri 1e4f86e
fix(realtime): inject guardrail turn_detection on subsequent session.…
cursoragent 84791fc
fix(gemini realtime): tolerate sibling-only frames (e.g. standalone u…
mateo-berri f1b76d9
fix(gemini realtime): preserve sibling toolCall when serverContent ha…
cursoragent ef98c98
refactor(gemini realtime): drop unused json_message arg from map_open…
cursoragent 295a9e6
fix(gemini realtime): promote nested turn_detection when flat value i…
cursoragent 16e44cb
fix(realtime): run guardrails on function_call_output content
mateo-berri 4ca26e8
fix(gemini realtime): emit function_call_arguments.delta before .done
mateo-berri a27e6bc
fix(realtime): avoid stale session.created flag triggering guardrail …
cursoragent d349085
fix(ci): restore guardrail injection on duplicate session.created and…
mateo-berri 70e1169
fix(realtime): forward sanitized function_call_output on guardrail block
mateo-berri 0e13cfa
fix(gemini realtime): preserve sibling keys on empty toolCall no-op
mateo-berri 039e86f
fix(gemini realtime): redact realtime payloads from debug logs
mateo-berri 73b6da9
fix(realtime): check function_call_output before user role to prevent…
cursoragent f54874f
Merge branch 'litellm_internal_staging' into litellm_live_api_tool_ca…
mateo-berri 02aa7b2
fix(gemini realtime): propagate usageMetadata on tool-call response.done
mateo-berri 35cc424
fix(realtime): send sanitized toolResponse before guardrail clientCon…
cursoragent e0e65bc
Merge branch 'litellm_internal_staging' into litellm_live_api_tool_ca…
mateo-berri ec79cec
test(model_prices): allow audio_transcription_config in schema
mateo-berri a8b592b
fix(gemini realtime): event_id, item copy, and dict guard for tool-ca…
cursoragent b102bc3
fix(gemini realtime): buffer standalone usageMetadata for next respon…
mateo-berri fa956e8
merge main (#28839)
Sameerlite 6a24096
Revert "merge main (#28839)"
Sameerlite a8ad90e
Merge remote-tracking branch 'origin/litellm_internal_staging' into l…
Sameerlite d1778b5
fix(gemini-realtime): prevent double-attribution of usageMetadata in …
cursoragent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.