release: 2.41.0#3359
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 519cd02791
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| moderation: Optional[Moderation] = None | ||
| """Moderation results for the request input and generated output. | ||
|
|
||
| Present on the moderation chunk when moderated completions are requested. | ||
| """ |
There was a problem hiding this comment.
Preserve moderation chunks in streamed snapshots
When callers use client.chat.completions.stream(..., moderation=...), the API can send moderation on a dedicated later chunk (as this new docstring says), but the streaming accumulator in src/openai/lib/streaming/chat/_completions.py only copies the first chunk into the final snapshot and on subsequent chunks updates usage and system_fingerprint, not moderation. In that common stream shape, current_completion_snapshot and get_final_completion().moderation stay None even though the raw chunk carried results, so the helper silently drops the new feature for streamed completions.
Useful? React with 👍 / 👎.
|
🤖 Release is at https://github.com/openai/openai-python/releases/tag/v2.41.0 🌻 |
Automated Release PR
2.41.0 (2026-06-03)
Full Changelog: v2.40.0...v2.41.0
Features
This pull request is managed by Stainless's GitHub App.
The semver version number is based on included commit messages. Alternatively, you can manually set the version number in the title of this pull request.
For a better experience, it is recommended to use either rebase-merge or squash-merge when merging this pull request.
🔗 Stainless website
📚 Read the docs
🙋 Reach out for help or questions