This seems to all work?

This commit is contained in:
James Hush
2024-11-19 15:46:28 +08:00
parent 5fd6fc99fd
commit 571d538eb2
4 changed files with 104 additions and 14 deletions

View File

@@ -289,7 +289,7 @@ class TTSService(AIService):
async def process_frame(self, frame: Frame, direction: FrameDirection):
await super().process_frame(frame, direction)
print(f"_---_ai_services.py process_frame * frame: {frame}")
# print(f"_---_ai_services.py process_frame * frame: {frame}")
if isinstance(frame, TextFrame):
await self._process_text_frame(frame)

View File

@@ -242,7 +242,7 @@ class BaseOpenAILLMService(LLMService):
# yield a frame containing the function name and the arguments.
tool_call = chunk.choices[0].delta.tool_calls[0]
print(f"___________________________openai.py * tool_call_id: {tool_call_id}")
print(f"___________________________openai.py * tool_call_id: {tool_call_id} {tool_call.function.arguments}")
if tool_call.index != func_idx:
functions_list.append(function_name)
arguments_list.append(arguments)
@@ -507,7 +507,7 @@ class OpenAIAssistantContextAggregator(LLMAssistantContextAggregator):
async def process_frame(self, frame, direction):
await super().process_frame(frame, direction)
print(f"___<1>__openai.py * OpenAIAssistantContextAggregator process_frame frame : {frame}")
# print(f"___<1>__openai.py * OpenAIAssistantContextAggregator process_frame frame : {frame}")
# See note above about not calling push_frame() here.
if isinstance(frame, StartInterruptionFrame):
self._function_calls_in_progress.clear()
@@ -530,8 +530,8 @@ class OpenAIAssistantContextAggregator(LLMAssistantContextAggregator):
elif isinstance(frame, OpenAIImageMessageFrame):
self._pending_image_frame_message = frame
await self._push_aggregation()
else:
print(f"___<2>__openai.py * OpenAIAssistantContextAggregator process_frame frame : {frame}")
# else:
# print(f"___<2>__openai.py * OpenAIAssistantContextAggregator process_frame frame : {frame}")
async def _push_aggregation(self):
if not (