Skip to content

release: 2.41.0#3359

Merged
apcha-oai merged 2 commits into
mainfrom
release-please--branches--main--changes--next
Jun 3, 2026
Merged

release: 2.41.0#3359
apcha-oai merged 2 commits into
mainfrom
release-please--branches--main--changes--next

Conversation

@stainless-app

@stainless-app stainless-app Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Automated Release PR

2.41.0 (2026-06-03)

Full Changelog: v2.40.0...v2.41.0

Features

  • api: responses.moderation and chat_completions.moderation (87e46c2)

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

@stainless-app stainless-app Bot requested a review from a team as a code owner June 3, 2026 22:33

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +288 to +292
moderation: Optional[Moderation] = None
"""Moderation results for the request input and generated output.

Present on the moderation chunk when moderated completions are requested.
"""

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@apcha-oai apcha-oai merged commit 2d955a1 into main Jun 3, 2026
10 checks passed
@apcha-oai apcha-oai deleted the release-please--branches--main--changes--next branch June 3, 2026 22:39
@stainless-app

stainless-app Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Release is at https://github.com/openai/openai-python/releases/tag/v2.41.0 🌻

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant