Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/google/adk/models/gemini_llm_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,21 @@ async def receive(self) -> AsyncGenerator[LlmResponse, None]:
types.Part(function_call=function_call)
for function_call in message.tool_call.function_calls
])
# Yield tool call parts immediately so the framework can execute
# the tools and send responses back to the model. Models like
# Gemini 3.1 send tool calls via LiveServerToolCall and do not
# emit turn_complete until they receive the tool response, so
# deferring the yield would deadlock the conversation.
if tool_call_parts:
logger.debug(
'Yielding tool_call_parts immediately for live tool call'
)
yield LlmResponse(
content=types.Content(role='model', parts=tool_call_parts),
model_version=self._model_version,
live_session_id=live_session_id,
)
tool_call_parts = []
if message.session_resumption_update:
logger.debug('Received session resumption message: %s', message)
yield (
Expand Down
Loading