mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-05 02:41:56 +00:00
fix(gemini realtime): default conversation_id before tool-call response.done
mypy flagged that response.done's conversation_id (str on the TypedDict) could be None when current_response_id was already set on entry. Ensure the fallback runs unconditionally before the response is constructed.
This commit is contained in:
parent
a0043494a0
commit
3efd803cd1
1 changed files with 3 additions and 3 deletions
|
|
@ -1241,13 +1241,13 @@ class GeminiRealtimeConfig(BaseRealtimeConfig):
|
|||
if not value.get("functionCalls"):
|
||||
continue
|
||||
|
||||
if current_conversation_id is None:
|
||||
current_conversation_id = f"conv_{uuid.uuid4()}"
|
||||
|
||||
# Emit response.created preamble if this is the first event in the response
|
||||
if current_response_id is None:
|
||||
current_response_id = f"resp_{uuid.uuid4()}"
|
||||
current_output_item_id = f"item_{uuid.uuid4()}"
|
||||
current_conversation_id = (
|
||||
current_conversation_id or f"conv_{uuid.uuid4()}"
|
||||
)
|
||||
|
||||
# Emit response.created
|
||||
returned_message.append(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue