From d1396bf618dc976e35317e01d17d902f4d006975 Mon Sep 17 00:00:00 2001 From: RonakAgarwalVani <124341245+RonakAgarwalVani@users.noreply.github.com> Date: Wed, 30 Oct 2024 14:26:49 +0530 Subject: [PATCH] Update openai.py --- src/pipecat/services/openai.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pipecat/services/openai.py b/src/pipecat/services/openai.py index 598240bd5..b6927e8dc 100644 --- a/src/pipecat/services/openai.py +++ b/src/pipecat/services/openai.py @@ -223,6 +223,9 @@ class BaseOpenAILLMService(LLMService): await self.stop_ttfb_metrics() + if not chunk.choices[0].delta: + continue + if chunk.choices[0].delta.tool_calls: # We're streaming the LLM response to enable the fastest response times. # For text, we just yield each chunk as we receive it and count on consumers