openai 0.19.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +28 -0
- data/README.md +1 -1
- data/lib/openai/client.rb +4 -0
- data/lib/openai/internal/stream.rb +3 -2
- data/lib/openai/models/audio/speech_create_params.rb +6 -0
- data/lib/openai/models/chat/chat_completion_audio_param.rb +6 -0
- data/lib/openai/models/chat/chat_completion_message.rb +7 -5
- data/lib/openai/models/chat/chat_completion_message_function_tool_call.rb +7 -5
- data/lib/openai/models/conversations/item_list_params.rb +2 -0
- data/lib/openai/models/evals/run_cancel_response.rb +2 -2
- data/lib/openai/models/evals/run_create_params.rb +2 -2
- data/lib/openai/models/evals/run_create_response.rb +2 -2
- data/lib/openai/models/evals/run_list_response.rb +2 -2
- data/lib/openai/models/evals/run_retrieve_response.rb +2 -2
- data/lib/openai/models/realtime/client_secret_create_params.rb +93 -0
- data/lib/openai/models/realtime/client_secret_create_response.rb +300 -0
- data/lib/openai/models/realtime/conversation_created_event.rb +70 -0
- data/lib/openai/models/realtime/conversation_item.rb +44 -0
- data/lib/openai/models/realtime/conversation_item_added.rb +48 -0
- data/lib/openai/models/realtime/conversation_item_create_event.rb +57 -0
- data/lib/openai/models/realtime/conversation_item_created_event.rb +59 -0
- data/lib/openai/models/realtime/conversation_item_delete_event.rb +39 -0
- data/lib/openai/models/realtime/conversation_item_deleted_event.rb +38 -0
- data/lib/openai/models/realtime/conversation_item_done.rb +48 -0
- data/lib/openai/models/realtime/conversation_item_input_audio_transcription_completed_event.rb +189 -0
- data/lib/openai/models/realtime/conversation_item_input_audio_transcription_delta_event.rb +63 -0
- data/lib/openai/models/realtime/conversation_item_input_audio_transcription_failed_event.rb +96 -0
- data/lib/openai/models/realtime/conversation_item_input_audio_transcription_segment.rb +84 -0
- data/lib/openai/models/realtime/conversation_item_retrieve_event.rb +40 -0
- data/lib/openai/models/realtime/conversation_item_truncate_event.rb +68 -0
- data/lib/openai/models/realtime/conversation_item_truncated_event.rb +60 -0
- data/lib/openai/models/realtime/conversation_item_with_reference.rb +235 -0
- data/lib/openai/models/realtime/input_audio_buffer_append_event.rb +49 -0
- data/lib/openai/models/realtime/input_audio_buffer_clear_event.rb +29 -0
- data/lib/openai/models/realtime/input_audio_buffer_cleared_event.rb +29 -0
- data/lib/openai/models/realtime/input_audio_buffer_commit_event.rb +35 -0
- data/lib/openai/models/realtime/input_audio_buffer_committed_event.rb +51 -0
- data/lib/openai/models/realtime/input_audio_buffer_speech_started_event.rb +59 -0
- data/lib/openai/models/realtime/input_audio_buffer_speech_stopped_event.rb +51 -0
- data/lib/openai/models/realtime/input_audio_buffer_timeout_triggered.rb +52 -0
- data/lib/openai/models/realtime/log_prob_properties.rb +39 -0
- data/lib/openai/models/realtime/mcp_list_tools_completed.rb +36 -0
- data/lib/openai/models/realtime/mcp_list_tools_failed.rb +36 -0
- data/lib/openai/models/realtime/mcp_list_tools_in_progress.rb +36 -0
- data/lib/openai/models/realtime/output_audio_buffer_clear_event.rb +32 -0
- data/lib/openai/models/realtime/rate_limits_updated_event.rb +91 -0
- data/lib/openai/models/realtime/realtime_audio_config.rb +446 -0
- data/lib/openai/models/realtime/realtime_client_event.rb +123 -0
- data/lib/openai/models/realtime/realtime_client_secret_config.rb +64 -0
- data/lib/openai/models/realtime/realtime_conversation_item_assistant_message.rb +118 -0
- data/lib/openai/models/realtime/realtime_conversation_item_function_call.rb +94 -0
- data/lib/openai/models/realtime/realtime_conversation_item_function_call_output.rb +86 -0
- data/lib/openai/models/realtime/realtime_conversation_item_system_message.rb +118 -0
- data/lib/openai/models/realtime/realtime_conversation_item_user_message.rb +135 -0
- data/lib/openai/models/realtime/realtime_error.rb +55 -0
- data/lib/openai/models/realtime/realtime_error_event.rb +38 -0
- data/lib/openai/models/realtime/realtime_mcp_approval_request.rb +52 -0
- data/lib/openai/models/realtime/realtime_mcp_approval_response.rb +52 -0
- data/lib/openai/models/realtime/realtime_mcp_list_tools.rb +84 -0
- data/lib/openai/models/realtime/realtime_mcp_protocol_error.rb +29 -0
- data/lib/openai/models/realtime/realtime_mcp_tool_call.rb +94 -0
- data/lib/openai/models/realtime/realtime_mcp_tool_execution_error.rb +23 -0
- data/lib/openai/models/realtime/realtime_mcphttp_error.rb +29 -0
- data/lib/openai/models/realtime/realtime_response.rb +259 -0
- data/lib/openai/models/realtime/realtime_response_status.rb +103 -0
- data/lib/openai/models/realtime/realtime_response_usage.rb +61 -0
- data/lib/openai/models/realtime/realtime_response_usage_input_token_details.rb +36 -0
- data/lib/openai/models/realtime/realtime_response_usage_output_token_details.rb +28 -0
- data/lib/openai/models/realtime/realtime_server_event.rb +369 -0
- data/lib/openai/models/realtime/realtime_session.rb +696 -0
- data/lib/openai/models/realtime/realtime_session_create_request.rb +234 -0
- data/lib/openai/models/realtime/realtime_session_create_response.rb +579 -0
- data/lib/openai/models/realtime/realtime_tool_choice_config.rb +32 -0
- data/lib/openai/models/realtime/realtime_tools_config.rb +11 -0
- data/lib/openai/models/realtime/realtime_tools_config_union.rb +379 -0
- data/lib/openai/models/realtime/realtime_tracing_config.rb +61 -0
- data/lib/openai/models/realtime/realtime_transcription_session_create_request.rb +312 -0
- data/lib/openai/models/realtime/realtime_truncation.rb +67 -0
- data/lib/openai/models/realtime/response_audio_delta_event.rb +68 -0
- data/lib/openai/models/realtime/response_audio_done_event.rb +61 -0
- data/lib/openai/models/realtime/response_audio_transcript_delta_event.rb +68 -0
- data/lib/openai/models/realtime/response_audio_transcript_done_event.rb +70 -0
- data/lib/openai/models/realtime/response_cancel_event.rb +42 -0
- data/lib/openai/models/realtime/response_content_part_added_event.rb +120 -0
- data/lib/openai/models/realtime/response_content_part_done_event.rb +120 -0
- data/lib/openai/models/realtime/response_create_event.rb +391 -0
- data/lib/openai/models/realtime/response_created_event.rb +37 -0
- data/lib/openai/models/realtime/response_done_event.rb +38 -0
- data/lib/openai/models/realtime/response_function_call_arguments_delta_event.rb +72 -0
- data/lib/openai/models/realtime/response_function_call_arguments_done_event.rb +73 -0
- data/lib/openai/models/realtime/response_mcp_call_arguments_delta.rb +68 -0
- data/lib/openai/models/realtime/response_mcp_call_arguments_done.rb +60 -0
- data/lib/openai/models/realtime/response_mcp_call_completed.rb +44 -0
- data/lib/openai/models/realtime/response_mcp_call_failed.rb +44 -0
- data/lib/openai/models/realtime/response_mcp_call_in_progress.rb +44 -0
- data/lib/openai/models/realtime/response_output_item_added_event.rb +52 -0
- data/lib/openai/models/realtime/response_output_item_done_event.rb +53 -0
- data/lib/openai/models/realtime/response_text_delta_event.rb +68 -0
- data/lib/openai/models/realtime/response_text_done_event.rb +69 -0
- data/lib/openai/models/realtime/session_created_event.rb +38 -0
- data/lib/openai/models/realtime/session_update_event.rb +44 -0
- data/lib/openai/models/realtime/session_updated_event.rb +37 -0
- data/lib/openai/models/realtime/transcription_session_created.rb +278 -0
- data/lib/openai/models/realtime/transcription_session_update.rb +36 -0
- data/lib/openai/models/realtime/transcription_session_updated_event.rb +279 -0
- data/lib/openai/models/responses/response.rb +6 -3
- data/lib/openai/models/responses/response_create_params.rb +8 -3
- data/lib/openai/models/responses/response_function_tool_call.rb +7 -5
- data/lib/openai/models/responses/response_function_web_search.rb +35 -1
- data/lib/openai/models/responses/response_includable.rb +2 -0
- data/lib/openai/models/responses/response_output_text.rb +7 -5
- data/lib/openai/models/responses/tool.rb +6 -2
- data/lib/openai/models/responses/web_search_preview_tool.rb +124 -0
- data/lib/openai/models/responses/web_search_tool.rb +58 -21
- data/lib/openai/models/webhooks/realtime_call_incoming_webhook_event.rb +119 -0
- data/lib/openai/models/webhooks/unwrap_webhook_event.rb +4 -1
- data/lib/openai/models.rb +2 -0
- data/lib/openai/resources/conversations.rb +1 -1
- data/lib/openai/resources/realtime/client_secrets.rb +44 -0
- data/lib/openai/resources/realtime.rb +18 -0
- data/lib/openai/resources/responses.rb +2 -2
- data/lib/openai/resources/webhooks.rb +1 -1
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +95 -0
- data/rbi/openai/client.rbi +3 -0
- data/rbi/openai/models/audio/speech_create_params.rbi +10 -0
- data/rbi/openai/models/chat/chat_completion_audio_param.rbi +10 -0
- data/rbi/openai/models/conversations/item_list_params.rbi +4 -0
- data/rbi/openai/models/evals/run_cancel_response.rbi +4 -2
- data/rbi/openai/models/evals/run_create_params.rbi +8 -4
- data/rbi/openai/models/evals/run_create_response.rbi +4 -2
- data/rbi/openai/models/evals/run_list_response.rbi +4 -2
- data/rbi/openai/models/evals/run_retrieve_response.rbi +4 -2
- data/rbi/openai/models/realtime/client_secret_create_params.rbi +222 -0
- data/rbi/openai/models/realtime/client_secret_create_response.rbi +676 -0
- data/rbi/openai/models/realtime/conversation_created_event.rbi +164 -0
- data/rbi/openai/models/realtime/conversation_item.rbi +35 -0
- data/rbi/openai/models/realtime/conversation_item_added.rbi +105 -0
- data/rbi/openai/models/realtime/conversation_item_create_event.rbi +123 -0
- data/rbi/openai/models/realtime/conversation_item_created_event.rbi +117 -0
- data/rbi/openai/models/realtime/conversation_item_delete_event.rbi +57 -0
- data/rbi/openai/models/realtime/conversation_item_deleted_event.rbi +53 -0
- data/rbi/openai/models/realtime/conversation_item_done.rbi +105 -0
- data/rbi/openai/models/realtime/conversation_item_input_audio_transcription_completed_event.rbi +305 -0
- data/rbi/openai/models/realtime/conversation_item_input_audio_transcription_delta_event.rbi +93 -0
- data/rbi/openai/models/realtime/conversation_item_input_audio_transcription_failed_event.rbi +158 -0
- data/rbi/openai/models/realtime/conversation_item_input_audio_transcription_segment.rbi +107 -0
- data/rbi/openai/models/realtime/conversation_item_retrieve_event.rbi +58 -0
- data/rbi/openai/models/realtime/conversation_item_truncate_event.rbi +94 -0
- data/rbi/openai/models/realtime/conversation_item_truncated_event.rbi +80 -0
- data/rbi/openai/models/realtime/conversation_item_with_reference.rbi +549 -0
- data/rbi/openai/models/realtime/input_audio_buffer_append_event.rbi +65 -0
- data/rbi/openai/models/realtime/input_audio_buffer_clear_event.rbi +43 -0
- data/rbi/openai/models/realtime/input_audio_buffer_cleared_event.rbi +40 -0
- data/rbi/openai/models/realtime/input_audio_buffer_commit_event.rbi +49 -0
- data/rbi/openai/models/realtime/input_audio_buffer_committed_event.rbi +72 -0
- data/rbi/openai/models/realtime/input_audio_buffer_speech_started_event.rbi +82 -0
- data/rbi/openai/models/realtime/input_audio_buffer_speech_stopped_event.rbi +73 -0
- data/rbi/openai/models/realtime/input_audio_buffer_timeout_triggered.rbi +75 -0
- data/rbi/openai/models/realtime/log_prob_properties.rbi +55 -0
- data/rbi/openai/models/realtime/mcp_list_tools_completed.rbi +51 -0
- data/rbi/openai/models/realtime/mcp_list_tools_failed.rbi +51 -0
- data/rbi/openai/models/realtime/mcp_list_tools_in_progress.rbi +51 -0
- data/rbi/openai/models/realtime/output_audio_buffer_clear_event.rbi +46 -0
- data/rbi/openai/models/realtime/rate_limits_updated_event.rbi +187 -0
- data/rbi/openai/models/realtime/realtime_audio_config.rbi +1004 -0
- data/rbi/openai/models/realtime/realtime_client_event.rbi +38 -0
- data/rbi/openai/models/realtime/realtime_client_secret_config.rbi +147 -0
- data/rbi/openai/models/realtime/realtime_conversation_item_assistant_message.rbi +292 -0
- data/rbi/openai/models/realtime/realtime_conversation_item_function_call.rbi +199 -0
- data/rbi/openai/models/realtime/realtime_conversation_item_function_call_output.rbi +188 -0
- data/rbi/openai/models/realtime/realtime_conversation_item_system_message.rbi +292 -0
- data/rbi/openai/models/realtime/realtime_conversation_item_user_message.rbi +319 -0
- data/rbi/openai/models/realtime/realtime_error.rbi +72 -0
- data/rbi/openai/models/realtime/realtime_error_event.rbi +64 -0
- data/rbi/openai/models/realtime/realtime_mcp_approval_request.rbi +75 -0
- data/rbi/openai/models/realtime/realtime_mcp_approval_response.rbi +75 -0
- data/rbi/openai/models/realtime/realtime_mcp_list_tools.rbi +131 -0
- data/rbi/openai/models/realtime/realtime_mcp_protocol_error.rbi +40 -0
- data/rbi/openai/models/realtime/realtime_mcp_tool_call.rbi +145 -0
- data/rbi/openai/models/realtime/realtime_mcp_tool_execution_error.rbi +31 -0
- data/rbi/openai/models/realtime/realtime_mcphttp_error.rbi +40 -0
- data/rbi/openai/models/realtime/realtime_response.rbi +573 -0
- data/rbi/openai/models/realtime/realtime_response_status.rbi +233 -0
- data/rbi/openai/models/realtime/realtime_response_usage.rbi +121 -0
- data/rbi/openai/models/realtime/realtime_response_usage_input_token_details.rbi +68 -0
- data/rbi/openai/models/realtime/realtime_response_usage_output_token_details.rbi +51 -0
- data/rbi/openai/models/realtime/realtime_server_event.rbi +311 -0
- data/rbi/openai/models/realtime/realtime_session.rbi +1426 -0
- data/rbi/openai/models/realtime/realtime_session_create_request.rbi +560 -0
- data/rbi/openai/models/realtime/realtime_session_create_response.rbi +1249 -0
- data/rbi/openai/models/realtime/realtime_tool_choice_config.rbi +30 -0
- data/rbi/openai/models/realtime/realtime_tools_config.rbi +15 -0
- data/rbi/openai/models/realtime/realtime_tools_config_union.rbi +755 -0
- data/rbi/openai/models/realtime/realtime_tracing_config.rbi +95 -0
- data/rbi/openai/models/realtime/realtime_transcription_session_create_request.rbi +703 -0
- data/rbi/openai/models/realtime/realtime_truncation.rbi +117 -0
- data/rbi/openai/models/realtime/response_audio_delta_event.rbi +91 -0
- data/rbi/openai/models/realtime/response_audio_done_event.rbi +84 -0
- data/rbi/openai/models/realtime/response_audio_transcript_delta_event.rbi +91 -0
- data/rbi/openai/models/realtime/response_audio_transcript_done_event.rbi +93 -0
- data/rbi/openai/models/realtime/response_cancel_event.rbi +63 -0
- data/rbi/openai/models/realtime/response_content_part_added_event.rbi +219 -0
- data/rbi/openai/models/realtime/response_content_part_done_event.rbi +219 -0
- data/rbi/openai/models/realtime/response_create_event.rbi +863 -0
- data/rbi/openai/models/realtime/response_created_event.rbi +65 -0
- data/rbi/openai/models/realtime/response_done_event.rbi +66 -0
- data/rbi/openai/models/realtime/response_function_call_arguments_delta_event.rbi +91 -0
- data/rbi/openai/models/realtime/response_function_call_arguments_done_event.rbi +92 -0
- data/rbi/openai/models/realtime/response_mcp_call_arguments_delta.rbi +91 -0
- data/rbi/openai/models/realtime/response_mcp_call_arguments_done.rbi +83 -0
- data/rbi/openai/models/realtime/response_mcp_call_completed.rbi +67 -0
- data/rbi/openai/models/realtime/response_mcp_call_failed.rbi +67 -0
- data/rbi/openai/models/realtime/response_mcp_call_in_progress.rbi +67 -0
- data/rbi/openai/models/realtime/response_output_item_added_event.rbi +111 -0
- data/rbi/openai/models/realtime/response_output_item_done_event.rbi +112 -0
- data/rbi/openai/models/realtime/response_text_delta_event.rbi +91 -0
- data/rbi/openai/models/realtime/response_text_done_event.rbi +92 -0
- data/rbi/openai/models/realtime/session_created_event.rbi +64 -0
- data/rbi/openai/models/realtime/session_update_event.rbi +77 -0
- data/rbi/openai/models/realtime/session_updated_event.rbi +63 -0
- data/rbi/openai/models/realtime/transcription_session_created.rbi +653 -0
- data/rbi/openai/models/realtime/transcription_session_update.rbi +74 -0
- data/rbi/openai/models/realtime/transcription_session_updated_event.rbi +657 -0
- data/rbi/openai/models/responses/response.rbi +10 -3
- data/rbi/openai/models/responses/response_create_params.rbi +20 -6
- data/rbi/openai/models/responses/response_function_web_search.rbi +78 -2
- data/rbi/openai/models/responses/response_includable.rbi +2 -0
- data/rbi/openai/models/responses/tool.rbi +2 -1
- data/rbi/openai/models/responses/web_search_preview_tool.rbi +245 -0
- data/rbi/openai/models/responses/web_search_tool.rbi +120 -23
- data/rbi/openai/models/webhooks/realtime_call_incoming_webhook_event.rbi +222 -0
- data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +1 -0
- data/rbi/openai/models.rbi +2 -0
- data/rbi/openai/resources/conversations/items.rbi +2 -0
- data/rbi/openai/resources/conversations.rbi +1 -1
- data/rbi/openai/resources/realtime/client_secrets.rbi +38 -0
- data/rbi/openai/resources/realtime.rbi +15 -0
- data/rbi/openai/resources/responses.rbi +16 -4
- data/rbi/openai/resources/webhooks.rbi +1 -0
- data/sig/openai/client.rbs +2 -0
- data/sig/openai/models/audio/speech_create_params.rbs +4 -0
- data/sig/openai/models/chat/chat_completion_audio_param.rbs +4 -0
- data/sig/openai/models/realtime/client_secret_create_params.rbs +89 -0
- data/sig/openai/models/realtime/client_secret_create_response.rbs +292 -0
- data/sig/openai/models/realtime/conversation_created_event.rbs +70 -0
- data/sig/openai/models/realtime/conversation_item.rbs +22 -0
- data/sig/openai/models/realtime/conversation_item_added.rbs +37 -0
- data/sig/openai/models/realtime/conversation_item_create_event.rbs +41 -0
- data/sig/openai/models/realtime/conversation_item_created_event.rbs +37 -0
- data/sig/openai/models/realtime/conversation_item_delete_event.rbs +30 -0
- data/sig/openai/models/realtime/conversation_item_deleted_event.rbs +32 -0
- data/sig/openai/models/realtime/conversation_item_done.rbs +37 -0
- data/sig/openai/models/realtime/conversation_item_input_audio_transcription_completed_event.rbs +136 -0
- data/sig/openai/models/realtime/conversation_item_input_audio_transcription_delta_event.rbs +51 -0
- data/sig/openai/models/realtime/conversation_item_input_audio_transcription_failed_event.rbs +77 -0
- data/sig/openai/models/realtime/conversation_item_input_audio_transcription_segment.rbs +62 -0
- data/sig/openai/models/realtime/conversation_item_retrieve_event.rbs +34 -0
- data/sig/openai/models/realtime/conversation_item_truncate_event.rbs +44 -0
- data/sig/openai/models/realtime/conversation_item_truncated_event.rbs +42 -0
- data/sig/openai/models/realtime/conversation_item_with_reference.rbs +207 -0
- data/sig/openai/models/realtime/input_audio_buffer_append_event.rbs +30 -0
- data/sig/openai/models/realtime/input_audio_buffer_clear_event.rbs +23 -0
- data/sig/openai/models/realtime/input_audio_buffer_cleared_event.rbs +24 -0
- data/sig/openai/models/realtime/input_audio_buffer_commit_event.rbs +23 -0
- data/sig/openai/models/realtime/input_audio_buffer_committed_event.rbs +37 -0
- data/sig/openai/models/realtime/input_audio_buffer_speech_started_event.rbs +37 -0
- data/sig/openai/models/realtime/input_audio_buffer_speech_stopped_event.rbs +37 -0
- data/sig/openai/models/realtime/input_audio_buffer_timeout_triggered.rbs +42 -0
- data/sig/openai/models/realtime/log_prob_properties.rbs +28 -0
- data/sig/openai/models/realtime/mcp_list_tools_completed.rbs +28 -0
- data/sig/openai/models/realtime/mcp_list_tools_failed.rbs +28 -0
- data/sig/openai/models/realtime/mcp_list_tools_in_progress.rbs +32 -0
- data/sig/openai/models/realtime/output_audio_buffer_clear_event.rbs +23 -0
- data/sig/openai/models/realtime/rate_limits_updated_event.rbs +85 -0
- data/sig/openai/models/realtime/realtime_audio_config.rbs +354 -0
- data/sig/openai/models/realtime/realtime_client_event.rbs +25 -0
- data/sig/openai/models/realtime/realtime_client_secret_config.rbs +60 -0
- data/sig/openai/models/realtime/realtime_conversation_item_assistant_message.rbs +117 -0
- data/sig/openai/models/realtime/realtime_conversation_item_function_call.rbs +86 -0
- data/sig/openai/models/realtime/realtime_conversation_item_function_call_output.rbs +79 -0
- data/sig/openai/models/realtime/realtime_conversation_item_system_message.rbs +117 -0
- data/sig/openai/models/realtime/realtime_conversation_item_user_message.rbs +132 -0
- data/sig/openai/models/realtime/realtime_error.rbs +42 -0
- data/sig/openai/models/realtime/realtime_error_event.rbs +32 -0
- data/sig/openai/models/realtime/realtime_mcp_approval_request.rbs +42 -0
- data/sig/openai/models/realtime/realtime_mcp_approval_response.rbs +42 -0
- data/sig/openai/models/realtime/realtime_mcp_list_tools.rbs +71 -0
- data/sig/openai/models/realtime/realtime_mcp_protocol_error.rbs +28 -0
- data/sig/openai/models/realtime/realtime_mcp_tool_call.rbs +68 -0
- data/sig/openai/models/realtime/realtime_mcp_tool_execution_error.rbs +18 -0
- data/sig/openai/models/realtime/realtime_mcphttp_error.rbs +24 -0
- data/sig/openai/models/realtime/realtime_response.rbs +210 -0
- data/sig/openai/models/realtime/realtime_response_status.rbs +90 -0
- data/sig/openai/models/realtime/realtime_response_usage.rbs +56 -0
- data/sig/openai/models/realtime/realtime_response_usage_input_token_details.rbs +34 -0
- data/sig/openai/models/realtime/realtime_response_usage_output_token_details.rbs +22 -0
- data/sig/openai/models/realtime/realtime_server_event.rbs +168 -0
- data/sig/openai/models/realtime/realtime_session.rbs +521 -0
- data/sig/openai/models/realtime/realtime_session_create_request.rbs +178 -0
- data/sig/openai/models/realtime/realtime_session_create_response.rbs +526 -0
- data/sig/openai/models/realtime/realtime_tool_choice_config.rbs +16 -0
- data/sig/openai/models/realtime/realtime_tools_config.rbs +10 -0
- data/sig/openai/models/realtime/realtime_tools_config_union.rbs +280 -0
- data/sig/openai/models/realtime/realtime_tracing_config.rbs +43 -0
- data/sig/openai/models/realtime/realtime_transcription_session_create_request.rbs +242 -0
- data/sig/openai/models/realtime/realtime_truncation.rbs +53 -0
- data/sig/openai/models/realtime/response_audio_delta_event.rbs +52 -0
- data/sig/openai/models/realtime/response_audio_done_event.rbs +47 -0
- data/sig/openai/models/realtime/response_audio_transcript_delta_event.rbs +52 -0
- data/sig/openai/models/realtime/response_audio_transcript_done_event.rbs +52 -0
- data/sig/openai/models/realtime/response_cancel_event.rbs +32 -0
- data/sig/openai/models/realtime/response_content_part_added_event.rbs +105 -0
- data/sig/openai/models/realtime/response_content_part_done_event.rbs +105 -0
- data/sig/openai/models/realtime/response_create_event.rbs +281 -0
- data/sig/openai/models/realtime/response_created_event.rbs +32 -0
- data/sig/openai/models/realtime/response_done_event.rbs +32 -0
- data/sig/openai/models/realtime/response_function_call_arguments_delta_event.rbs +52 -0
- data/sig/openai/models/realtime/response_function_call_arguments_done_event.rbs +52 -0
- data/sig/openai/models/realtime/response_mcp_call_arguments_delta.rbs +52 -0
- data/sig/openai/models/realtime/response_mcp_call_arguments_done.rbs +47 -0
- data/sig/openai/models/realtime/response_mcp_call_completed.rbs +37 -0
- data/sig/openai/models/realtime/response_mcp_call_failed.rbs +37 -0
- data/sig/openai/models/realtime/response_mcp_call_in_progress.rbs +37 -0
- data/sig/openai/models/realtime/response_output_item_added_event.rbs +42 -0
- data/sig/openai/models/realtime/response_output_item_done_event.rbs +42 -0
- data/sig/openai/models/realtime/response_text_delta_event.rbs +52 -0
- data/sig/openai/models/realtime/response_text_done_event.rbs +52 -0
- data/sig/openai/models/realtime/session_created_event.rbs +32 -0
- data/sig/openai/models/realtime/session_update_event.rbs +34 -0
- data/sig/openai/models/realtime/session_updated_event.rbs +32 -0
- data/sig/openai/models/realtime/transcription_session_created.rbs +282 -0
- data/sig/openai/models/realtime/transcription_session_update.rbs +34 -0
- data/sig/openai/models/realtime/transcription_session_updated_event.rbs +282 -0
- data/sig/openai/models/responses/response_function_web_search.rbs +34 -3
- data/sig/openai/models/responses/tool.rbs +1 -0
- data/sig/openai/models/responses/web_search_preview_tool.rbs +96 -0
- data/sig/openai/models/responses/web_search_tool.rbs +39 -10
- data/sig/openai/models/webhooks/realtime_call_incoming_webhook_event.rbs +90 -0
- data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +1 -0
- data/sig/openai/models.rbs +2 -0
- data/sig/openai/resources/realtime/client_secrets.rbs +15 -0
- data/sig/openai/resources/realtime.rbs +9 -0
- data/sig/openai/resources/webhooks.rbs +1 -0
- metadata +287 -2
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class ConversationItemDone < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute event_id
|
8
|
+
# The unique ID of the server event.
|
9
|
+
#
|
10
|
+
# @return [String]
|
11
|
+
required :event_id, String
|
12
|
+
|
13
|
+
# @!attribute item
|
14
|
+
# A single item within a Realtime conversation.
|
15
|
+
#
|
16
|
+
# @return [OpenAI::Models::Realtime::RealtimeConversationItemSystemMessage, OpenAI::Models::Realtime::RealtimeConversationItemUserMessage, OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage, OpenAI::Models::Realtime::RealtimeConversationItemFunctionCall, OpenAI::Models::Realtime::RealtimeConversationItemFunctionCallOutput, OpenAI::Models::Realtime::RealtimeMcpApprovalResponse, OpenAI::Models::Realtime::RealtimeMcpListTools, OpenAI::Models::Realtime::RealtimeMcpToolCall, OpenAI::Models::Realtime::RealtimeMcpApprovalRequest]
|
17
|
+
required :item, union: -> { OpenAI::Realtime::ConversationItem }
|
18
|
+
|
19
|
+
# @!attribute type
|
20
|
+
# The event type, must be `conversation.item.done`.
|
21
|
+
#
|
22
|
+
# @return [Symbol, :"conversation.item.done"]
|
23
|
+
required :type, const: :"conversation.item.done"
|
24
|
+
|
25
|
+
# @!attribute previous_item_id
|
26
|
+
# The ID of the item that precedes this one, if any. This is used to maintain
|
27
|
+
# ordering when items are inserted.
|
28
|
+
#
|
29
|
+
# @return [String, nil]
|
30
|
+
optional :previous_item_id, String, nil?: true
|
31
|
+
|
32
|
+
# @!method initialize(event_id:, item:, previous_item_id: nil, type: :"conversation.item.done")
|
33
|
+
# Some parameter documentations has been truncated, see
|
34
|
+
# {OpenAI::Models::Realtime::ConversationItemDone} for more details.
|
35
|
+
#
|
36
|
+
# Returned when a conversation item is finalized.
|
37
|
+
#
|
38
|
+
# @param event_id [String] The unique ID of the server event.
|
39
|
+
#
|
40
|
+
# @param item [OpenAI::Models::Realtime::RealtimeConversationItemSystemMessage, OpenAI::Models::Realtime::RealtimeConversationItemUserMessage, OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage, OpenAI::Models::Realtime::RealtimeConversationItemFunctionCall, OpenAI::Models::Realtime::RealtimeConversationItemFunctionCallOutput, OpenAI::Models::Realtime::RealtimeMcpApprovalResponse, OpenAI::Models::Realtime::RealtimeMcpListTools, OpenAI::Models::Realtime::RealtimeMcpToolCall, OpenAI::Models::Realtime::RealtimeMcpApprovalRequest] A single item within a Realtime conversation.
|
41
|
+
#
|
42
|
+
# @param previous_item_id [String, nil] The ID of the item that precedes this one, if any. This is used to
|
43
|
+
#
|
44
|
+
# @param type [Symbol, :"conversation.item.done"] The event type, must be `conversation.item.done`.
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
data/lib/openai/models/realtime/conversation_item_input_audio_transcription_completed_event.rb
ADDED
@@ -0,0 +1,189 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class ConversationItemInputAudioTranscriptionCompletedEvent < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute content_index
|
8
|
+
# The index of the content part containing the audio.
|
9
|
+
#
|
10
|
+
# @return [Integer]
|
11
|
+
required :content_index, Integer
|
12
|
+
|
13
|
+
# @!attribute event_id
|
14
|
+
# The unique ID of the server event.
|
15
|
+
#
|
16
|
+
# @return [String]
|
17
|
+
required :event_id, String
|
18
|
+
|
19
|
+
# @!attribute item_id
|
20
|
+
# The ID of the user message item containing the audio.
|
21
|
+
#
|
22
|
+
# @return [String]
|
23
|
+
required :item_id, String
|
24
|
+
|
25
|
+
# @!attribute transcript
|
26
|
+
# The transcribed text.
|
27
|
+
#
|
28
|
+
# @return [String]
|
29
|
+
required :transcript, String
|
30
|
+
|
31
|
+
# @!attribute type
|
32
|
+
# The event type, must be `conversation.item.input_audio_transcription.completed`.
|
33
|
+
#
|
34
|
+
# @return [Symbol, :"conversation.item.input_audio_transcription.completed"]
|
35
|
+
required :type, const: :"conversation.item.input_audio_transcription.completed"
|
36
|
+
|
37
|
+
# @!attribute usage
|
38
|
+
# Usage statistics for the transcription.
|
39
|
+
#
|
40
|
+
# @return [OpenAI::Models::Realtime::ConversationItemInputAudioTranscriptionCompletedEvent::Usage::TranscriptTextUsageTokens, OpenAI::Models::Realtime::ConversationItemInputAudioTranscriptionCompletedEvent::Usage::TranscriptTextUsageDuration]
|
41
|
+
required :usage,
|
42
|
+
union: -> { OpenAI::Realtime::ConversationItemInputAudioTranscriptionCompletedEvent::Usage }
|
43
|
+
|
44
|
+
# @!attribute logprobs
|
45
|
+
# The log probabilities of the transcription.
|
46
|
+
#
|
47
|
+
# @return [Array<OpenAI::Models::Realtime::LogProbProperties>, nil]
|
48
|
+
optional :logprobs,
|
49
|
+
-> { OpenAI::Internal::Type::ArrayOf[OpenAI::Realtime::LogProbProperties] },
|
50
|
+
nil?: true
|
51
|
+
|
52
|
+
# @!method initialize(content_index:, event_id:, item_id:, transcript:, usage:, logprobs: nil, type: :"conversation.item.input_audio_transcription.completed")
|
53
|
+
# Some parameter documentations has been truncated, see
|
54
|
+
# {OpenAI::Models::Realtime::ConversationItemInputAudioTranscriptionCompletedEvent}
|
55
|
+
# for more details.
|
56
|
+
#
|
57
|
+
# This event is the output of audio transcription for user audio written to the
|
58
|
+
# user audio buffer. Transcription begins when the input audio buffer is committed
|
59
|
+
# by the client or server (in `server_vad` mode). Transcription runs
|
60
|
+
# asynchronously with Response creation, so this event may come before or after
|
61
|
+
# the Response events.
|
62
|
+
#
|
63
|
+
# Realtime API models accept audio natively, and thus input transcription is a
|
64
|
+
# separate process run on a separate ASR (Automatic Speech Recognition) model. The
|
65
|
+
# transcript may diverge somewhat from the model's interpretation, and should be
|
66
|
+
# treated as a rough guide.
|
67
|
+
#
|
68
|
+
# @param content_index [Integer] The index of the content part containing the audio.
|
69
|
+
#
|
70
|
+
# @param event_id [String] The unique ID of the server event.
|
71
|
+
#
|
72
|
+
# @param item_id [String] The ID of the user message item containing the audio.
|
73
|
+
#
|
74
|
+
# @param transcript [String] The transcribed text.
|
75
|
+
#
|
76
|
+
# @param usage [OpenAI::Models::Realtime::ConversationItemInputAudioTranscriptionCompletedEvent::Usage::TranscriptTextUsageTokens, OpenAI::Models::Realtime::ConversationItemInputAudioTranscriptionCompletedEvent::Usage::TranscriptTextUsageDuration] Usage statistics for the transcription.
|
77
|
+
#
|
78
|
+
# @param logprobs [Array<OpenAI::Models::Realtime::LogProbProperties>, nil] The log probabilities of the transcription.
|
79
|
+
#
|
80
|
+
# @param type [Symbol, :"conversation.item.input_audio_transcription.completed"] The event type, must be
|
81
|
+
|
82
|
+
# Usage statistics for the transcription.
|
83
|
+
#
|
84
|
+
# @see OpenAI::Models::Realtime::ConversationItemInputAudioTranscriptionCompletedEvent#usage
|
85
|
+
module Usage
|
86
|
+
extend OpenAI::Internal::Type::Union
|
87
|
+
|
88
|
+
# Usage statistics for models billed by token usage.
|
89
|
+
variant -> { OpenAI::Realtime::ConversationItemInputAudioTranscriptionCompletedEvent::Usage::TranscriptTextUsageTokens }
|
90
|
+
|
91
|
+
# Usage statistics for models billed by audio input duration.
|
92
|
+
variant -> { OpenAI::Realtime::ConversationItemInputAudioTranscriptionCompletedEvent::Usage::TranscriptTextUsageDuration }
|
93
|
+
|
94
|
+
class TranscriptTextUsageTokens < OpenAI::Internal::Type::BaseModel
|
95
|
+
# @!attribute input_tokens
|
96
|
+
# Number of input tokens billed for this request.
|
97
|
+
#
|
98
|
+
# @return [Integer]
|
99
|
+
required :input_tokens, Integer
|
100
|
+
|
101
|
+
# @!attribute output_tokens
|
102
|
+
# Number of output tokens generated.
|
103
|
+
#
|
104
|
+
# @return [Integer]
|
105
|
+
required :output_tokens, Integer
|
106
|
+
|
107
|
+
# @!attribute total_tokens
|
108
|
+
# Total number of tokens used (input + output).
|
109
|
+
#
|
110
|
+
# @return [Integer]
|
111
|
+
required :total_tokens, Integer
|
112
|
+
|
113
|
+
# @!attribute type
|
114
|
+
# The type of the usage object. Always `tokens` for this variant.
|
115
|
+
#
|
116
|
+
# @return [Symbol, :tokens]
|
117
|
+
required :type, const: :tokens
|
118
|
+
|
119
|
+
# @!attribute input_token_details
|
120
|
+
# Details about the input tokens billed for this request.
|
121
|
+
#
|
122
|
+
# @return [OpenAI::Models::Realtime::ConversationItemInputAudioTranscriptionCompletedEvent::Usage::TranscriptTextUsageTokens::InputTokenDetails, nil]
|
123
|
+
optional :input_token_details,
|
124
|
+
-> { OpenAI::Realtime::ConversationItemInputAudioTranscriptionCompletedEvent::Usage::TranscriptTextUsageTokens::InputTokenDetails }
|
125
|
+
|
126
|
+
# @!method initialize(input_tokens:, output_tokens:, total_tokens:, input_token_details: nil, type: :tokens)
|
127
|
+
# Usage statistics for models billed by token usage.
|
128
|
+
#
|
129
|
+
# @param input_tokens [Integer] Number of input tokens billed for this request.
|
130
|
+
#
|
131
|
+
# @param output_tokens [Integer] Number of output tokens generated.
|
132
|
+
#
|
133
|
+
# @param total_tokens [Integer] Total number of tokens used (input + output).
|
134
|
+
#
|
135
|
+
# @param input_token_details [OpenAI::Models::Realtime::ConversationItemInputAudioTranscriptionCompletedEvent::Usage::TranscriptTextUsageTokens::InputTokenDetails] Details about the input tokens billed for this request.
|
136
|
+
#
|
137
|
+
# @param type [Symbol, :tokens] The type of the usage object. Always `tokens` for this variant.
|
138
|
+
|
139
|
+
# @see OpenAI::Models::Realtime::ConversationItemInputAudioTranscriptionCompletedEvent::Usage::TranscriptTextUsageTokens#input_token_details
|
140
|
+
class InputTokenDetails < OpenAI::Internal::Type::BaseModel
|
141
|
+
# @!attribute audio_tokens
|
142
|
+
# Number of audio tokens billed for this request.
|
143
|
+
#
|
144
|
+
# @return [Integer, nil]
|
145
|
+
optional :audio_tokens, Integer
|
146
|
+
|
147
|
+
# @!attribute text_tokens
|
148
|
+
# Number of text tokens billed for this request.
|
149
|
+
#
|
150
|
+
# @return [Integer, nil]
|
151
|
+
optional :text_tokens, Integer
|
152
|
+
|
153
|
+
# @!method initialize(audio_tokens: nil, text_tokens: nil)
|
154
|
+
# Details about the input tokens billed for this request.
|
155
|
+
#
|
156
|
+
# @param audio_tokens [Integer] Number of audio tokens billed for this request.
|
157
|
+
#
|
158
|
+
# @param text_tokens [Integer] Number of text tokens billed for this request.
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
class TranscriptTextUsageDuration < OpenAI::Internal::Type::BaseModel
|
163
|
+
# @!attribute seconds
|
164
|
+
# Duration of the input audio in seconds.
|
165
|
+
#
|
166
|
+
# @return [Float]
|
167
|
+
required :seconds, Float
|
168
|
+
|
169
|
+
# @!attribute type
|
170
|
+
# The type of the usage object. Always `duration` for this variant.
|
171
|
+
#
|
172
|
+
# @return [Symbol, :duration]
|
173
|
+
required :type, const: :duration
|
174
|
+
|
175
|
+
# @!method initialize(seconds:, type: :duration)
|
176
|
+
# Usage statistics for models billed by audio input duration.
|
177
|
+
#
|
178
|
+
# @param seconds [Float] Duration of the input audio in seconds.
|
179
|
+
#
|
180
|
+
# @param type [Symbol, :duration] The type of the usage object. Always `duration` for this variant.
|
181
|
+
end
|
182
|
+
|
183
|
+
# @!method self.variants
|
184
|
+
# @return [Array(OpenAI::Models::Realtime::ConversationItemInputAudioTranscriptionCompletedEvent::Usage::TranscriptTextUsageTokens, OpenAI::Models::Realtime::ConversationItemInputAudioTranscriptionCompletedEvent::Usage::TranscriptTextUsageDuration)]
|
185
|
+
end
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class ConversationItemInputAudioTranscriptionDeltaEvent < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute event_id
|
8
|
+
# The unique ID of the server event.
|
9
|
+
#
|
10
|
+
# @return [String]
|
11
|
+
required :event_id, String
|
12
|
+
|
13
|
+
# @!attribute item_id
|
14
|
+
# The ID of the item.
|
15
|
+
#
|
16
|
+
# @return [String]
|
17
|
+
required :item_id, String
|
18
|
+
|
19
|
+
# @!attribute type
|
20
|
+
# The event type, must be `conversation.item.input_audio_transcription.delta`.
|
21
|
+
#
|
22
|
+
# @return [Symbol, :"conversation.item.input_audio_transcription.delta"]
|
23
|
+
required :type, const: :"conversation.item.input_audio_transcription.delta"
|
24
|
+
|
25
|
+
# @!attribute content_index
|
26
|
+
# The index of the content part in the item's content array.
|
27
|
+
#
|
28
|
+
# @return [Integer, nil]
|
29
|
+
optional :content_index, Integer
|
30
|
+
|
31
|
+
# @!attribute delta
|
32
|
+
# The text delta.
|
33
|
+
#
|
34
|
+
# @return [String, nil]
|
35
|
+
optional :delta, String
|
36
|
+
|
37
|
+
# @!attribute logprobs
|
38
|
+
# The log probabilities of the transcription.
|
39
|
+
#
|
40
|
+
# @return [Array<OpenAI::Models::Realtime::LogProbProperties>, nil]
|
41
|
+
optional :logprobs,
|
42
|
+
-> { OpenAI::Internal::Type::ArrayOf[OpenAI::Realtime::LogProbProperties] },
|
43
|
+
nil?: true
|
44
|
+
|
45
|
+
# @!method initialize(event_id:, item_id:, content_index: nil, delta: nil, logprobs: nil, type: :"conversation.item.input_audio_transcription.delta")
|
46
|
+
# Returned when the text value of an input audio transcription content part is
|
47
|
+
# updated.
|
48
|
+
#
|
49
|
+
# @param event_id [String] The unique ID of the server event.
|
50
|
+
#
|
51
|
+
# @param item_id [String] The ID of the item.
|
52
|
+
#
|
53
|
+
# @param content_index [Integer] The index of the content part in the item's content array.
|
54
|
+
#
|
55
|
+
# @param delta [String] The text delta.
|
56
|
+
#
|
57
|
+
# @param logprobs [Array<OpenAI::Models::Realtime::LogProbProperties>, nil] The log probabilities of the transcription.
|
58
|
+
#
|
59
|
+
# @param type [Symbol, :"conversation.item.input_audio_transcription.delta"] The event type, must be `conversation.item.input_audio_transcription.delta`.
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,96 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class ConversationItemInputAudioTranscriptionFailedEvent < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute content_index
|
8
|
+
# The index of the content part containing the audio.
|
9
|
+
#
|
10
|
+
# @return [Integer]
|
11
|
+
required :content_index, Integer
|
12
|
+
|
13
|
+
# @!attribute error
|
14
|
+
# Details of the transcription error.
|
15
|
+
#
|
16
|
+
# @return [OpenAI::Models::Realtime::ConversationItemInputAudioTranscriptionFailedEvent::Error]
|
17
|
+
required :error, -> { OpenAI::Realtime::ConversationItemInputAudioTranscriptionFailedEvent::Error }
|
18
|
+
|
19
|
+
# @!attribute event_id
|
20
|
+
# The unique ID of the server event.
|
21
|
+
#
|
22
|
+
# @return [String]
|
23
|
+
required :event_id, String
|
24
|
+
|
25
|
+
# @!attribute item_id
|
26
|
+
# The ID of the user message item.
|
27
|
+
#
|
28
|
+
# @return [String]
|
29
|
+
required :item_id, String
|
30
|
+
|
31
|
+
# @!attribute type
|
32
|
+
# The event type, must be `conversation.item.input_audio_transcription.failed`.
|
33
|
+
#
|
34
|
+
# @return [Symbol, :"conversation.item.input_audio_transcription.failed"]
|
35
|
+
required :type, const: :"conversation.item.input_audio_transcription.failed"
|
36
|
+
|
37
|
+
# @!method initialize(content_index:, error:, event_id:, item_id:, type: :"conversation.item.input_audio_transcription.failed")
|
38
|
+
# Some parameter documentations has been truncated, see
|
39
|
+
# {OpenAI::Models::Realtime::ConversationItemInputAudioTranscriptionFailedEvent}
|
40
|
+
# for more details.
|
41
|
+
#
|
42
|
+
# Returned when input audio transcription is configured, and a transcription
|
43
|
+
# request for a user message failed. These events are separate from other `error`
|
44
|
+
# events so that the client can identify the related Item.
|
45
|
+
#
|
46
|
+
# @param content_index [Integer] The index of the content part containing the audio.
|
47
|
+
#
|
48
|
+
# @param error [OpenAI::Models::Realtime::ConversationItemInputAudioTranscriptionFailedEvent::Error] Details of the transcription error.
|
49
|
+
#
|
50
|
+
# @param event_id [String] The unique ID of the server event.
|
51
|
+
#
|
52
|
+
# @param item_id [String] The ID of the user message item.
|
53
|
+
#
|
54
|
+
# @param type [Symbol, :"conversation.item.input_audio_transcription.failed"] The event type, must be
|
55
|
+
|
56
|
+
# @see OpenAI::Models::Realtime::ConversationItemInputAudioTranscriptionFailedEvent#error
|
57
|
+
class Error < OpenAI::Internal::Type::BaseModel
|
58
|
+
# @!attribute code
|
59
|
+
# Error code, if any.
|
60
|
+
#
|
61
|
+
# @return [String, nil]
|
62
|
+
optional :code, String
|
63
|
+
|
64
|
+
# @!attribute message
|
65
|
+
# A human-readable error message.
|
66
|
+
#
|
67
|
+
# @return [String, nil]
|
68
|
+
optional :message, String
|
69
|
+
|
70
|
+
# @!attribute param
|
71
|
+
# Parameter related to the error, if any.
|
72
|
+
#
|
73
|
+
# @return [String, nil]
|
74
|
+
optional :param, String
|
75
|
+
|
76
|
+
# @!attribute type
|
77
|
+
# The type of error.
|
78
|
+
#
|
79
|
+
# @return [String, nil]
|
80
|
+
optional :type, String
|
81
|
+
|
82
|
+
# @!method initialize(code: nil, message: nil, param: nil, type: nil)
|
83
|
+
# Details of the transcription error.
|
84
|
+
#
|
85
|
+
# @param code [String] Error code, if any.
|
86
|
+
#
|
87
|
+
# @param message [String] A human-readable error message.
|
88
|
+
#
|
89
|
+
# @param param [String] Parameter related to the error, if any.
|
90
|
+
#
|
91
|
+
# @param type [String] The type of error.
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class ConversationItemInputAudioTranscriptionSegment < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute id
|
8
|
+
# The segment identifier.
|
9
|
+
#
|
10
|
+
# @return [String]
|
11
|
+
required :id, String
|
12
|
+
|
13
|
+
# @!attribute content_index
|
14
|
+
# The index of the input audio content part within the item.
|
15
|
+
#
|
16
|
+
# @return [Integer]
|
17
|
+
required :content_index, Integer
|
18
|
+
|
19
|
+
# @!attribute end_
|
20
|
+
# End time of the segment in seconds.
|
21
|
+
#
|
22
|
+
# @return [Float]
|
23
|
+
required :end_, Float, api_name: :end
|
24
|
+
|
25
|
+
# @!attribute event_id
|
26
|
+
# The unique ID of the server event.
|
27
|
+
#
|
28
|
+
# @return [String]
|
29
|
+
required :event_id, String
|
30
|
+
|
31
|
+
# @!attribute item_id
|
32
|
+
# The ID of the item containing the input audio content.
|
33
|
+
#
|
34
|
+
# @return [String]
|
35
|
+
required :item_id, String
|
36
|
+
|
37
|
+
# @!attribute speaker
|
38
|
+
# The detected speaker label for this segment.
|
39
|
+
#
|
40
|
+
# @return [String]
|
41
|
+
required :speaker, String
|
42
|
+
|
43
|
+
# @!attribute start
|
44
|
+
# Start time of the segment in seconds.
|
45
|
+
#
|
46
|
+
# @return [Float]
|
47
|
+
required :start, Float
|
48
|
+
|
49
|
+
# @!attribute text
|
50
|
+
# The text for this segment.
|
51
|
+
#
|
52
|
+
# @return [String]
|
53
|
+
required :text, String
|
54
|
+
|
55
|
+
# @!attribute type
|
56
|
+
# The event type, must be `conversation.item.input_audio_transcription.segment`.
|
57
|
+
#
|
58
|
+
# @return [Symbol, :"conversation.item.input_audio_transcription.segment"]
|
59
|
+
required :type, const: :"conversation.item.input_audio_transcription.segment"
|
60
|
+
|
61
|
+
# @!method initialize(id:, content_index:, end_:, event_id:, item_id:, speaker:, start:, text:, type: :"conversation.item.input_audio_transcription.segment")
|
62
|
+
# Returned when an input audio transcription segment is identified for an item.
|
63
|
+
#
|
64
|
+
# @param id [String] The segment identifier.
|
65
|
+
#
|
66
|
+
# @param content_index [Integer] The index of the input audio content part within the item.
|
67
|
+
#
|
68
|
+
# @param end_ [Float] End time of the segment in seconds.
|
69
|
+
#
|
70
|
+
# @param event_id [String] The unique ID of the server event.
|
71
|
+
#
|
72
|
+
# @param item_id [String] The ID of the item containing the input audio content.
|
73
|
+
#
|
74
|
+
# @param speaker [String] The detected speaker label for this segment.
|
75
|
+
#
|
76
|
+
# @param start [Float] Start time of the segment in seconds.
|
77
|
+
#
|
78
|
+
# @param text [String] The text for this segment.
|
79
|
+
#
|
80
|
+
# @param type [Symbol, :"conversation.item.input_audio_transcription.segment"] The event type, must be `conversation.item.input_audio_transcription.segment`.
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class ConversationItemRetrieveEvent < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute item_id
|
8
|
+
# The ID of the item to retrieve.
|
9
|
+
#
|
10
|
+
# @return [String]
|
11
|
+
required :item_id, String
|
12
|
+
|
13
|
+
# @!attribute type
|
14
|
+
# The event type, must be `conversation.item.retrieve`.
|
15
|
+
#
|
16
|
+
# @return [Symbol, :"conversation.item.retrieve"]
|
17
|
+
required :type, const: :"conversation.item.retrieve"
|
18
|
+
|
19
|
+
# @!attribute event_id
|
20
|
+
# Optional client-generated ID used to identify this event.
|
21
|
+
#
|
22
|
+
# @return [String, nil]
|
23
|
+
optional :event_id, String
|
24
|
+
|
25
|
+
# @!method initialize(item_id:, event_id: nil, type: :"conversation.item.retrieve")
|
26
|
+
# Send this event when you want to retrieve the server's representation of a
|
27
|
+
# specific item in the conversation history. This is useful, for example, to
|
28
|
+
# inspect user audio after noise cancellation and VAD. The server will respond
|
29
|
+
# with a `conversation.item.retrieved` event, unless the item does not exist in
|
30
|
+
# the conversation history, in which case the server will respond with an error.
|
31
|
+
#
|
32
|
+
# @param item_id [String] The ID of the item to retrieve.
|
33
|
+
#
|
34
|
+
# @param event_id [String] Optional client-generated ID used to identify this event.
|
35
|
+
#
|
36
|
+
# @param type [Symbol, :"conversation.item.retrieve"] The event type, must be `conversation.item.retrieve`.
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class ConversationItemTruncateEvent < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute audio_end_ms
|
8
|
+
# Inclusive duration up to which audio is truncated, in milliseconds. If the
|
9
|
+
# audio_end_ms is greater than the actual audio duration, the server will respond
|
10
|
+
# with an error.
|
11
|
+
#
|
12
|
+
# @return [Integer]
|
13
|
+
required :audio_end_ms, Integer
|
14
|
+
|
15
|
+
# @!attribute content_index
|
16
|
+
# The index of the content part to truncate. Set this to 0.
|
17
|
+
#
|
18
|
+
# @return [Integer]
|
19
|
+
required :content_index, Integer
|
20
|
+
|
21
|
+
# @!attribute item_id
|
22
|
+
# The ID of the assistant message item to truncate. Only assistant message items
|
23
|
+
# can be truncated.
|
24
|
+
#
|
25
|
+
# @return [String]
|
26
|
+
required :item_id, String
|
27
|
+
|
28
|
+
# @!attribute type
|
29
|
+
# The event type, must be `conversation.item.truncate`.
|
30
|
+
#
|
31
|
+
# @return [Symbol, :"conversation.item.truncate"]
|
32
|
+
required :type, const: :"conversation.item.truncate"
|
33
|
+
|
34
|
+
# @!attribute event_id
|
35
|
+
# Optional client-generated ID used to identify this event.
|
36
|
+
#
|
37
|
+
# @return [String, nil]
|
38
|
+
optional :event_id, String
|
39
|
+
|
40
|
+
# @!method initialize(audio_end_ms:, content_index:, item_id:, event_id: nil, type: :"conversation.item.truncate")
|
41
|
+
# Some parameter documentations has been truncated, see
|
42
|
+
# {OpenAI::Models::Realtime::ConversationItemTruncateEvent} for more details.
|
43
|
+
#
|
44
|
+
# Send this event to truncate a previous assistant message’s audio. The server
|
45
|
+
# will produce audio faster than realtime, so this event is useful when the user
|
46
|
+
# interrupts to truncate audio that has already been sent to the client but not
|
47
|
+
# yet played. This will synchronize the server's understanding of the audio with
|
48
|
+
# the client's playback.
|
49
|
+
#
|
50
|
+
# Truncating audio will delete the server-side text transcript to ensure there is
|
51
|
+
# not text in the context that hasn't been heard by the user.
|
52
|
+
#
|
53
|
+
# If successful, the server will respond with a `conversation.item.truncated`
|
54
|
+
# event.
|
55
|
+
#
|
56
|
+
# @param audio_end_ms [Integer] Inclusive duration up to which audio is truncated, in milliseconds. If
|
57
|
+
#
|
58
|
+
# @param content_index [Integer] The index of the content part to truncate. Set this to 0.
|
59
|
+
#
|
60
|
+
# @param item_id [String] The ID of the assistant message item to truncate. Only assistant message
|
61
|
+
#
|
62
|
+
# @param event_id [String] Optional client-generated ID used to identify this event.
|
63
|
+
#
|
64
|
+
# @param type [Symbol, :"conversation.item.truncate"] The event type, must be `conversation.item.truncate`.
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class ConversationItemTruncatedEvent < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute audio_end_ms
|
8
|
+
# The duration up to which the audio was truncated, in milliseconds.
|
9
|
+
#
|
10
|
+
# @return [Integer]
|
11
|
+
required :audio_end_ms, Integer
|
12
|
+
|
13
|
+
# @!attribute content_index
|
14
|
+
# The index of the content part that was truncated.
|
15
|
+
#
|
16
|
+
# @return [Integer]
|
17
|
+
required :content_index, Integer
|
18
|
+
|
19
|
+
# @!attribute event_id
|
20
|
+
# The unique ID of the server event.
|
21
|
+
#
|
22
|
+
# @return [String]
|
23
|
+
required :event_id, String
|
24
|
+
|
25
|
+
# @!attribute item_id
|
26
|
+
# The ID of the assistant message item that was truncated.
|
27
|
+
#
|
28
|
+
# @return [String]
|
29
|
+
required :item_id, String
|
30
|
+
|
31
|
+
# @!attribute type
|
32
|
+
# The event type, must be `conversation.item.truncated`.
|
33
|
+
#
|
34
|
+
# @return [Symbol, :"conversation.item.truncated"]
|
35
|
+
required :type, const: :"conversation.item.truncated"
|
36
|
+
|
37
|
+
# @!method initialize(audio_end_ms:, content_index:, event_id:, item_id:, type: :"conversation.item.truncated")
|
38
|
+
# Some parameter documentations has been truncated, see
|
39
|
+
# {OpenAI::Models::Realtime::ConversationItemTruncatedEvent} for more details.
|
40
|
+
#
|
41
|
+
# Returned when an earlier assistant audio message item is truncated by the client
|
42
|
+
# with a `conversation.item.truncate` event. This event is used to synchronize the
|
43
|
+
# server's understanding of the audio with the client's playback.
|
44
|
+
#
|
45
|
+
# This action will truncate the audio and remove the server-side text transcript
|
46
|
+
# to ensure there is no text in the context that hasn't been heard by the user.
|
47
|
+
#
|
48
|
+
# @param audio_end_ms [Integer] The duration up to which the audio was truncated, in milliseconds.
|
49
|
+
#
|
50
|
+
# @param content_index [Integer] The index of the content part that was truncated.
|
51
|
+
#
|
52
|
+
# @param event_id [String] The unique ID of the server event.
|
53
|
+
#
|
54
|
+
# @param item_id [String] The ID of the assistant message item that was truncated.
|
55
|
+
#
|
56
|
+
# @param type [Symbol, :"conversation.item.truncated"] The event type, must be `conversation.item.truncated`.
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|