-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Open
Labels
Description
Confirm this is an issue with the Python library and not an underlying OpenAI API
- This is an issue with the Python library
Describe the bug
I receive an event with type response.audio_transcript.done but the ResponseAudioTranscriptDoneEvent type field expects the type to be set to response.output_audio_transcript.done.
# event_data is a dict
if event_data.type == "response.audio_transcript.done":
ResponseAudioTranscriptDoneEvent.model_validate(event)Raises this exception:
pydantic_core._pydantic_core.ValidationError: 1 validation error for ResponseAudioTranscriptDoneEvent
type
Input should be 'response.output_audio_transcript.done' [type=literal_error, input_value='response.audio_transcript.done', input_type=str]
For further information visit https://errors.pydantic.dev/2.12/v/literal_errorNote: I am not 100% sure if this is a problem with the Python SDK or with the Realtime API (there is no response.audio_transcript.done in the documentation
To Reproduce
- Use the Realtime API
- Try to parse server events sent over data channel using pydantic
model_validate
# event_data is a Python dict coming from the peerconnection data channel
if event_data.type == "response.audio_transcript.done":
ResponseAudioTranscriptDoneEvent.model_validate(event)Code snippets
OS
macOS
Python version
Python 3.12.9
Library version
2.5.0