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,579 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class RealtimeSessionCreateResponse < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute id
|
8
|
+
# Unique identifier for the session that looks like `sess_1234567890abcdef`.
|
9
|
+
#
|
10
|
+
# @return [String, nil]
|
11
|
+
optional :id, String
|
12
|
+
|
13
|
+
# @!attribute audio
|
14
|
+
# Configuration for input and output audio for the session.
|
15
|
+
#
|
16
|
+
# @return [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio, nil]
|
17
|
+
optional :audio, -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Audio }
|
18
|
+
|
19
|
+
# @!attribute expires_at
|
20
|
+
# Expiration timestamp for the session, in seconds since epoch.
|
21
|
+
#
|
22
|
+
# @return [Integer, nil]
|
23
|
+
optional :expires_at, Integer
|
24
|
+
|
25
|
+
# @!attribute include
|
26
|
+
# Additional fields to include in server outputs.
|
27
|
+
#
|
28
|
+
# - `item.input_audio_transcription.logprobs`: Include logprobs for input audio
|
29
|
+
# transcription.
|
30
|
+
#
|
31
|
+
# @return [Array<Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Include>, nil]
|
32
|
+
optional :include,
|
33
|
+
-> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Realtime::RealtimeSessionCreateResponse::Include] }
|
34
|
+
|
35
|
+
# @!attribute instructions
|
36
|
+
# The default system instructions (i.e. system message) prepended to model calls.
|
37
|
+
# This field allows the client to guide the model on desired responses. The model
|
38
|
+
# can be instructed on response content and format, (e.g. "be extremely succinct",
|
39
|
+
# "act friendly", "here are examples of good responses") and on audio behavior
|
40
|
+
# (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The
|
41
|
+
# instructions are not guaranteed to be followed by the model, but they provide
|
42
|
+
# guidance to the model on the desired behavior.
|
43
|
+
#
|
44
|
+
# Note that the server sets default instructions which will be used if this field
|
45
|
+
# is not set and are visible in the `session.created` event at the start of the
|
46
|
+
# session.
|
47
|
+
#
|
48
|
+
# @return [String, nil]
|
49
|
+
optional :instructions, String
|
50
|
+
|
51
|
+
# @!attribute max_output_tokens
|
52
|
+
# Maximum number of output tokens for a single assistant response, inclusive of
|
53
|
+
# tool calls. Provide an integer between 1 and 4096 to limit output tokens, or
|
54
|
+
# `inf` for the maximum available tokens for a given model. Defaults to `inf`.
|
55
|
+
#
|
56
|
+
# @return [Integer, Symbol, :inf, nil]
|
57
|
+
optional :max_output_tokens,
|
58
|
+
union: -> { OpenAI::Realtime::RealtimeSessionCreateResponse::MaxOutputTokens }
|
59
|
+
|
60
|
+
# @!attribute model
|
61
|
+
# The Realtime model used for this session.
|
62
|
+
#
|
63
|
+
# @return [String, nil]
|
64
|
+
optional :model, String
|
65
|
+
|
66
|
+
# @!attribute object
|
67
|
+
# The object type. Always `realtime.session`.
|
68
|
+
#
|
69
|
+
# @return [String, nil]
|
70
|
+
optional :object, String
|
71
|
+
|
72
|
+
# @!attribute output_modalities
|
73
|
+
# The set of modalities the model can respond with. To disable audio, set this to
|
74
|
+
# ["text"].
|
75
|
+
#
|
76
|
+
# @return [Array<Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::OutputModality>, nil]
|
77
|
+
optional :output_modalities,
|
78
|
+
-> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Realtime::RealtimeSessionCreateResponse::OutputModality] }
|
79
|
+
|
80
|
+
# @!attribute tool_choice
|
81
|
+
# How the model chooses tools. Options are `auto`, `none`, `required`, or specify
|
82
|
+
# a function.
|
83
|
+
#
|
84
|
+
# @return [String, nil]
|
85
|
+
optional :tool_choice, String
|
86
|
+
|
87
|
+
# @!attribute tools
|
88
|
+
# Tools (functions) available to the model.
|
89
|
+
#
|
90
|
+
# @return [Array<OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool>, nil]
|
91
|
+
optional :tools,
|
92
|
+
-> { OpenAI::Internal::Type::ArrayOf[OpenAI::Realtime::RealtimeSessionCreateResponse::Tool] }
|
93
|
+
|
94
|
+
# @!attribute tracing
|
95
|
+
# Configuration options for tracing. Set to null to disable tracing. Once tracing
|
96
|
+
# is enabled for a session, the configuration cannot be modified.
|
97
|
+
#
|
98
|
+
# `auto` will create a trace for the session with default values for the workflow
|
99
|
+
# name, group id, and metadata.
|
100
|
+
#
|
101
|
+
# @return [Symbol, :auto, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tracing::TracingConfiguration, nil]
|
102
|
+
optional :tracing, union: -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Tracing }
|
103
|
+
|
104
|
+
# @!attribute turn_detection
|
105
|
+
# Configuration for turn detection. Can be set to `null` to turn off. Server VAD
|
106
|
+
# means that the model will detect the start and end of speech based on audio
|
107
|
+
# volume and respond at the end of user speech.
|
108
|
+
#
|
109
|
+
# @return [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::TurnDetection, nil]
|
110
|
+
optional :turn_detection, -> { OpenAI::Realtime::RealtimeSessionCreateResponse::TurnDetection }
|
111
|
+
|
112
|
+
# @!method initialize(id: nil, audio: nil, expires_at: nil, include: nil, instructions: nil, max_output_tokens: nil, model: nil, object: nil, output_modalities: nil, tool_choice: nil, tools: nil, tracing: nil, turn_detection: nil)
|
113
|
+
# Some parameter documentations has been truncated, see
|
114
|
+
# {OpenAI::Models::Realtime::RealtimeSessionCreateResponse} for more details.
|
115
|
+
#
|
116
|
+
# A Realtime session configuration object.
|
117
|
+
#
|
118
|
+
# @param id [String] Unique identifier for the session that looks like `sess_1234567890abcdef`.
|
119
|
+
#
|
120
|
+
# @param audio [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio] Configuration for input and output audio for the session.
|
121
|
+
#
|
122
|
+
# @param expires_at [Integer] Expiration timestamp for the session, in seconds since epoch.
|
123
|
+
#
|
124
|
+
# @param include [Array<Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Include>] Additional fields to include in server outputs.
|
125
|
+
#
|
126
|
+
# @param instructions [String] The default system instructions (i.e. system message) prepended to model
|
127
|
+
#
|
128
|
+
# @param max_output_tokens [Integer, Symbol, :inf] Maximum number of output tokens for a single assistant response,
|
129
|
+
#
|
130
|
+
# @param model [String] The Realtime model used for this session.
|
131
|
+
#
|
132
|
+
# @param object [String] The object type. Always `realtime.session`.
|
133
|
+
#
|
134
|
+
# @param output_modalities [Array<Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::OutputModality>] The set of modalities the model can respond with. To disable audio,
|
135
|
+
#
|
136
|
+
# @param tool_choice [String] How the model chooses tools. Options are `auto`, `none`, `required`, or
|
137
|
+
#
|
138
|
+
# @param tools [Array<OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool>] Tools (functions) available to the model.
|
139
|
+
#
|
140
|
+
# @param tracing [Symbol, :auto, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tracing::TracingConfiguration] Configuration options for tracing. Set to null to disable tracing. Once
|
141
|
+
#
|
142
|
+
# @param turn_detection [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::TurnDetection] Configuration for turn detection. Can be set to `null` to turn off. Server
|
143
|
+
|
144
|
+
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse#audio
|
145
|
+
class Audio < OpenAI::Internal::Type::BaseModel
|
146
|
+
# @!attribute input
|
147
|
+
#
|
148
|
+
# @return [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input, nil]
|
149
|
+
optional :input, -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Audio::Input }
|
150
|
+
|
151
|
+
# @!attribute output
|
152
|
+
#
|
153
|
+
# @return [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Output, nil]
|
154
|
+
optional :output, -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Audio::Output }
|
155
|
+
|
156
|
+
# @!method initialize(input: nil, output: nil)
|
157
|
+
# Configuration for input and output audio for the session.
|
158
|
+
#
|
159
|
+
# @param input [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input]
|
160
|
+
# @param output [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Output]
|
161
|
+
|
162
|
+
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio#input
|
163
|
+
class Input < OpenAI::Internal::Type::BaseModel
|
164
|
+
# @!attribute format_
|
165
|
+
# The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
|
166
|
+
#
|
167
|
+
# @return [String, nil]
|
168
|
+
optional :format_, String, api_name: :format
|
169
|
+
|
170
|
+
# @!attribute noise_reduction
|
171
|
+
# Configuration for input audio noise reduction.
|
172
|
+
#
|
173
|
+
# @return [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::NoiseReduction, nil]
|
174
|
+
optional :noise_reduction,
|
175
|
+
-> { OpenAI::Realtime::RealtimeSessionCreateResponse::Audio::Input::NoiseReduction }
|
176
|
+
|
177
|
+
# @!attribute transcription
|
178
|
+
# Configuration for input audio transcription.
|
179
|
+
#
|
180
|
+
# @return [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::Transcription, nil]
|
181
|
+
optional :transcription,
|
182
|
+
-> { OpenAI::Realtime::RealtimeSessionCreateResponse::Audio::Input::Transcription }
|
183
|
+
|
184
|
+
# @!attribute turn_detection
|
185
|
+
# Configuration for turn detection.
|
186
|
+
#
|
187
|
+
# @return [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::TurnDetection, nil]
|
188
|
+
optional :turn_detection,
|
189
|
+
-> { OpenAI::Realtime::RealtimeSessionCreateResponse::Audio::Input::TurnDetection }
|
190
|
+
|
191
|
+
# @!method initialize(format_: nil, noise_reduction: nil, transcription: nil, turn_detection: nil)
|
192
|
+
# Some parameter documentations has been truncated, see
|
193
|
+
# {OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input} for more
|
194
|
+
# details.
|
195
|
+
#
|
196
|
+
# @param format_ [String] The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
|
197
|
+
#
|
198
|
+
# @param noise_reduction [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::NoiseReduction] Configuration for input audio noise reduction.
|
199
|
+
#
|
200
|
+
# @param transcription [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::Transcription] Configuration for input audio transcription.
|
201
|
+
#
|
202
|
+
# @param turn_detection [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::TurnDetection] Configuration for turn detection.
|
203
|
+
|
204
|
+
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input#noise_reduction
|
205
|
+
class NoiseReduction < OpenAI::Internal::Type::BaseModel
|
206
|
+
# @!attribute type
|
207
|
+
#
|
208
|
+
# @return [Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::NoiseReduction::Type, nil]
|
209
|
+
optional :type,
|
210
|
+
enum: -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Audio::Input::NoiseReduction::Type }
|
211
|
+
|
212
|
+
# @!method initialize(type: nil)
|
213
|
+
# Configuration for input audio noise reduction.
|
214
|
+
#
|
215
|
+
# @param type [Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::NoiseReduction::Type]
|
216
|
+
|
217
|
+
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::NoiseReduction#type
|
218
|
+
module Type
|
219
|
+
extend OpenAI::Internal::Type::Enum
|
220
|
+
|
221
|
+
NEAR_FIELD = :near_field
|
222
|
+
FAR_FIELD = :far_field
|
223
|
+
|
224
|
+
# @!method self.values
|
225
|
+
# @return [Array<Symbol>]
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
229
|
+
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input#transcription
|
230
|
+
class Transcription < OpenAI::Internal::Type::BaseModel
|
231
|
+
# @!attribute language
|
232
|
+
# The language of the input audio.
|
233
|
+
#
|
234
|
+
# @return [String, nil]
|
235
|
+
optional :language, String
|
236
|
+
|
237
|
+
# @!attribute model
|
238
|
+
# The model to use for transcription.
|
239
|
+
#
|
240
|
+
# @return [String, nil]
|
241
|
+
optional :model, String
|
242
|
+
|
243
|
+
# @!attribute prompt
|
244
|
+
# Optional text to guide the model's style or continue a previous audio segment.
|
245
|
+
#
|
246
|
+
# @return [String, nil]
|
247
|
+
optional :prompt, String
|
248
|
+
|
249
|
+
# @!method initialize(language: nil, model: nil, prompt: nil)
|
250
|
+
# Some parameter documentations has been truncated, see
|
251
|
+
# {OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::Transcription}
|
252
|
+
# for more details.
|
253
|
+
#
|
254
|
+
# Configuration for input audio transcription.
|
255
|
+
#
|
256
|
+
# @param language [String] The language of the input audio.
|
257
|
+
#
|
258
|
+
# @param model [String] The model to use for transcription.
|
259
|
+
#
|
260
|
+
# @param prompt [String] Optional text to guide the model's style or continue a previous audio segment.
|
261
|
+
end
|
262
|
+
|
263
|
+
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input#turn_detection
|
264
|
+
class TurnDetection < OpenAI::Internal::Type::BaseModel
|
265
|
+
# @!attribute prefix_padding_ms
|
266
|
+
#
|
267
|
+
# @return [Integer, nil]
|
268
|
+
optional :prefix_padding_ms, Integer
|
269
|
+
|
270
|
+
# @!attribute silence_duration_ms
|
271
|
+
#
|
272
|
+
# @return [Integer, nil]
|
273
|
+
optional :silence_duration_ms, Integer
|
274
|
+
|
275
|
+
# @!attribute threshold
|
276
|
+
#
|
277
|
+
# @return [Float, nil]
|
278
|
+
optional :threshold, Float
|
279
|
+
|
280
|
+
# @!attribute type
|
281
|
+
# Type of turn detection, only `server_vad` is currently supported.
|
282
|
+
#
|
283
|
+
# @return [String, nil]
|
284
|
+
optional :type, String
|
285
|
+
|
286
|
+
# @!method initialize(prefix_padding_ms: nil, silence_duration_ms: nil, threshold: nil, type: nil)
|
287
|
+
# Some parameter documentations has been truncated, see
|
288
|
+
# {OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::TurnDetection}
|
289
|
+
# for more details.
|
290
|
+
#
|
291
|
+
# Configuration for turn detection.
|
292
|
+
#
|
293
|
+
# @param prefix_padding_ms [Integer]
|
294
|
+
#
|
295
|
+
# @param silence_duration_ms [Integer]
|
296
|
+
#
|
297
|
+
# @param threshold [Float]
|
298
|
+
#
|
299
|
+
# @param type [String] Type of turn detection, only `server_vad` is currently supported.
|
300
|
+
end
|
301
|
+
end
|
302
|
+
|
303
|
+
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio#output
|
304
|
+
class Output < OpenAI::Internal::Type::BaseModel
|
305
|
+
# @!attribute format_
|
306
|
+
# The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
|
307
|
+
#
|
308
|
+
# @return [String, nil]
|
309
|
+
optional :format_, String, api_name: :format
|
310
|
+
|
311
|
+
# @!attribute speed
|
312
|
+
#
|
313
|
+
# @return [Float, nil]
|
314
|
+
optional :speed, Float
|
315
|
+
|
316
|
+
# @!attribute voice
|
317
|
+
#
|
318
|
+
# @return [String, Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Output::Voice, nil]
|
319
|
+
optional :voice, union: -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Audio::Output::Voice }
|
320
|
+
|
321
|
+
# @!method initialize(format_: nil, speed: nil, voice: nil)
|
322
|
+
# Some parameter documentations has been truncated, see
|
323
|
+
# {OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Output} for
|
324
|
+
# more details.
|
325
|
+
#
|
326
|
+
# @param format_ [String] The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
|
327
|
+
#
|
328
|
+
# @param speed [Float]
|
329
|
+
#
|
330
|
+
# @param voice [String, Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Output::Voice]
|
331
|
+
|
332
|
+
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Output#voice
|
333
|
+
module Voice
|
334
|
+
extend OpenAI::Internal::Type::Union
|
335
|
+
|
336
|
+
variant String
|
337
|
+
|
338
|
+
variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Output::Voice::ALLOY }
|
339
|
+
|
340
|
+
variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Output::Voice::ASH }
|
341
|
+
|
342
|
+
variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Output::Voice::BALLAD }
|
343
|
+
|
344
|
+
variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Output::Voice::CORAL }
|
345
|
+
|
346
|
+
variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Output::Voice::ECHO }
|
347
|
+
|
348
|
+
variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Output::Voice::SAGE }
|
349
|
+
|
350
|
+
variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Output::Voice::SHIMMER }
|
351
|
+
|
352
|
+
variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Output::Voice::VERSE }
|
353
|
+
|
354
|
+
variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Output::Voice::MARIN }
|
355
|
+
|
356
|
+
variant const: -> { OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Output::Voice::CEDAR }
|
357
|
+
|
358
|
+
# @!method self.variants
|
359
|
+
# @return [Array(String, Symbol)]
|
360
|
+
|
361
|
+
define_sorbet_constant!(:Variants) do
|
362
|
+
T.type_alias { T.any(String, OpenAI::Realtime::RealtimeSessionCreateResponse::Audio::Output::Voice::TaggedSymbol) }
|
363
|
+
end
|
364
|
+
|
365
|
+
# @!group
|
366
|
+
|
367
|
+
ALLOY = :alloy
|
368
|
+
ASH = :ash
|
369
|
+
BALLAD = :ballad
|
370
|
+
CORAL = :coral
|
371
|
+
ECHO = :echo
|
372
|
+
SAGE = :sage
|
373
|
+
SHIMMER = :shimmer
|
374
|
+
VERSE = :verse
|
375
|
+
MARIN = :marin
|
376
|
+
CEDAR = :cedar
|
377
|
+
|
378
|
+
# @!endgroup
|
379
|
+
end
|
380
|
+
end
|
381
|
+
end
|
382
|
+
|
383
|
+
module Include
|
384
|
+
extend OpenAI::Internal::Type::Enum
|
385
|
+
|
386
|
+
ITEM_INPUT_AUDIO_TRANSCRIPTION_LOGPROBS = :"item.input_audio_transcription.logprobs"
|
387
|
+
|
388
|
+
# @!method self.values
|
389
|
+
# @return [Array<Symbol>]
|
390
|
+
end
|
391
|
+
|
392
|
+
# Maximum number of output tokens for a single assistant response, inclusive of
|
393
|
+
# tool calls. Provide an integer between 1 and 4096 to limit output tokens, or
|
394
|
+
# `inf` for the maximum available tokens for a given model. Defaults to `inf`.
|
395
|
+
#
|
396
|
+
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse#max_output_tokens
|
397
|
+
module MaxOutputTokens
|
398
|
+
extend OpenAI::Internal::Type::Union
|
399
|
+
|
400
|
+
variant Integer
|
401
|
+
|
402
|
+
variant const: :inf
|
403
|
+
|
404
|
+
# @!method self.variants
|
405
|
+
# @return [Array(Integer, Symbol, :inf)]
|
406
|
+
end
|
407
|
+
|
408
|
+
module OutputModality
|
409
|
+
extend OpenAI::Internal::Type::Enum
|
410
|
+
|
411
|
+
TEXT = :text
|
412
|
+
AUDIO = :audio
|
413
|
+
|
414
|
+
# @!method self.values
|
415
|
+
# @return [Array<Symbol>]
|
416
|
+
end
|
417
|
+
|
418
|
+
class Tool < OpenAI::Internal::Type::BaseModel
|
419
|
+
# @!attribute description
|
420
|
+
# The description of the function, including guidance on when and how to call it,
|
421
|
+
# and guidance about what to tell the user when calling (if anything).
|
422
|
+
#
|
423
|
+
# @return [String, nil]
|
424
|
+
optional :description, String
|
425
|
+
|
426
|
+
# @!attribute name
|
427
|
+
# The name of the function.
|
428
|
+
#
|
429
|
+
# @return [String, nil]
|
430
|
+
optional :name, String
|
431
|
+
|
432
|
+
# @!attribute parameters
|
433
|
+
# Parameters of the function in JSON Schema.
|
434
|
+
#
|
435
|
+
# @return [Object, nil]
|
436
|
+
optional :parameters, OpenAI::Internal::Type::Unknown
|
437
|
+
|
438
|
+
# @!attribute type
|
439
|
+
# The type of the tool, i.e. `function`.
|
440
|
+
#
|
441
|
+
# @return [Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::Type, nil]
|
442
|
+
optional :type, enum: -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Tool::Type }
|
443
|
+
|
444
|
+
# @!method initialize(description: nil, name: nil, parameters: nil, type: nil)
|
445
|
+
# Some parameter documentations has been truncated, see
|
446
|
+
# {OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool} for more
|
447
|
+
# details.
|
448
|
+
#
|
449
|
+
# @param description [String] The description of the function, including guidance on when and how
|
450
|
+
#
|
451
|
+
# @param name [String] The name of the function.
|
452
|
+
#
|
453
|
+
# @param parameters [Object] Parameters of the function in JSON Schema.
|
454
|
+
#
|
455
|
+
# @param type [Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::Type] The type of the tool, i.e. `function`.
|
456
|
+
|
457
|
+
# The type of the tool, i.e. `function`.
|
458
|
+
#
|
459
|
+
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool#type
|
460
|
+
module Type
|
461
|
+
extend OpenAI::Internal::Type::Enum
|
462
|
+
|
463
|
+
FUNCTION = :function
|
464
|
+
|
465
|
+
# @!method self.values
|
466
|
+
# @return [Array<Symbol>]
|
467
|
+
end
|
468
|
+
end
|
469
|
+
|
470
|
+
# Configuration options for tracing. Set to null to disable tracing. Once tracing
|
471
|
+
# is enabled for a session, the configuration cannot be modified.
|
472
|
+
#
|
473
|
+
# `auto` will create a trace for the session with default values for the workflow
|
474
|
+
# name, group id, and metadata.
|
475
|
+
#
|
476
|
+
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse#tracing
|
477
|
+
module Tracing
|
478
|
+
extend OpenAI::Internal::Type::Union
|
479
|
+
|
480
|
+
# Default tracing mode for the session.
|
481
|
+
variant const: :auto
|
482
|
+
|
483
|
+
# Granular configuration for tracing.
|
484
|
+
variant -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Tracing::TracingConfiguration }
|
485
|
+
|
486
|
+
class TracingConfiguration < OpenAI::Internal::Type::BaseModel
|
487
|
+
# @!attribute group_id
|
488
|
+
# The group id to attach to this trace to enable filtering and grouping in the
|
489
|
+
# traces dashboard.
|
490
|
+
#
|
491
|
+
# @return [String, nil]
|
492
|
+
optional :group_id, String
|
493
|
+
|
494
|
+
# @!attribute metadata
|
495
|
+
# The arbitrary metadata to attach to this trace to enable filtering in the traces
|
496
|
+
# dashboard.
|
497
|
+
#
|
498
|
+
# @return [Object, nil]
|
499
|
+
optional :metadata, OpenAI::Internal::Type::Unknown
|
500
|
+
|
501
|
+
# @!attribute workflow_name
|
502
|
+
# The name of the workflow to attach to this trace. This is used to name the trace
|
503
|
+
# in the traces dashboard.
|
504
|
+
#
|
505
|
+
# @return [String, nil]
|
506
|
+
optional :workflow_name, String
|
507
|
+
|
508
|
+
# @!method initialize(group_id: nil, metadata: nil, workflow_name: nil)
|
509
|
+
# Some parameter documentations has been truncated, see
|
510
|
+
# {OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tracing::TracingConfiguration}
|
511
|
+
# for more details.
|
512
|
+
#
|
513
|
+
# Granular configuration for tracing.
|
514
|
+
#
|
515
|
+
# @param group_id [String] The group id to attach to this trace to enable filtering and
|
516
|
+
#
|
517
|
+
# @param metadata [Object] The arbitrary metadata to attach to this trace to enable
|
518
|
+
#
|
519
|
+
# @param workflow_name [String] The name of the workflow to attach to this trace. This is used to
|
520
|
+
end
|
521
|
+
|
522
|
+
# @!method self.variants
|
523
|
+
# @return [Array(Symbol, :auto, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tracing::TracingConfiguration)]
|
524
|
+
end
|
525
|
+
|
526
|
+
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse#turn_detection
|
527
|
+
class TurnDetection < OpenAI::Internal::Type::BaseModel
|
528
|
+
# @!attribute prefix_padding_ms
|
529
|
+
# Amount of audio to include before the VAD detected speech (in milliseconds).
|
530
|
+
# Defaults to 300ms.
|
531
|
+
#
|
532
|
+
# @return [Integer, nil]
|
533
|
+
optional :prefix_padding_ms, Integer
|
534
|
+
|
535
|
+
# @!attribute silence_duration_ms
|
536
|
+
# Duration of silence to detect speech stop (in milliseconds). Defaults to 500ms.
|
537
|
+
# With shorter values the model will respond more quickly, but may jump in on
|
538
|
+
# short pauses from the user.
|
539
|
+
#
|
540
|
+
# @return [Integer, nil]
|
541
|
+
optional :silence_duration_ms, Integer
|
542
|
+
|
543
|
+
# @!attribute threshold
|
544
|
+
# Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A higher
|
545
|
+
# threshold will require louder audio to activate the model, and thus might
|
546
|
+
# perform better in noisy environments.
|
547
|
+
#
|
548
|
+
# @return [Float, nil]
|
549
|
+
optional :threshold, Float
|
550
|
+
|
551
|
+
# @!attribute type
|
552
|
+
# Type of turn detection, only `server_vad` is currently supported.
|
553
|
+
#
|
554
|
+
# @return [String, nil]
|
555
|
+
optional :type, String
|
556
|
+
|
557
|
+
# @!method initialize(prefix_padding_ms: nil, silence_duration_ms: nil, threshold: nil, type: nil)
|
558
|
+
# Some parameter documentations has been truncated, see
|
559
|
+
# {OpenAI::Models::Realtime::RealtimeSessionCreateResponse::TurnDetection} for
|
560
|
+
# more details.
|
561
|
+
#
|
562
|
+
# Configuration for turn detection. Can be set to `null` to turn off. Server VAD
|
563
|
+
# means that the model will detect the start and end of speech based on audio
|
564
|
+
# volume and respond at the end of user speech.
|
565
|
+
#
|
566
|
+
# @param prefix_padding_ms [Integer] Amount of audio to include before the VAD detected speech (in
|
567
|
+
#
|
568
|
+
# @param silence_duration_ms [Integer] Duration of silence to detect speech stop (in milliseconds). Defaults
|
569
|
+
#
|
570
|
+
# @param threshold [Float] Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A
|
571
|
+
#
|
572
|
+
# @param type [String] Type of turn detection, only `server_vad` is currently supported.
|
573
|
+
end
|
574
|
+
end
|
575
|
+
end
|
576
|
+
|
577
|
+
RealtimeSessionCreateResponse = Realtime::RealtimeSessionCreateResponse
|
578
|
+
end
|
579
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
# How the model chooses tools. Provide one of the string modes or force a specific
|
7
|
+
# function/MCP tool.
|
8
|
+
module RealtimeToolChoiceConfig
|
9
|
+
extend OpenAI::Internal::Type::Union
|
10
|
+
|
11
|
+
# Controls which (if any) tool is called by the model.
|
12
|
+
#
|
13
|
+
# `none` means the model will not call any tool and instead generates a message.
|
14
|
+
#
|
15
|
+
# `auto` means the model can pick between generating a message or calling one or
|
16
|
+
# more tools.
|
17
|
+
#
|
18
|
+
# `required` means the model must call one or more tools.
|
19
|
+
variant enum: -> { OpenAI::Responses::ToolChoiceOptions }
|
20
|
+
|
21
|
+
# Use this option to force the model to call a specific function.
|
22
|
+
variant -> { OpenAI::Responses::ToolChoiceFunction }
|
23
|
+
|
24
|
+
# Use this option to force the model to call a specific tool on a remote MCP server.
|
25
|
+
variant -> { OpenAI::Responses::ToolChoiceMcp }
|
26
|
+
|
27
|
+
# @!method self.variants
|
28
|
+
# @return [Array(Symbol, OpenAI::Models::Responses::ToolChoiceOptions, OpenAI::Models::Responses::ToolChoiceFunction, OpenAI::Models::Responses::ToolChoiceMcp)]
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
# @type [OpenAI::Internal::Type::Converter]
|
7
|
+
RealtimeToolsConfig =
|
8
|
+
OpenAI::Internal::Type::ArrayOf[union: -> { OpenAI::Realtime::RealtimeToolsConfigUnion }]
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|