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
Which means you rely on this fallback code, which essentially ends up selecting the first element in the mapping (ResponseAudioDeltaEvent), and coerce a construction.
Activity
lemeb commentedon Apr 21, 2025
Can confirm on my end! Very weird.
lemeb commentedon Apr 21, 2025
Ok, I think I figured what's going on:
Because events of type
response.reasoning_summary_text.deltadon't have any data structure associated with it, the discriminator mapping fails.This line of code:
openai-python/src/openai/_models.py
Line 497 in ed53107
Will yield this:
Click to see the value of `disciminator`
{'error': <class 'openai.types.responses.response_error_event.ResponseErrorEvent'>, 'response.audio.delta': <class 'openai.types.responses.response_audio_delta_event.ResponseAudioDeltaEvent'>, 'response.audio.done': <class 'openai.types.responses.response_audio_done_event.ResponseAudioDoneEvent'>, 'response.audio.transcript.delta': <class 'openai.types.responses.response_audio_transcript_delta_event.ResponseAudioTranscriptDeltaEvent'>, 'response.audio.transcript.done': <class 'openai.types.responses.response_audio_transcript_done_event.ResponseAudioTranscriptDoneEvent'>, 'response.code_interpreter_call.code.delta': <class 'openai.types.responses.response_code_interpreter_call_code_delta_event.ResponseCodeInterpreterCallCodeDeltaEvent'>, 'response.code_interpreter_call.code.done': <class 'openai.types.responses.response_code_interpreter_call_code_done_event.ResponseCodeInterpreterCallCodeDoneEvent'>, 'response.code_interpreter_call.completed': <class 'openai.types.responses.response_code_interpreter_call_completed_event.ResponseCodeInterpreterCallCompletedEvent'>, 'response.code_interpreter_call.in_progress': <class 'openai.types.responses.response_code_interpreter_call_in_progress_event.ResponseCodeInterpreterCallInProgressEvent'>, 'response.code_interpreter_call.interpreting': <class 'openai.types.responses.response_code_interpreter_call_interpreting_event.ResponseCodeInterpreterCallInterpretingEvent'>, 'response.completed': <class 'openai.types.responses.response_completed_event.ResponseCompletedEvent'>, 'response.content_part.added': <class 'openai.types.responses.response_content_part_added_event.ResponseContentPartAddedEvent'>, 'response.content_part.done': <class 'openai.types.responses.response_content_part_done_event.ResponseContentPartDoneEvent'>, 'response.created': <class 'openai.types.responses.response_created_event.ResponseCreatedEvent'>, 'response.failed': <class 'openai.types.responses.response_failed_event.ResponseFailedEvent'>, 'response.file_search_call.completed': <class 'openai.types.responses.response_file_search_call_completed_event.ResponseFileSearchCallCompletedEvent'>, 'response.file_search_call.in_progress': <class 'openai.types.responses.response_file_search_call_in_progress_event.ResponseFileSearchCallInProgressEvent'>, 'response.file_search_call.searching': <class 'openai.types.responses.response_file_search_call_searching_event.ResponseFileSearchCallSearchingEvent'>, 'response.function_call_arguments.delta': <class 'openai.types.responses.response_function_call_arguments_delta_event.ResponseFunctionCallArgumentsDeltaEvent'>, 'response.function_call_arguments.done': <class 'openai.types.responses.response_function_call_arguments_done_event.ResponseFunctionCallArgumentsDoneEvent'>, 'response.in_progress': <class 'openai.types.responses.response_in_progress_event.ResponseInProgressEvent'>, 'response.incomplete': <class 'openai.types.responses.response_incomplete_event.ResponseIncompleteEvent'>, 'response.output_item.added': <class 'openai.types.responses.response_output_item_added_event.ResponseOutputItemAddedEvent'>, 'response.output_item.done': <class 'openai.types.responses.response_output_item_done_event.ResponseOutputItemDoneEvent'>, 'response.output_text.annotation.added': <class 'openai.types.responses.response_text_annotation_delta_event.ResponseTextAnnotationDeltaEvent'>, 'response.output_text.delta': <class 'openai.types.responses.response_text_delta_event.ResponseTextDeltaEvent'>, 'response.output_text.done': <class 'openai.types.responses.response_text_done_event.ResponseTextDoneEvent'>, 'response.refusal.delta': <class 'openai.types.responses.response_refusal_delta_event.ResponseRefusalDeltaEvent'>, 'response.refusal.done': <class 'openai.types.responses.response_refusal_done_event.ResponseRefusalDoneEvent'>, 'response.web_search_call.completed': <class 'openai.types.responses.response_web_search_call_completed_event.ResponseWebSearchCallCompletedEvent'>, 'response.web_search_call.in_progress': <class 'openai.types.responses.response_web_search_call_in_progress_event.ResponseWebSearchCallInProgressEvent'>, 'response.web_search_call.searching': <class 'openai.types.responses.response_web_search_call_searching_event.ResponseWebSearchCallSearchingEvent'>}And so this code will not return anything:
openai-python/src/openai/_models.py
Lines 498 to 503 in ed53107
Which means you rely on this fallback code, which essentially ends up selecting the first element in the mapping (
ResponseAudioDeltaEvent), and coerce a construction.openai-python/src/openai/_models.py
Lines 505 to 511 in ed53107
lemeb commentedon Apr 23, 2025
ok, seems like it was fixed by 6321004!
moonbox3 commentedon May 27, 2025
This is happening again in #2382 and #2383
apurvsibal commentedon Jun 12, 2025
+1
abhinav-wingback commentedon Aug 5, 2025
+1