Fixed an issue that start_callback was not invoked for some LLM services.

This commit is contained in:
Filipi Fuchter
2025-02-19 18:04:20 -03:00
parent c948754eff
commit 7e7926059c
4 changed files with 11 additions and 2 deletions

View File

@@ -175,6 +175,7 @@ class LLMService(AIService):
f = self._callbacks[None]
else:
return None
await self.call_start_function(context, function_name)
await context.call_function(
f,
function_name=function_name,

View File

@@ -266,7 +266,6 @@ class BaseOpenAILLMService(LLMService):
if tool_call.function and tool_call.function.name:
function_name += tool_call.function.name
tool_call_id = tool_call.id
await self.call_start_function(context, function_name)
if tool_call.function and tool_call.function.arguments:
# Keep iterating through the response to collect all the argument fragments
arguments += tool_call.function.arguments