You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8ecb487
Browse filesBrowse the repository at this point in the historyBrowse files
feat(api): accept typed references in Realtime response inputs (#4189)
## Summary
Pass existing Realtime item IDs as typed response input, alone or mixed
with messages. Existing response parameter and model types keep their
input fields, including reads and list mutations.
## Changes
- Accept existing items, item references, and mixed input in
`response.create` and raw `response.create` events.
- Keep references out of typed conversation item creation.
- Add `RealtimeResponseCreateParamsWithReferencesParam` and
`ResponseCreateEventWithReferencesParam` for requests that use
references.
## Typed subclass migration
If you override a sync or async Realtime connection or manager's `send`
method, widen its event annotation to also accept
`ResponseCreateEventWithReferencesParam`. Keep its existing
`RealtimeClientEvent` and `RealtimeClientEventParam` cases.
If you override a Realtime `response.create` method, also accept
`RealtimeResponseCreateParamsWithReferencesParam` for `response`. Keep
the existing parameter type and `omit` default. Handle or forward the
added inputs in each override. Existing callers do not need this
migration.
This static typing change follows the SDK's [minor-release versioning
policy](https://github.com/openai/openai-python#versioning).
## Validation
Compatibility controls passed for existing reads, mutations, parameter
and event types, new references and mixed inputs. Three typing files
produced exactly 14 intended rejections; strict model validation passed
30/30, and local WebSocket controls passed 74/74. All six subclass
overrides passed strict Pyright after the documented annotation update.
The local controls did not use a live server.
Earlier validation passed 173 query, upload, and Chat Completions
parsing and streaming tests; this fix does not change those REST paths.
Co-authored-by: markstuart-oai <323302876+markstuart-oai@users.noreply.github.com>
0 commit comments