function calling: start callback should have function name first

This commit is contained in:
Aleix Conchillo Flaqué
2024-08-18 20:48:20 -07:00
parent ef0d0531fa
commit f3a4e54996
4 changed files with 9 additions and 9 deletions

View File

@@ -323,9 +323,9 @@ class RTVIProcessor(FrameProcessor):
async def handle_function_call_start(
self,
function_name: str,
llm: FrameProcessor,
context: OpenAILLMContext,
function_name: str):
context: OpenAILLMContext):
fn = RTVILLMFunctionCallStartMessageData(function_name=function_name)
message = RTVILLMFunctionCallStartMessage(data=fn)
await self._push_transport_message(message, exclude_none=False)

View File

@@ -140,9 +140,9 @@ class LLMService(AIService):
# QUESTION FOR CB: maybe this isn't needed anymore?
async def call_start_function(self, context: OpenAILLMContext, function_name: str):
if function_name in self._start_callbacks.keys():
await self._start_callbacks[function_name](self, context, function_name)
await self._start_callbacks[function_name](function_name, self, context)
elif None in self._start_callbacks.keys():
return await self._start_callbacks[None](self, context, function_name)
return await self._start_callbacks[None](function_name, self, context)
async def request_image_frame(self, user_id: str, *, text_content: str | None = None):
await self.push_frame(UserImageRequestFrame(user_id=user_id, context=text_content),