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,235 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class ConversationItemWithReference < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute id
|
8
|
+
# For an item of type (`message` | `function_call` | `function_call_output`) this
|
9
|
+
# field allows the client to assign the unique ID of the item. It is not required
|
10
|
+
# because the server will generate one if not provided.
|
11
|
+
#
|
12
|
+
# For an item of type `item_reference`, this field is required and is a reference
|
13
|
+
# to any item that has previously existed in the conversation.
|
14
|
+
#
|
15
|
+
# @return [String, nil]
|
16
|
+
optional :id, String
|
17
|
+
|
18
|
+
# @!attribute arguments
|
19
|
+
# The arguments of the function call (for `function_call` items).
|
20
|
+
#
|
21
|
+
# @return [String, nil]
|
22
|
+
optional :arguments, String
|
23
|
+
|
24
|
+
# @!attribute call_id
|
25
|
+
# The ID of the function call (for `function_call` and `function_call_output`
|
26
|
+
# items). If passed on a `function_call_output` item, the server will check that a
|
27
|
+
# `function_call` item with the same ID exists in the conversation history.
|
28
|
+
#
|
29
|
+
# @return [String, nil]
|
30
|
+
optional :call_id, String
|
31
|
+
|
32
|
+
# @!attribute content
|
33
|
+
# The content of the message, applicable for `message` items.
|
34
|
+
#
|
35
|
+
# - Message items of role `system` support only `input_text` content
|
36
|
+
# - Message items of role `user` support `input_text` and `input_audio` content
|
37
|
+
# - Message items of role `assistant` support `text` content.
|
38
|
+
#
|
39
|
+
# @return [Array<OpenAI::Models::Realtime::ConversationItemWithReference::Content>, nil]
|
40
|
+
optional :content,
|
41
|
+
-> { OpenAI::Internal::Type::ArrayOf[OpenAI::Realtime::ConversationItemWithReference::Content] }
|
42
|
+
|
43
|
+
# @!attribute name
|
44
|
+
# The name of the function being called (for `function_call` items).
|
45
|
+
#
|
46
|
+
# @return [String, nil]
|
47
|
+
optional :name, String
|
48
|
+
|
49
|
+
# @!attribute object
|
50
|
+
# Identifier for the API object being returned - always `realtime.item`.
|
51
|
+
#
|
52
|
+
# @return [Symbol, OpenAI::Models::Realtime::ConversationItemWithReference::Object, nil]
|
53
|
+
optional :object, enum: -> { OpenAI::Realtime::ConversationItemWithReference::Object }
|
54
|
+
|
55
|
+
# @!attribute output
|
56
|
+
# The output of the function call (for `function_call_output` items).
|
57
|
+
#
|
58
|
+
# @return [String, nil]
|
59
|
+
optional :output, String
|
60
|
+
|
61
|
+
# @!attribute role
|
62
|
+
# The role of the message sender (`user`, `assistant`, `system`), only applicable
|
63
|
+
# for `message` items.
|
64
|
+
#
|
65
|
+
# @return [Symbol, OpenAI::Models::Realtime::ConversationItemWithReference::Role, nil]
|
66
|
+
optional :role, enum: -> { OpenAI::Realtime::ConversationItemWithReference::Role }
|
67
|
+
|
68
|
+
# @!attribute status
|
69
|
+
# The status of the item (`completed`, `incomplete`, `in_progress`). These have no
|
70
|
+
# effect on the conversation, but are accepted for consistency with the
|
71
|
+
# `conversation.item.created` event.
|
72
|
+
#
|
73
|
+
# @return [Symbol, OpenAI::Models::Realtime::ConversationItemWithReference::Status, nil]
|
74
|
+
optional :status, enum: -> { OpenAI::Realtime::ConversationItemWithReference::Status }
|
75
|
+
|
76
|
+
# @!attribute type
|
77
|
+
# The type of the item (`message`, `function_call`, `function_call_output`,
|
78
|
+
# `item_reference`).
|
79
|
+
#
|
80
|
+
# @return [Symbol, OpenAI::Models::Realtime::ConversationItemWithReference::Type, nil]
|
81
|
+
optional :type, enum: -> { OpenAI::Realtime::ConversationItemWithReference::Type }
|
82
|
+
|
83
|
+
# @!method initialize(id: nil, arguments: nil, call_id: nil, content: nil, name: nil, object: nil, output: nil, role: nil, status: nil, type: nil)
|
84
|
+
# Some parameter documentations has been truncated, see
|
85
|
+
# {OpenAI::Models::Realtime::ConversationItemWithReference} for more details.
|
86
|
+
#
|
87
|
+
# The item to add to the conversation.
|
88
|
+
#
|
89
|
+
# @param id [String] For an item of type (`message` | `function_call` | `function_call_output`)
|
90
|
+
#
|
91
|
+
# @param arguments [String] The arguments of the function call (for `function_call` items).
|
92
|
+
#
|
93
|
+
# @param call_id [String] The ID of the function call (for `function_call` and
|
94
|
+
#
|
95
|
+
# @param content [Array<OpenAI::Models::Realtime::ConversationItemWithReference::Content>] The content of the message, applicable for `message` items.
|
96
|
+
#
|
97
|
+
# @param name [String] The name of the function being called (for `function_call` items).
|
98
|
+
#
|
99
|
+
# @param object [Symbol, OpenAI::Models::Realtime::ConversationItemWithReference::Object] Identifier for the API object being returned - always `realtime.item`.
|
100
|
+
#
|
101
|
+
# @param output [String] The output of the function call (for `function_call_output` items).
|
102
|
+
#
|
103
|
+
# @param role [Symbol, OpenAI::Models::Realtime::ConversationItemWithReference::Role] The role of the message sender (`user`, `assistant`, `system`), only
|
104
|
+
#
|
105
|
+
# @param status [Symbol, OpenAI::Models::Realtime::ConversationItemWithReference::Status] The status of the item (`completed`, `incomplete`, `in_progress`). These have no
|
106
|
+
#
|
107
|
+
# @param type [Symbol, OpenAI::Models::Realtime::ConversationItemWithReference::Type] The type of the item (`message`, `function_call`, `function_call_output`,
|
108
|
+
# `item\_
|
109
|
+
|
110
|
+
class Content < OpenAI::Internal::Type::BaseModel
|
111
|
+
# @!attribute id
|
112
|
+
# ID of a previous conversation item to reference (for `item_reference` content
|
113
|
+
# types in `response.create` events). These can reference both client and server
|
114
|
+
# created items.
|
115
|
+
#
|
116
|
+
# @return [String, nil]
|
117
|
+
optional :id, String
|
118
|
+
|
119
|
+
# @!attribute audio
|
120
|
+
# Base64-encoded audio bytes, used for `input_audio` content type.
|
121
|
+
#
|
122
|
+
# @return [String, nil]
|
123
|
+
optional :audio, String
|
124
|
+
|
125
|
+
# @!attribute text
|
126
|
+
# The text content, used for `input_text` and `text` content types.
|
127
|
+
#
|
128
|
+
# @return [String, nil]
|
129
|
+
optional :text, String
|
130
|
+
|
131
|
+
# @!attribute transcript
|
132
|
+
# The transcript of the audio, used for `input_audio` content type.
|
133
|
+
#
|
134
|
+
# @return [String, nil]
|
135
|
+
optional :transcript, String
|
136
|
+
|
137
|
+
# @!attribute type
|
138
|
+
# The content type (`input_text`, `input_audio`, `item_reference`, `text`).
|
139
|
+
#
|
140
|
+
# @return [Symbol, OpenAI::Models::Realtime::ConversationItemWithReference::Content::Type, nil]
|
141
|
+
optional :type, enum: -> { OpenAI::Realtime::ConversationItemWithReference::Content::Type }
|
142
|
+
|
143
|
+
# @!method initialize(id: nil, audio: nil, text: nil, transcript: nil, type: nil)
|
144
|
+
# Some parameter documentations has been truncated, see
|
145
|
+
# {OpenAI::Models::Realtime::ConversationItemWithReference::Content} for more
|
146
|
+
# details.
|
147
|
+
#
|
148
|
+
# @param id [String] ID of a previous conversation item to reference (for `item_reference`
|
149
|
+
#
|
150
|
+
# @param audio [String] Base64-encoded audio bytes, used for `input_audio` content type.
|
151
|
+
#
|
152
|
+
# @param text [String] The text content, used for `input_text` and `text` content types.
|
153
|
+
#
|
154
|
+
# @param transcript [String] The transcript of the audio, used for `input_audio` content type.
|
155
|
+
#
|
156
|
+
# @param type [Symbol, OpenAI::Models::Realtime::ConversationItemWithReference::Content::Type] The content type (`input_text`, `input_audio`, `item_reference`, `text`).
|
157
|
+
|
158
|
+
# The content type (`input_text`, `input_audio`, `item_reference`, `text`).
|
159
|
+
#
|
160
|
+
# @see OpenAI::Models::Realtime::ConversationItemWithReference::Content#type
|
161
|
+
module Type
|
162
|
+
extend OpenAI::Internal::Type::Enum
|
163
|
+
|
164
|
+
INPUT_TEXT = :input_text
|
165
|
+
INPUT_AUDIO = :input_audio
|
166
|
+
ITEM_REFERENCE = :item_reference
|
167
|
+
TEXT = :text
|
168
|
+
|
169
|
+
# @!method self.values
|
170
|
+
# @return [Array<Symbol>]
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
# Identifier for the API object being returned - always `realtime.item`.
|
175
|
+
#
|
176
|
+
# @see OpenAI::Models::Realtime::ConversationItemWithReference#object
|
177
|
+
module Object
|
178
|
+
extend OpenAI::Internal::Type::Enum
|
179
|
+
|
180
|
+
REALTIME_ITEM = :"realtime.item"
|
181
|
+
|
182
|
+
# @!method self.values
|
183
|
+
# @return [Array<Symbol>]
|
184
|
+
end
|
185
|
+
|
186
|
+
# The role of the message sender (`user`, `assistant`, `system`), only applicable
|
187
|
+
# for `message` items.
|
188
|
+
#
|
189
|
+
# @see OpenAI::Models::Realtime::ConversationItemWithReference#role
|
190
|
+
module Role
|
191
|
+
extend OpenAI::Internal::Type::Enum
|
192
|
+
|
193
|
+
USER = :user
|
194
|
+
ASSISTANT = :assistant
|
195
|
+
SYSTEM = :system
|
196
|
+
|
197
|
+
# @!method self.values
|
198
|
+
# @return [Array<Symbol>]
|
199
|
+
end
|
200
|
+
|
201
|
+
# The status of the item (`completed`, `incomplete`, `in_progress`). These have no
|
202
|
+
# effect on the conversation, but are accepted for consistency with the
|
203
|
+
# `conversation.item.created` event.
|
204
|
+
#
|
205
|
+
# @see OpenAI::Models::Realtime::ConversationItemWithReference#status
|
206
|
+
module Status
|
207
|
+
extend OpenAI::Internal::Type::Enum
|
208
|
+
|
209
|
+
COMPLETED = :completed
|
210
|
+
INCOMPLETE = :incomplete
|
211
|
+
IN_PROGRESS = :in_progress
|
212
|
+
|
213
|
+
# @!method self.values
|
214
|
+
# @return [Array<Symbol>]
|
215
|
+
end
|
216
|
+
|
217
|
+
# The type of the item (`message`, `function_call`, `function_call_output`,
|
218
|
+
# `item_reference`).
|
219
|
+
#
|
220
|
+
# @see OpenAI::Models::Realtime::ConversationItemWithReference#type
|
221
|
+
module Type
|
222
|
+
extend OpenAI::Internal::Type::Enum
|
223
|
+
|
224
|
+
MESSAGE = :message
|
225
|
+
FUNCTION_CALL = :function_call
|
226
|
+
FUNCTION_CALL_OUTPUT = :function_call_output
|
227
|
+
ITEM_REFERENCE = :item_reference
|
228
|
+
|
229
|
+
# @!method self.values
|
230
|
+
# @return [Array<Symbol>]
|
231
|
+
end
|
232
|
+
end
|
233
|
+
end
|
234
|
+
end
|
235
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class InputAudioBufferAppendEvent < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute audio
|
8
|
+
# Base64-encoded audio bytes. This must be in the format specified by the
|
9
|
+
# `input_audio_format` field in the session configuration.
|
10
|
+
#
|
11
|
+
# @return [String]
|
12
|
+
required :audio, String
|
13
|
+
|
14
|
+
# @!attribute type
|
15
|
+
# The event type, must be `input_audio_buffer.append`.
|
16
|
+
#
|
17
|
+
# @return [Symbol, :"input_audio_buffer.append"]
|
18
|
+
required :type, const: :"input_audio_buffer.append"
|
19
|
+
|
20
|
+
# @!attribute event_id
|
21
|
+
# Optional client-generated ID used to identify this event.
|
22
|
+
#
|
23
|
+
# @return [String, nil]
|
24
|
+
optional :event_id, String
|
25
|
+
|
26
|
+
# @!method initialize(audio:, event_id: nil, type: :"input_audio_buffer.append")
|
27
|
+
# Some parameter documentations has been truncated, see
|
28
|
+
# {OpenAI::Models::Realtime::InputAudioBufferAppendEvent} for more details.
|
29
|
+
#
|
30
|
+
# Send this event to append audio bytes to the input audio buffer. The audio
|
31
|
+
# buffer is temporary storage you can write to and later commit. In Server VAD
|
32
|
+
# mode, the audio buffer is used to detect speech and the server will decide when
|
33
|
+
# to commit. When Server VAD is disabled, you must commit the audio buffer
|
34
|
+
# manually.
|
35
|
+
#
|
36
|
+
# The client may choose how much audio to place in each event up to a maximum of
|
37
|
+
# 15 MiB, for example streaming smaller chunks from the client may allow the VAD
|
38
|
+
# to be more responsive. Unlike made other client events, the server will not send
|
39
|
+
# a confirmation response to this event.
|
40
|
+
#
|
41
|
+
# @param audio [String] Base64-encoded audio bytes. This must be in the format specified by the
|
42
|
+
#
|
43
|
+
# @param event_id [String] Optional client-generated ID used to identify this event.
|
44
|
+
#
|
45
|
+
# @param type [Symbol, :"input_audio_buffer.append"] The event type, must be `input_audio_buffer.append`.
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class InputAudioBufferClearEvent < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute type
|
8
|
+
# The event type, must be `input_audio_buffer.clear`.
|
9
|
+
#
|
10
|
+
# @return [Symbol, :"input_audio_buffer.clear"]
|
11
|
+
required :type, const: :"input_audio_buffer.clear"
|
12
|
+
|
13
|
+
# @!attribute event_id
|
14
|
+
# Optional client-generated ID used to identify this event.
|
15
|
+
#
|
16
|
+
# @return [String, nil]
|
17
|
+
optional :event_id, String
|
18
|
+
|
19
|
+
# @!method initialize(event_id: nil, type: :"input_audio_buffer.clear")
|
20
|
+
# Send this event to clear the audio bytes in the buffer. The server will respond
|
21
|
+
# with an `input_audio_buffer.cleared` event.
|
22
|
+
#
|
23
|
+
# @param event_id [String] Optional client-generated ID used to identify this event.
|
24
|
+
#
|
25
|
+
# @param type [Symbol, :"input_audio_buffer.clear"] The event type, must be `input_audio_buffer.clear`.
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class InputAudioBufferClearedEvent < 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 type
|
14
|
+
# The event type, must be `input_audio_buffer.cleared`.
|
15
|
+
#
|
16
|
+
# @return [Symbol, :"input_audio_buffer.cleared"]
|
17
|
+
required :type, const: :"input_audio_buffer.cleared"
|
18
|
+
|
19
|
+
# @!method initialize(event_id:, type: :"input_audio_buffer.cleared")
|
20
|
+
# Returned when the input audio buffer is cleared by the client with a
|
21
|
+
# `input_audio_buffer.clear` event.
|
22
|
+
#
|
23
|
+
# @param event_id [String] The unique ID of the server event.
|
24
|
+
#
|
25
|
+
# @param type [Symbol, :"input_audio_buffer.cleared"] The event type, must be `input_audio_buffer.cleared`.
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class InputAudioBufferCommitEvent < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute type
|
8
|
+
# The event type, must be `input_audio_buffer.commit`.
|
9
|
+
#
|
10
|
+
# @return [Symbol, :"input_audio_buffer.commit"]
|
11
|
+
required :type, const: :"input_audio_buffer.commit"
|
12
|
+
|
13
|
+
# @!attribute event_id
|
14
|
+
# Optional client-generated ID used to identify this event.
|
15
|
+
#
|
16
|
+
# @return [String, nil]
|
17
|
+
optional :event_id, String
|
18
|
+
|
19
|
+
# @!method initialize(event_id: nil, type: :"input_audio_buffer.commit")
|
20
|
+
# Send this event to commit the user input audio buffer, which will create a new
|
21
|
+
# user message item in the conversation. This event will produce an error if the
|
22
|
+
# input audio buffer is empty. When in Server VAD mode, the client does not need
|
23
|
+
# to send this event, the server will commit the audio buffer automatically.
|
24
|
+
#
|
25
|
+
# Committing the input audio buffer will trigger input audio transcription (if
|
26
|
+
# enabled in session configuration), but it will not create a response from the
|
27
|
+
# model. The server will respond with an `input_audio_buffer.committed` event.
|
28
|
+
#
|
29
|
+
# @param event_id [String] Optional client-generated ID used to identify this event.
|
30
|
+
#
|
31
|
+
# @param type [Symbol, :"input_audio_buffer.commit"] The event type, must be `input_audio_buffer.commit`.
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class InputAudioBufferCommittedEvent < 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 user message item that will be created.
|
15
|
+
#
|
16
|
+
# @return [String]
|
17
|
+
required :item_id, String
|
18
|
+
|
19
|
+
# @!attribute type
|
20
|
+
# The event type, must be `input_audio_buffer.committed`.
|
21
|
+
#
|
22
|
+
# @return [Symbol, :"input_audio_buffer.committed"]
|
23
|
+
required :type, const: :"input_audio_buffer.committed"
|
24
|
+
|
25
|
+
# @!attribute previous_item_id
|
26
|
+
# The ID of the preceding item after which the new item will be inserted. Can be
|
27
|
+
# `null` if the item has no predecessor.
|
28
|
+
#
|
29
|
+
# @return [String, nil]
|
30
|
+
optional :previous_item_id, String, nil?: true
|
31
|
+
|
32
|
+
# @!method initialize(event_id:, item_id:, previous_item_id: nil, type: :"input_audio_buffer.committed")
|
33
|
+
# Some parameter documentations has been truncated, see
|
34
|
+
# {OpenAI::Models::Realtime::InputAudioBufferCommittedEvent} for more details.
|
35
|
+
#
|
36
|
+
# Returned when an input audio buffer is committed, either by the client or
|
37
|
+
# automatically in server VAD mode. The `item_id` property is the ID of the user
|
38
|
+
# message item that will be created, thus a `conversation.item.created` event will
|
39
|
+
# also be sent to the client.
|
40
|
+
#
|
41
|
+
# @param event_id [String] The unique ID of the server event.
|
42
|
+
#
|
43
|
+
# @param item_id [String] The ID of the user message item that will be created.
|
44
|
+
#
|
45
|
+
# @param previous_item_id [String, nil] The ID of the preceding item after which the new item will be inserted.
|
46
|
+
#
|
47
|
+
# @param type [Symbol, :"input_audio_buffer.committed"] The event type, must be `input_audio_buffer.committed`.
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class InputAudioBufferSpeechStartedEvent < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute audio_start_ms
|
8
|
+
# Milliseconds from the start of all audio written to the buffer during the
|
9
|
+
# session when speech was first detected. This will correspond to the beginning of
|
10
|
+
# audio sent to the model, and thus includes the `prefix_padding_ms` configured in
|
11
|
+
# the Session.
|
12
|
+
#
|
13
|
+
# @return [Integer]
|
14
|
+
required :audio_start_ms, Integer
|
15
|
+
|
16
|
+
# @!attribute event_id
|
17
|
+
# The unique ID of the server event.
|
18
|
+
#
|
19
|
+
# @return [String]
|
20
|
+
required :event_id, String
|
21
|
+
|
22
|
+
# @!attribute item_id
|
23
|
+
# The ID of the user message item that will be created when speech stops.
|
24
|
+
#
|
25
|
+
# @return [String]
|
26
|
+
required :item_id, String
|
27
|
+
|
28
|
+
# @!attribute type
|
29
|
+
# The event type, must be `input_audio_buffer.speech_started`.
|
30
|
+
#
|
31
|
+
# @return [Symbol, :"input_audio_buffer.speech_started"]
|
32
|
+
required :type, const: :"input_audio_buffer.speech_started"
|
33
|
+
|
34
|
+
# @!method initialize(audio_start_ms:, event_id:, item_id:, type: :"input_audio_buffer.speech_started")
|
35
|
+
# Some parameter documentations has been truncated, see
|
36
|
+
# {OpenAI::Models::Realtime::InputAudioBufferSpeechStartedEvent} for more details.
|
37
|
+
#
|
38
|
+
# Sent by the server when in `server_vad` mode to indicate that speech has been
|
39
|
+
# detected in the audio buffer. This can happen any time audio is added to the
|
40
|
+
# buffer (unless speech is already detected). The client may want to use this
|
41
|
+
# event to interrupt audio playback or provide visual feedback to the user.
|
42
|
+
#
|
43
|
+
# The client should expect to receive a `input_audio_buffer.speech_stopped` event
|
44
|
+
# when speech stops. The `item_id` property is the ID of the user message item
|
45
|
+
# that will be created when speech stops and will also be included in the
|
46
|
+
# `input_audio_buffer.speech_stopped` event (unless the client manually commits
|
47
|
+
# the audio buffer during VAD activation).
|
48
|
+
#
|
49
|
+
# @param audio_start_ms [Integer] Milliseconds from the start of all audio written to the buffer during the
|
50
|
+
#
|
51
|
+
# @param event_id [String] The unique ID of the server event.
|
52
|
+
#
|
53
|
+
# @param item_id [String] The ID of the user message item that will be created when speech stops.
|
54
|
+
#
|
55
|
+
# @param type [Symbol, :"input_audio_buffer.speech_started"] The event type, must be `input_audio_buffer.speech_started`.
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class InputAudioBufferSpeechStoppedEvent < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute audio_end_ms
|
8
|
+
# Milliseconds since the session started when speech stopped. This will correspond
|
9
|
+
# to the end of audio sent to the model, and thus includes the
|
10
|
+
# `min_silence_duration_ms` configured in the Session.
|
11
|
+
#
|
12
|
+
# @return [Integer]
|
13
|
+
required :audio_end_ms, Integer
|
14
|
+
|
15
|
+
# @!attribute event_id
|
16
|
+
# The unique ID of the server event.
|
17
|
+
#
|
18
|
+
# @return [String]
|
19
|
+
required :event_id, String
|
20
|
+
|
21
|
+
# @!attribute item_id
|
22
|
+
# The ID of the user message item that will be created.
|
23
|
+
#
|
24
|
+
# @return [String]
|
25
|
+
required :item_id, String
|
26
|
+
|
27
|
+
# @!attribute type
|
28
|
+
# The event type, must be `input_audio_buffer.speech_stopped`.
|
29
|
+
#
|
30
|
+
# @return [Symbol, :"input_audio_buffer.speech_stopped"]
|
31
|
+
required :type, const: :"input_audio_buffer.speech_stopped"
|
32
|
+
|
33
|
+
# @!method initialize(audio_end_ms:, event_id:, item_id:, type: :"input_audio_buffer.speech_stopped")
|
34
|
+
# Some parameter documentations has been truncated, see
|
35
|
+
# {OpenAI::Models::Realtime::InputAudioBufferSpeechStoppedEvent} for more details.
|
36
|
+
#
|
37
|
+
# Returned in `server_vad` mode when the server detects the end of speech in the
|
38
|
+
# audio buffer. The server will also send an `conversation.item.created` event
|
39
|
+
# with the user message item that is created from the audio buffer.
|
40
|
+
#
|
41
|
+
# @param audio_end_ms [Integer] Milliseconds since the session started when speech stopped. This will
|
42
|
+
#
|
43
|
+
# @param event_id [String] The unique ID of the server event.
|
44
|
+
#
|
45
|
+
# @param item_id [String] The ID of the user message item that will be created.
|
46
|
+
#
|
47
|
+
# @param type [Symbol, :"input_audio_buffer.speech_stopped"] The event type, must be `input_audio_buffer.speech_stopped`.
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class InputAudioBufferTimeoutTriggered < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute audio_end_ms
|
8
|
+
# Millisecond offset where speech ended within the buffered audio.
|
9
|
+
#
|
10
|
+
# @return [Integer]
|
11
|
+
required :audio_end_ms, Integer
|
12
|
+
|
13
|
+
# @!attribute audio_start_ms
|
14
|
+
# Millisecond offset where speech started within the buffered audio.
|
15
|
+
#
|
16
|
+
# @return [Integer]
|
17
|
+
required :audio_start_ms, 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 item associated with this segment.
|
27
|
+
#
|
28
|
+
# @return [String]
|
29
|
+
required :item_id, String
|
30
|
+
|
31
|
+
# @!attribute type
|
32
|
+
# The event type, must be `input_audio_buffer.timeout_triggered`.
|
33
|
+
#
|
34
|
+
# @return [Symbol, :"input_audio_buffer.timeout_triggered"]
|
35
|
+
required :type, const: :"input_audio_buffer.timeout_triggered"
|
36
|
+
|
37
|
+
# @!method initialize(audio_end_ms:, audio_start_ms:, event_id:, item_id:, type: :"input_audio_buffer.timeout_triggered")
|
38
|
+
# Returned when the server VAD timeout is triggered for the input audio buffer.
|
39
|
+
#
|
40
|
+
# @param audio_end_ms [Integer] Millisecond offset where speech ended within the buffered audio.
|
41
|
+
#
|
42
|
+
# @param audio_start_ms [Integer] Millisecond offset where speech started within the buffered audio.
|
43
|
+
#
|
44
|
+
# @param event_id [String] The unique ID of the server event.
|
45
|
+
#
|
46
|
+
# @param item_id [String] The ID of the item associated with this segment.
|
47
|
+
#
|
48
|
+
# @param type [Symbol, :"input_audio_buffer.timeout_triggered"] The event type, must be `input_audio_buffer.timeout_triggered`.
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class LogProbProperties < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute token
|
8
|
+
# The token that was used to generate the log probability.
|
9
|
+
#
|
10
|
+
# @return [String]
|
11
|
+
required :token, String
|
12
|
+
|
13
|
+
# @!attribute bytes
|
14
|
+
# The bytes that were used to generate the log probability.
|
15
|
+
#
|
16
|
+
# @return [Array<Integer>]
|
17
|
+
required :bytes, OpenAI::Internal::Type::ArrayOf[Integer]
|
18
|
+
|
19
|
+
# @!attribute logprob
|
20
|
+
# The log probability of the token.
|
21
|
+
#
|
22
|
+
# @return [Float]
|
23
|
+
required :logprob, Float
|
24
|
+
|
25
|
+
# @!method initialize(token:, bytes:, logprob:)
|
26
|
+
# Some parameter documentations has been truncated, see
|
27
|
+
# {OpenAI::Models::Realtime::LogProbProperties} for more details.
|
28
|
+
#
|
29
|
+
# A log probability object.
|
30
|
+
#
|
31
|
+
# @param token [String] The token that was used to generate the log probability.
|
32
|
+
#
|
33
|
+
# @param bytes [Array<Integer>] The bytes that were used to generate the log probability.
|
34
|
+
#
|
35
|
+
# @param logprob [Float] The log probability of the token.
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class McpListToolsCompleted < 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 MCP list tools item.
|
15
|
+
#
|
16
|
+
# @return [String]
|
17
|
+
required :item_id, String
|
18
|
+
|
19
|
+
# @!attribute type
|
20
|
+
# The event type, must be `mcp_list_tools.completed`.
|
21
|
+
#
|
22
|
+
# @return [Symbol, :"mcp_list_tools.completed"]
|
23
|
+
required :type, const: :"mcp_list_tools.completed"
|
24
|
+
|
25
|
+
# @!method initialize(event_id:, item_id:, type: :"mcp_list_tools.completed")
|
26
|
+
# Returned when listing MCP tools has completed for an item.
|
27
|
+
#
|
28
|
+
# @param event_id [String] The unique ID of the server event.
|
29
|
+
#
|
30
|
+
# @param item_id [String] The ID of the MCP list tools item.
|
31
|
+
#
|
32
|
+
# @param type [Symbol, :"mcp_list_tools.completed"] The event type, must be `mcp_list_tools.completed`.
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|