From b9d362bd62e4e8d45c96e14550bdec6beec54a45 Mon Sep 17 00:00:00 2001 From: Kwindla Hultman Kramer Date: Tue, 27 Aug 2024 17:39:21 -0700 Subject: [PATCH] fixup type mismatches between rtvi data structures and together.py --- src/pipecat/processors/frameworks/rtvi.py | 2 +- src/pipecat/services/together.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pipecat/processors/frameworks/rtvi.py b/src/pipecat/processors/frameworks/rtvi.py index e9953e878..7ca1c3620 100644 --- a/src/pipecat/processors/frameworks/rtvi.py +++ b/src/pipecat/processors/frameworks/rtvi.py @@ -222,7 +222,7 @@ class RTVILLMFunctionCallResultData(BaseModel): function_name: str tool_call_id: str arguments: dict - result: dict + result: dict | str class RTVITranscriptionMessageData(BaseModel): diff --git a/src/pipecat/services/together.py b/src/pipecat/services/together.py index 685609858..49759cb01 100644 --- a/src/pipecat/services/together.py +++ b/src/pipecat/services/together.py @@ -173,7 +173,7 @@ class TogetherLLMService(LLMService): try: arguments = json.loads(args_string) await self.call_function(context=context, - tool_call_id=uuid.uuid4(), + tool_call_id=str(uuid.uuid4()), function_name=function_name, arguments=arguments) return @@ -301,7 +301,8 @@ class TogetherAssistantContextAggregator(LLMAssistantContextAggregator): self._function_call_result = None self._context.add_message({ "role": "tool", - "content": frame.result + # Together expects the content here to be a string, so stringify it + "content": str(frame.result) }) run_llm = True else: