diff --git a/python_a2a/server/llm/openai.py b/python_a2a/server/llm/openai.py index c8513e4..a2aceb8 100644 --- a/python_a2a/server/llm/openai.py +++ b/python_a2a/server/llm/openai.py @@ -564,7 +564,8 @@ async def stream_response(self, message: Message) -> AsyncGenerator[str, None]: **kwargs ): if ( - hasattr(chunk.choices[0].delta, "content") + chunk.choices + and hasattr(chunk.choices[0].delta, "content") and chunk.choices[0].delta.content ): yield chunk.choices[0].delta.content