LLMService: run function calls sequentially

This commit is contained in:
Aleix Conchillo Flaqué
2025-04-25 20:04:35 -07:00
parent 9f223442c2
commit a50a407415
9 changed files with 166 additions and 72 deletions

View File

@@ -891,12 +891,15 @@ class GeminiMultimodalLiveLLMService(LLMService):
return
if not self._context:
logger.error("Function calls are not supported without a context object.")
for call in function_calls:
total_items = len(function_calls)
for index, call in enumerate(function_calls):
run_llm = index == total_items - 1
await self.call_function(
context=self._context,
tool_call_id=call.id,
function_name=call.name,
arguments=call.args,
run_llm=run_llm,
)
@traced_gemini_live(operation="llm_response")