From fcb6b6e7b82820a6fcb8e3d75ac34765c9a8e9bf Mon Sep 17 00:00:00 2001 From: lidenghui Date: Thu, 26 Jun 2025 18:13:11 +0800 Subject: [PATCH] bugfix_llm_like_qwen_error_index_out_of_range --- python_a2a/server/llm/openai.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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