-
Notifications
You must be signed in to change notification settings - Fork 583
Comments
fix(openai): Avoid consuming iterables passed to the Completions API#5489
fix(openai): Avoid consuming iterables passed to the Completions API #5489alexander-alderman-webb wants to merge 4 commits intomaster from
Conversation
Semver Impact of This PR
🟢 Patch (bug fixes)
📋 Changelog Preview
This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).
Bug Fixes 🐛
- (openai) Avoid consuming iterables passed to the Completions API by alexander-alderman-webb in
#5489
Internal Changes 🔧
- (agents) Add sentry skills to be used by warden in CI reviews by ericapisani in
#5485 - (ai) Add configuration for dotagents by ericapisani in
#5480 - (openai-agents) Expect new tool fields by alexander-alderman-webb in
#5471 - (repo) Add .serena to .gitignore by ericapisani in
#5464 - 🤖 Update test matrix with new releases (02/19) by github-actions in
#5483 - 🤖 Update test matrix with new releases (02/18) by github-actions in
#5475
🤖 This preview updates automatically when you update the PR.
Codecov Results 📊✅ 1860 passed | ⏭️ 154 skipped | Total: 2014 | Pass Rate: 92.35% | Execution Time: 3m 31s All tests are passing successfully. ❌ Patch coverage is 0.00%. Project has 11751 uncovered lines. Files with missing lines (173)
Generated by Codecov Action |
@ericapisani
ericapisani
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small thing I noticed but otherwise LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Typo on the function name (can be cleaned up in a follow up change)
Uh oh!
There was an error while loading. Please reload this page.
Description
Avoid consuming single-use iterators passed to the Completions API. The Completions API is typed more liberally than the Responses API and accepts single-use iterators.
Consumable iterables nested inside the
messagesobject are out of scope for this PR.All iterables that are not dictionaries or strings are transformed to lists in the internals of
openaibefore they are passed to the API call:https://github.com/openai/openai-python/blob/3e0c05b84a2056870abf3bd6a5e7849020209cc3/src/openai/_utils/_transform.py#L154
Issues
Reminders
tox -e linters.feat:,fix:,ref:,meta:)