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:
mateo-berri 2026-05-22 21:34:14 +00:00 • committed by Claude
parent a0043494a0
commit 3efd803cd1
No known key found for this signature in database

View file

@ -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(