From 467184e63e6c095d227d766c541a416be6053db0 Mon Sep 17 00:00:00 2001 From: Vittorio Palmisano <283319+vpalmisano@users.noreply.github.com> Date: Thu, 26 Mar 2026 13:09:36 +0100 Subject: [PATCH] Fix audio transcript check in base_llm.py In some cases the openai provider could answer with a `chunk.choices[0].delta.audio = None`, so the process context fails with error: ``` pipecat/services/openai/base_llm.py:552): Error during completion: 'NoneType' object has no attribute 'get' ``` --- src/pipecat/services/openai/base_llm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pipecat/services/openai/base_llm.py b/src/pipecat/services/openai/base_llm.py index 53de03d09..a842da141 100644 --- a/src/pipecat/services/openai/base_llm.py +++ b/src/pipecat/services/openai/base_llm.py @@ -545,7 +545,7 @@ class BaseOpenAILLMService(LLMService): # When gpt-4o-audio / gpt-4o-mini-audio is used for llm or stt+llm # we need to get LLMTextFrame for the transcript - elif hasattr(chunk.choices[0].delta, "audio") and chunk.choices[0].delta.audio.get( + elif hasattr(chunk.choices[0].delta, "audio") and chunk.choices[0].delta.audio and chunk.choices[0].delta.audio.get( "transcript" ): await self.push_frame(LLMTextFrame(chunk.choices[0].delta.audio["transcript"]))