Fixing the format and including the changelog.

This commit is contained in:
filipi87
2026-03-27 09:29:46 -03:00
parent 467184e63e
commit 537d57449e
2 changed files with 5 additions and 2 deletions

1
changelog/4152.fixed.md Normal file
View File

@@ -0,0 +1 @@
- Fixed a crash in OpenAI LLM processing when the provider returns `chunk.choices[0].delta.audio = None`, which caused `'NoneType' object has no attribute 'get'` errors during audio transcript handling.

View File

@@ -545,8 +545,10 @@ 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 and chunk.choices[0].delta.audio.get(
"transcript"
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"]))