Skip to content

fix: support non-streaming OpenAI chat completions#2400

Open
he-yufeng wants to merge 1 commit into
strands-agents:mainfrom
he-yufeng:fix/openai-disable-stream
Open

fix: support non-streaming OpenAI chat completions#2400
he-yufeng wants to merge 1 commit into
strands-agents:mainfrom
he-yufeng:fix/openai-disable-stream

Conversation

@he-yufeng
Copy link
Copy Markdown
Contributor

Summary

Fixes #778.

OpenAIModel now accepts stream=False as a model config option and keeps the older params={"stream": False} path working. When a non-streaming chat completion is requested, the provider converts the returned completion into the same Strands stream events that callers already consume.

To verify

  • python -m pytest tests\strands\models\test_openai.py -q
  • python -m ruff check src\strands\models\openai.py tests\strands\models\test_openai.py
  • python -m ruff format --check src\strands\models\openai.py tests\strands\models\test_openai.py
  • git diff --check

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Stream can't be disabled in OpenAIModel

1 participant