openai 0.20.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 +13 -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/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 +6 -3
- data/lib/openai/models/responses/tool.rb +3 -156
- 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/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/evals/run_cancel_response.rbi +4 -4
- data/rbi/openai/models/evals/run_create_params.rbi +8 -8
- data/rbi/openai/models/evals/run_create_response.rbi +4 -4
- data/rbi/openai/models/evals/run_list_response.rbi +4 -4
- data/rbi/openai/models/evals/run_retrieve_response.rbi +4 -4
- 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 -4
- data/rbi/openai/models/responses/response_create_params.rbi +16 -10
- data/rbi/openai/models/responses/tool.rbi +2 -348
- 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/realtime/client_secrets.rbi +38 -0
- data/rbi/openai/resources/realtime.rbi +15 -0
- data/rbi/openai/resources/responses.rbi +12 -6
- 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/tool.rbs +1 -121
- 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,312 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class RealtimeTranscriptionSessionCreateRequest < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute model
|
8
|
+
# ID of the model to use. The options are `gpt-4o-transcribe`,
|
9
|
+
# `gpt-4o-mini-transcribe`, and `whisper-1` (which is powered by our open source
|
10
|
+
# Whisper V2 model).
|
11
|
+
#
|
12
|
+
# @return [String, Symbol, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::Model]
|
13
|
+
required :model, union: -> { OpenAI::Realtime::RealtimeTranscriptionSessionCreateRequest::Model }
|
14
|
+
|
15
|
+
# @!attribute type
|
16
|
+
# The type of session to create. Always `transcription` for transcription
|
17
|
+
# sessions.
|
18
|
+
#
|
19
|
+
# @return [Symbol, :transcription]
|
20
|
+
required :type, const: :transcription
|
21
|
+
|
22
|
+
# @!attribute include
|
23
|
+
# The set of items to include in the transcription. Current available items are:
|
24
|
+
#
|
25
|
+
# - `item.input_audio_transcription.logprobs`
|
26
|
+
#
|
27
|
+
# @return [Array<Symbol, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::Include>, nil]
|
28
|
+
optional :include,
|
29
|
+
-> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Realtime::RealtimeTranscriptionSessionCreateRequest::Include] }
|
30
|
+
|
31
|
+
# @!attribute input_audio_format
|
32
|
+
# The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. For
|
33
|
+
# `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, single channel
|
34
|
+
# (mono), and little-endian byte order.
|
35
|
+
#
|
36
|
+
# @return [Symbol, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioFormat, nil]
|
37
|
+
optional :input_audio_format,
|
38
|
+
enum: -> { OpenAI::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioFormat }
|
39
|
+
|
40
|
+
# @!attribute input_audio_noise_reduction
|
41
|
+
# Configuration for input audio noise reduction. This can be set to `null` to turn
|
42
|
+
# off. Noise reduction filters audio added to the input audio buffer before it is
|
43
|
+
# sent to VAD and the model. Filtering the audio can improve VAD and turn
|
44
|
+
# detection accuracy (reducing false positives) and model performance by improving
|
45
|
+
# perception of the input audio.
|
46
|
+
#
|
47
|
+
# @return [OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioNoiseReduction, nil]
|
48
|
+
optional :input_audio_noise_reduction,
|
49
|
+
-> { OpenAI::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioNoiseReduction }
|
50
|
+
|
51
|
+
# @!attribute input_audio_transcription
|
52
|
+
# Configuration for input audio transcription. The client can optionally set the
|
53
|
+
# language and prompt for transcription, these offer additional guidance to the
|
54
|
+
# transcription service.
|
55
|
+
#
|
56
|
+
# @return [OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioTranscription, nil]
|
57
|
+
optional :input_audio_transcription,
|
58
|
+
-> { OpenAI::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioTranscription }
|
59
|
+
|
60
|
+
# @!attribute turn_detection
|
61
|
+
# Configuration for turn detection. Can be set to `null` to turn off. Server VAD
|
62
|
+
# means that the model will detect the start and end of speech based on audio
|
63
|
+
# volume and respond at the end of user speech.
|
64
|
+
#
|
65
|
+
# @return [OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::TurnDetection, nil]
|
66
|
+
optional :turn_detection,
|
67
|
+
-> { OpenAI::Realtime::RealtimeTranscriptionSessionCreateRequest::TurnDetection }
|
68
|
+
|
69
|
+
# @!method initialize(model:, include: nil, input_audio_format: nil, input_audio_noise_reduction: nil, input_audio_transcription: nil, turn_detection: nil, type: :transcription)
|
70
|
+
# Some parameter documentations has been truncated, see
|
71
|
+
# {OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest} for more
|
72
|
+
# details.
|
73
|
+
#
|
74
|
+
# Realtime transcription session object configuration.
|
75
|
+
#
|
76
|
+
# @param model [String, Symbol, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::Model] ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transc
|
77
|
+
#
|
78
|
+
# @param include [Array<Symbol, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::Include>] The set of items to include in the transcription. Current available items are:
|
79
|
+
#
|
80
|
+
# @param input_audio_format [Symbol, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioFormat] The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
|
81
|
+
#
|
82
|
+
# @param input_audio_noise_reduction [OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioNoiseReduction] Configuration for input audio noise reduction. This can be set to `null` to turn
|
83
|
+
#
|
84
|
+
# @param input_audio_transcription [OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioTranscription] Configuration for input audio transcription. The client can optionally set the l
|
85
|
+
#
|
86
|
+
# @param turn_detection [OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::TurnDetection] Configuration for turn detection. Can be set to `null` to turn off. Server VAD m
|
87
|
+
#
|
88
|
+
# @param type [Symbol, :transcription] The type of session to create. Always `transcription` for transcription sessions
|
89
|
+
|
90
|
+
# ID of the model to use. The options are `gpt-4o-transcribe`,
|
91
|
+
# `gpt-4o-mini-transcribe`, and `whisper-1` (which is powered by our open source
|
92
|
+
# Whisper V2 model).
|
93
|
+
#
|
94
|
+
# @see OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest#model
|
95
|
+
module Model
|
96
|
+
extend OpenAI::Internal::Type::Union
|
97
|
+
|
98
|
+
variant String
|
99
|
+
|
100
|
+
variant const: -> { OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::Model::WHISPER_1 }
|
101
|
+
|
102
|
+
variant const: -> { OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::Model::GPT_4O_TRANSCRIBE }
|
103
|
+
|
104
|
+
variant const: -> { OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::Model::GPT_4O_MINI_TRANSCRIBE }
|
105
|
+
|
106
|
+
# @!method self.variants
|
107
|
+
# @return [Array(String, Symbol)]
|
108
|
+
|
109
|
+
define_sorbet_constant!(:Variants) do
|
110
|
+
T.type_alias { T.any(String, OpenAI::Realtime::RealtimeTranscriptionSessionCreateRequest::Model::TaggedSymbol) }
|
111
|
+
end
|
112
|
+
|
113
|
+
# @!group
|
114
|
+
|
115
|
+
WHISPER_1 = :"whisper-1"
|
116
|
+
GPT_4O_TRANSCRIBE = :"gpt-4o-transcribe"
|
117
|
+
GPT_4O_MINI_TRANSCRIBE = :"gpt-4o-mini-transcribe"
|
118
|
+
|
119
|
+
# @!endgroup
|
120
|
+
end
|
121
|
+
|
122
|
+
module Include
|
123
|
+
extend OpenAI::Internal::Type::Enum
|
124
|
+
|
125
|
+
ITEM_INPUT_AUDIO_TRANSCRIPTION_LOGPROBS = :"item.input_audio_transcription.logprobs"
|
126
|
+
|
127
|
+
# @!method self.values
|
128
|
+
# @return [Array<Symbol>]
|
129
|
+
end
|
130
|
+
|
131
|
+
# The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. For
|
132
|
+
# `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, single channel
|
133
|
+
# (mono), and little-endian byte order.
|
134
|
+
#
|
135
|
+
# @see OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest#input_audio_format
|
136
|
+
module InputAudioFormat
|
137
|
+
extend OpenAI::Internal::Type::Enum
|
138
|
+
|
139
|
+
PCM16 = :pcm16
|
140
|
+
G711_ULAW = :g711_ulaw
|
141
|
+
G711_ALAW = :g711_alaw
|
142
|
+
|
143
|
+
# @!method self.values
|
144
|
+
# @return [Array<Symbol>]
|
145
|
+
end
|
146
|
+
|
147
|
+
# @see OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest#input_audio_noise_reduction
|
148
|
+
class InputAudioNoiseReduction < OpenAI::Internal::Type::BaseModel
|
149
|
+
# @!attribute type
|
150
|
+
# Type of noise reduction. `near_field` is for close-talking microphones such as
|
151
|
+
# headphones, `far_field` is for far-field microphones such as laptop or
|
152
|
+
# conference room microphones.
|
153
|
+
#
|
154
|
+
# @return [Symbol, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioNoiseReduction::Type, nil]
|
155
|
+
optional :type,
|
156
|
+
enum: -> { OpenAI::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioNoiseReduction::Type }
|
157
|
+
|
158
|
+
# @!method initialize(type: nil)
|
159
|
+
# Some parameter documentations has been truncated, see
|
160
|
+
# {OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioNoiseReduction}
|
161
|
+
# for more details.
|
162
|
+
#
|
163
|
+
# Configuration for input audio noise reduction. This can be set to `null` to turn
|
164
|
+
# off. Noise reduction filters audio added to the input audio buffer before it is
|
165
|
+
# sent to VAD and the model. Filtering the audio can improve VAD and turn
|
166
|
+
# detection accuracy (reducing false positives) and model performance by improving
|
167
|
+
# perception of the input audio.
|
168
|
+
#
|
169
|
+
# @param type [Symbol, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioNoiseReduction::Type] Type of noise reduction. `near_field` is for close-talking microphones such as h
|
170
|
+
|
171
|
+
# Type of noise reduction. `near_field` is for close-talking microphones such as
|
172
|
+
# headphones, `far_field` is for far-field microphones such as laptop or
|
173
|
+
# conference room microphones.
|
174
|
+
#
|
175
|
+
# @see OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioNoiseReduction#type
|
176
|
+
module Type
|
177
|
+
extend OpenAI::Internal::Type::Enum
|
178
|
+
|
179
|
+
NEAR_FIELD = :near_field
|
180
|
+
FAR_FIELD = :far_field
|
181
|
+
|
182
|
+
# @!method self.values
|
183
|
+
# @return [Array<Symbol>]
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
# @see OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest#input_audio_transcription
|
188
|
+
class InputAudioTranscription < OpenAI::Internal::Type::BaseModel
|
189
|
+
# @!attribute language
|
190
|
+
# The language of the input audio. Supplying the input language in
|
191
|
+
# [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`)
|
192
|
+
# format will improve accuracy and latency.
|
193
|
+
#
|
194
|
+
# @return [String, nil]
|
195
|
+
optional :language, String
|
196
|
+
|
197
|
+
# @!attribute model
|
198
|
+
# The model to use for transcription, current options are `gpt-4o-transcribe`,
|
199
|
+
# `gpt-4o-mini-transcribe`, and `whisper-1`.
|
200
|
+
#
|
201
|
+
# @return [Symbol, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioTranscription::Model, nil]
|
202
|
+
optional :model,
|
203
|
+
enum: -> { OpenAI::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioTranscription::Model }
|
204
|
+
|
205
|
+
# @!attribute prompt
|
206
|
+
# An optional text to guide the model's style or continue a previous audio
|
207
|
+
# segment. For `whisper-1`, the
|
208
|
+
# [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting).
|
209
|
+
# For `gpt-4o-transcribe` models, the prompt is a free text string, for example
|
210
|
+
# "expect words related to technology".
|
211
|
+
#
|
212
|
+
# @return [String, nil]
|
213
|
+
optional :prompt, String
|
214
|
+
|
215
|
+
# @!method initialize(language: nil, model: nil, prompt: nil)
|
216
|
+
# Some parameter documentations has been truncated, see
|
217
|
+
# {OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioTranscription}
|
218
|
+
# for more details.
|
219
|
+
#
|
220
|
+
# Configuration for input audio transcription. The client can optionally set the
|
221
|
+
# language and prompt for transcription, these offer additional guidance to the
|
222
|
+
# transcription service.
|
223
|
+
#
|
224
|
+
# @param language [String] The language of the input audio. Supplying the input language in
|
225
|
+
#
|
226
|
+
# @param model [Symbol, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioTranscription::Model] The model to use for transcription, current options are `gpt-4o-transcribe`, `gp
|
227
|
+
#
|
228
|
+
# @param prompt [String] An optional text to guide the model's style or continue a previous audio
|
229
|
+
|
230
|
+
# The model to use for transcription, current options are `gpt-4o-transcribe`,
|
231
|
+
# `gpt-4o-mini-transcribe`, and `whisper-1`.
|
232
|
+
#
|
233
|
+
# @see OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::InputAudioTranscription#model
|
234
|
+
module Model
|
235
|
+
extend OpenAI::Internal::Type::Enum
|
236
|
+
|
237
|
+
GPT_4O_TRANSCRIBE = :"gpt-4o-transcribe"
|
238
|
+
GPT_4O_MINI_TRANSCRIBE = :"gpt-4o-mini-transcribe"
|
239
|
+
WHISPER_1 = :"whisper-1"
|
240
|
+
|
241
|
+
# @!method self.values
|
242
|
+
# @return [Array<Symbol>]
|
243
|
+
end
|
244
|
+
end
|
245
|
+
|
246
|
+
# @see OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest#turn_detection
|
247
|
+
class TurnDetection < OpenAI::Internal::Type::BaseModel
|
248
|
+
# @!attribute prefix_padding_ms
|
249
|
+
# Amount of audio to include before the VAD detected speech (in milliseconds).
|
250
|
+
# Defaults to 300ms.
|
251
|
+
#
|
252
|
+
# @return [Integer, nil]
|
253
|
+
optional :prefix_padding_ms, Integer
|
254
|
+
|
255
|
+
# @!attribute silence_duration_ms
|
256
|
+
# Duration of silence to detect speech stop (in milliseconds). Defaults to 500ms.
|
257
|
+
# With shorter values the model will respond more quickly, but may jump in on
|
258
|
+
# short pauses from the user.
|
259
|
+
#
|
260
|
+
# @return [Integer, nil]
|
261
|
+
optional :silence_duration_ms, Integer
|
262
|
+
|
263
|
+
# @!attribute threshold
|
264
|
+
# Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A higher
|
265
|
+
# threshold will require louder audio to activate the model, and thus might
|
266
|
+
# perform better in noisy environments.
|
267
|
+
#
|
268
|
+
# @return [Float, nil]
|
269
|
+
optional :threshold, Float
|
270
|
+
|
271
|
+
# @!attribute type
|
272
|
+
# Type of turn detection. Only `server_vad` is currently supported for
|
273
|
+
# transcription sessions.
|
274
|
+
#
|
275
|
+
# @return [Symbol, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::TurnDetection::Type, nil]
|
276
|
+
optional :type,
|
277
|
+
enum: -> { OpenAI::Realtime::RealtimeTranscriptionSessionCreateRequest::TurnDetection::Type }
|
278
|
+
|
279
|
+
# @!method initialize(prefix_padding_ms: nil, silence_duration_ms: nil, threshold: nil, type: nil)
|
280
|
+
# Some parameter documentations has been truncated, see
|
281
|
+
# {OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::TurnDetection}
|
282
|
+
# for more details.
|
283
|
+
#
|
284
|
+
# Configuration for turn detection. Can be set to `null` to turn off. Server VAD
|
285
|
+
# means that the model will detect the start and end of speech based on audio
|
286
|
+
# volume and respond at the end of user speech.
|
287
|
+
#
|
288
|
+
# @param prefix_padding_ms [Integer] Amount of audio to include before the VAD detected speech (in
|
289
|
+
#
|
290
|
+
# @param silence_duration_ms [Integer] Duration of silence to detect speech stop (in milliseconds). Defaults
|
291
|
+
#
|
292
|
+
# @param threshold [Float] Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A
|
293
|
+
#
|
294
|
+
# @param type [Symbol, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::TurnDetection::Type] Type of turn detection. Only `server_vad` is currently supported for transcripti
|
295
|
+
|
296
|
+
# Type of turn detection. Only `server_vad` is currently supported for
|
297
|
+
# transcription sessions.
|
298
|
+
#
|
299
|
+
# @see OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateRequest::TurnDetection#type
|
300
|
+
module Type
|
301
|
+
extend OpenAI::Internal::Type::Enum
|
302
|
+
|
303
|
+
SERVER_VAD = :server_vad
|
304
|
+
|
305
|
+
# @!method self.values
|
306
|
+
# @return [Array<Symbol>]
|
307
|
+
end
|
308
|
+
end
|
309
|
+
end
|
310
|
+
end
|
311
|
+
end
|
312
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
# Controls how the realtime conversation is truncated prior to model inference.
|
7
|
+
# The default is `auto`. When set to `retention_ratio`, the server retains a
|
8
|
+
# fraction of the conversation tokens prior to the instructions.
|
9
|
+
module RealtimeTruncation
|
10
|
+
extend OpenAI::Internal::Type::Union
|
11
|
+
|
12
|
+
# The truncation strategy to use for the session.
|
13
|
+
variant enum: -> { OpenAI::Realtime::RealtimeTruncation::RealtimeTruncationStrategy }
|
14
|
+
|
15
|
+
# Retain a fraction of the conversation tokens.
|
16
|
+
variant -> { OpenAI::Realtime::RealtimeTruncation::RetentionRatioTruncation }
|
17
|
+
|
18
|
+
# The truncation strategy to use for the session.
|
19
|
+
module RealtimeTruncationStrategy
|
20
|
+
extend OpenAI::Internal::Type::Enum
|
21
|
+
|
22
|
+
AUTO = :auto
|
23
|
+
DISABLED = :disabled
|
24
|
+
|
25
|
+
# @!method self.values
|
26
|
+
# @return [Array<Symbol>]
|
27
|
+
end
|
28
|
+
|
29
|
+
class RetentionRatioTruncation < OpenAI::Internal::Type::BaseModel
|
30
|
+
# @!attribute retention_ratio
|
31
|
+
# Fraction of pre-instruction conversation tokens to retain (0.0 - 1.0).
|
32
|
+
#
|
33
|
+
# @return [Float]
|
34
|
+
required :retention_ratio, Float
|
35
|
+
|
36
|
+
# @!attribute type
|
37
|
+
# Use retention ratio truncation.
|
38
|
+
#
|
39
|
+
# @return [Symbol, :retention_ratio]
|
40
|
+
required :type, const: :retention_ratio
|
41
|
+
|
42
|
+
# @!attribute post_instructions_token_limit
|
43
|
+
# Optional cap on tokens allowed after the instructions.
|
44
|
+
#
|
45
|
+
# @return [Integer, nil]
|
46
|
+
optional :post_instructions_token_limit, Integer, nil?: true
|
47
|
+
|
48
|
+
# @!method initialize(retention_ratio:, post_instructions_token_limit: nil, type: :retention_ratio)
|
49
|
+
# Some parameter documentations has been truncated, see
|
50
|
+
# {OpenAI::Models::Realtime::RealtimeTruncation::RetentionRatioTruncation} for
|
51
|
+
# more details.
|
52
|
+
#
|
53
|
+
# Retain a fraction of the conversation tokens.
|
54
|
+
#
|
55
|
+
# @param retention_ratio [Float] Fraction of pre-instruction conversation tokens to retain (0.0 - 1.0).
|
56
|
+
#
|
57
|
+
# @param post_instructions_token_limit [Integer, nil] Optional cap on tokens allowed after the instructions.
|
58
|
+
#
|
59
|
+
# @param type [Symbol, :retention_ratio] Use retention ratio truncation.
|
60
|
+
end
|
61
|
+
|
62
|
+
# @!method self.variants
|
63
|
+
# @return [Array(Symbol, OpenAI::Models::Realtime::RealtimeTruncation::RealtimeTruncationStrategy, OpenAI::Models::Realtime::RealtimeTruncation::RetentionRatioTruncation)]
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class ResponseAudioDeltaEvent < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute content_index
|
8
|
+
# The index of the content part in the item's content array.
|
9
|
+
#
|
10
|
+
# @return [Integer]
|
11
|
+
required :content_index, Integer
|
12
|
+
|
13
|
+
# @!attribute delta
|
14
|
+
# Base64-encoded audio data delta.
|
15
|
+
#
|
16
|
+
# @return [String]
|
17
|
+
required :delta, String
|
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.
|
27
|
+
#
|
28
|
+
# @return [String]
|
29
|
+
required :item_id, String
|
30
|
+
|
31
|
+
# @!attribute output_index
|
32
|
+
# The index of the output item in the response.
|
33
|
+
#
|
34
|
+
# @return [Integer]
|
35
|
+
required :output_index, Integer
|
36
|
+
|
37
|
+
# @!attribute response_id
|
38
|
+
# The ID of the response.
|
39
|
+
#
|
40
|
+
# @return [String]
|
41
|
+
required :response_id, String
|
42
|
+
|
43
|
+
# @!attribute type
|
44
|
+
# The event type, must be `response.output_audio.delta`.
|
45
|
+
#
|
46
|
+
# @return [Symbol, :"response.output_audio.delta"]
|
47
|
+
required :type, const: :"response.output_audio.delta"
|
48
|
+
|
49
|
+
# @!method initialize(content_index:, delta:, event_id:, item_id:, output_index:, response_id:, type: :"response.output_audio.delta")
|
50
|
+
# Returned when the model-generated audio is updated.
|
51
|
+
#
|
52
|
+
# @param content_index [Integer] The index of the content part in the item's content array.
|
53
|
+
#
|
54
|
+
# @param delta [String] Base64-encoded audio data delta.
|
55
|
+
#
|
56
|
+
# @param event_id [String] The unique ID of the server event.
|
57
|
+
#
|
58
|
+
# @param item_id [String] The ID of the item.
|
59
|
+
#
|
60
|
+
# @param output_index [Integer] The index of the output item in the response.
|
61
|
+
#
|
62
|
+
# @param response_id [String] The ID of the response.
|
63
|
+
#
|
64
|
+
# @param type [Symbol, :"response.output_audio.delta"] The event type, must be `response.output_audio.delta`.
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class ResponseAudioDoneEvent < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute content_index
|
8
|
+
# The index of the content part in the item's content array.
|
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 item.
|
21
|
+
#
|
22
|
+
# @return [String]
|
23
|
+
required :item_id, String
|
24
|
+
|
25
|
+
# @!attribute output_index
|
26
|
+
# The index of the output item in the response.
|
27
|
+
#
|
28
|
+
# @return [Integer]
|
29
|
+
required :output_index, Integer
|
30
|
+
|
31
|
+
# @!attribute response_id
|
32
|
+
# The ID of the response.
|
33
|
+
#
|
34
|
+
# @return [String]
|
35
|
+
required :response_id, String
|
36
|
+
|
37
|
+
# @!attribute type
|
38
|
+
# The event type, must be `response.output_audio.done`.
|
39
|
+
#
|
40
|
+
# @return [Symbol, :"response.output_audio.done"]
|
41
|
+
required :type, const: :"response.output_audio.done"
|
42
|
+
|
43
|
+
# @!method initialize(content_index:, event_id:, item_id:, output_index:, response_id:, type: :"response.output_audio.done")
|
44
|
+
# Returned when the model-generated audio is done. Also emitted when a Response is
|
45
|
+
# interrupted, incomplete, or cancelled.
|
46
|
+
#
|
47
|
+
# @param content_index [Integer] The index of the content part in the item's content array.
|
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 output_index [Integer] The index of the output item in the response.
|
54
|
+
#
|
55
|
+
# @param response_id [String] The ID of the response.
|
56
|
+
#
|
57
|
+
# @param type [Symbol, :"response.output_audio.done"] The event type, must be `response.output_audio.done`.
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class ResponseAudioTranscriptDeltaEvent < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute content_index
|
8
|
+
# The index of the content part in the item's content array.
|
9
|
+
#
|
10
|
+
# @return [Integer]
|
11
|
+
required :content_index, Integer
|
12
|
+
|
13
|
+
# @!attribute delta
|
14
|
+
# The transcript delta.
|
15
|
+
#
|
16
|
+
# @return [String]
|
17
|
+
required :delta, String
|
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.
|
27
|
+
#
|
28
|
+
# @return [String]
|
29
|
+
required :item_id, String
|
30
|
+
|
31
|
+
# @!attribute output_index
|
32
|
+
# The index of the output item in the response.
|
33
|
+
#
|
34
|
+
# @return [Integer]
|
35
|
+
required :output_index, Integer
|
36
|
+
|
37
|
+
# @!attribute response_id
|
38
|
+
# The ID of the response.
|
39
|
+
#
|
40
|
+
# @return [String]
|
41
|
+
required :response_id, String
|
42
|
+
|
43
|
+
# @!attribute type
|
44
|
+
# The event type, must be `response.output_audio_transcript.delta`.
|
45
|
+
#
|
46
|
+
# @return [Symbol, :"response.output_audio_transcript.delta"]
|
47
|
+
required :type, const: :"response.output_audio_transcript.delta"
|
48
|
+
|
49
|
+
# @!method initialize(content_index:, delta:, event_id:, item_id:, output_index:, response_id:, type: :"response.output_audio_transcript.delta")
|
50
|
+
# Returned when the model-generated transcription of audio output is updated.
|
51
|
+
#
|
52
|
+
# @param content_index [Integer] The index of the content part in the item's content array.
|
53
|
+
#
|
54
|
+
# @param delta [String] The transcript delta.
|
55
|
+
#
|
56
|
+
# @param event_id [String] The unique ID of the server event.
|
57
|
+
#
|
58
|
+
# @param item_id [String] The ID of the item.
|
59
|
+
#
|
60
|
+
# @param output_index [Integer] The index of the output item in the response.
|
61
|
+
#
|
62
|
+
# @param response_id [String] The ID of the response.
|
63
|
+
#
|
64
|
+
# @param type [Symbol, :"response.output_audio_transcript.delta"] The event type, must be `response.output_audio_transcript.delta`.
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class ResponseAudioTranscriptDoneEvent < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute content_index
|
8
|
+
# The index of the content part in the item's content array.
|
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 item.
|
21
|
+
#
|
22
|
+
# @return [String]
|
23
|
+
required :item_id, String
|
24
|
+
|
25
|
+
# @!attribute output_index
|
26
|
+
# The index of the output item in the response.
|
27
|
+
#
|
28
|
+
# @return [Integer]
|
29
|
+
required :output_index, Integer
|
30
|
+
|
31
|
+
# @!attribute response_id
|
32
|
+
# The ID of the response.
|
33
|
+
#
|
34
|
+
# @return [String]
|
35
|
+
required :response_id, String
|
36
|
+
|
37
|
+
# @!attribute transcript
|
38
|
+
# The final transcript of the audio.
|
39
|
+
#
|
40
|
+
# @return [String]
|
41
|
+
required :transcript, String
|
42
|
+
|
43
|
+
# @!attribute type
|
44
|
+
# The event type, must be `response.output_audio_transcript.done`.
|
45
|
+
#
|
46
|
+
# @return [Symbol, :"response.output_audio_transcript.done"]
|
47
|
+
required :type, const: :"response.output_audio_transcript.done"
|
48
|
+
|
49
|
+
# @!method initialize(content_index:, event_id:, item_id:, output_index:, response_id:, transcript:, type: :"response.output_audio_transcript.done")
|
50
|
+
# Returned when the model-generated transcription of audio output is done
|
51
|
+
# streaming. Also emitted when a Response is interrupted, incomplete, or
|
52
|
+
# cancelled.
|
53
|
+
#
|
54
|
+
# @param content_index [Integer] The index of the content part in the item's content array.
|
55
|
+
#
|
56
|
+
# @param event_id [String] The unique ID of the server event.
|
57
|
+
#
|
58
|
+
# @param item_id [String] The ID of the item.
|
59
|
+
#
|
60
|
+
# @param output_index [Integer] The index of the output item in the response.
|
61
|
+
#
|
62
|
+
# @param response_id [String] The ID of the response.
|
63
|
+
#
|
64
|
+
# @param transcript [String] The final transcript of the audio.
|
65
|
+
#
|
66
|
+
# @param type [Symbol, :"response.output_audio_transcript.done"] The event type, must be `response.output_audio_transcript.done`.
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|