Skip to content

Conversation

@ldhldh
Copy link

@ldhldh ldhldh commented Jun 26, 2025

Description of Changes

When using LLM like Qwen, an index out of range error occurs during the final output chunk because chunk.choices[0] may not exist. This PR adds a check for chunk.choices before accessing chunk.choices[0] to prevent this error.

Testing

  • Tested with the Qwen model (agent_server.model = 'qwen-plus') using the following code snippet:
    async for chunk in agent_server.stream_response(message=message):
        print(chunk, end='', flush=True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant