From f124438a3a51ccc96b5a2f403bfc17c52d573340 Mon Sep 17 00:00:00 2001 From: jhakulin Date: Fri, 8 Nov 2024 20:12:18 -0800 Subject: [PATCH] fix function response --- src/realtime_ai/aio/realtime_ai_client.py | 2 +- src/realtime_ai/realtime_ai_client.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/realtime_ai/aio/realtime_ai_client.py b/src/realtime_ai/aio/realtime_ai_client.py index 70b8273..050449c 100644 --- a/src/realtime_ai/aio/realtime_ai_client.py +++ b/src/realtime_ai/aio/realtime_ai_client.py @@ -148,7 +148,7 @@ async def generate_response_from_function_call(self, call_id: str, function_outp "event_id": self.service_manager._generate_event_id(), "type": "conversation.item.create", "item": { - "id": str(uuid.uuid4()), # Generate a unique item ID + "id": str(uuid.uuid4()).replace('-', ''), "type": "function_call_output", "call_id": call_id, "output": function_output, diff --git a/src/realtime_ai/realtime_ai_client.py b/src/realtime_ai/realtime_ai_client.py index dd988de..6895736 100644 --- a/src/realtime_ai/realtime_ai_client.py +++ b/src/realtime_ai/realtime_ai_client.py @@ -1,6 +1,6 @@ import threading, logging import concurrent.futures -import queue, time +import queue, time, uuid from realtime_ai.models.realtime_ai_options import RealtimeAIOptions from realtime_ai.models.audio_stream_options import AudioStreamOptions @@ -134,7 +134,7 @@ def generate_response_from_function_call(self, call_id: str, function_output: st "event_id": self.service_manager._generate_event_id(), "type": "conversation.item.create", "item": { - "id": "1234", # Unique item ID + "id": str(uuid.uuid4()).replace('-', ''), "type": "function_call_output", "call_id": call_id, "output": function_output,