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,96 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class ConversationItemInputAudioTranscriptionFailedEvent < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute content_index
|
8
|
+
# The index of the content part containing the audio.
|
9
|
+
#
|
10
|
+
# @return [Integer]
|
11
|
+
required :content_index, Integer
|
12
|
+
|
13
|
+
# @!attribute error
|
14
|
+
# Details of the transcription error.
|
15
|
+
#
|
16
|
+
# @return [OpenAI::Models::Realtime::ConversationItemInputAudioTranscriptionFailedEvent::Error]
|
17
|
+
required :error, -> { OpenAI::Realtime::ConversationItemInputAudioTranscriptionFailedEvent::Error }
|
18
|
+
|
19
|
+
# @!attribute event_id
|
20
|
+
# The unique ID of the server event.
|
21
|
+
#
|
22
|
+
# @return [String]
|
23
|
+
required :event_id, String
|
24
|
+
|
25
|
+
# @!attribute item_id
|
26
|
+
# The ID of the user message item.
|
27
|
+
#
|
28
|
+
# @return [String]
|
29
|
+
required :item_id, String
|
30
|
+
|
31
|
+
# @!attribute type
|
32
|
+
# The event type, must be `conversation.item.input_audio_transcription.failed`.
|
33
|
+
#
|
34
|
+
# @return [Symbol, :"conversation.item.input_audio_transcription.failed"]
|
35
|
+
required :type, const: :"conversation.item.input_audio_transcription.failed"
|
36
|
+
|
37
|
+
# @!method initialize(content_index:, error:, event_id:, item_id:, type: :"conversation.item.input_audio_transcription.failed")
|
38
|
+
# Some parameter documentations has been truncated, see
|
39
|
+
# {OpenAI::Models::Realtime::ConversationItemInputAudioTranscriptionFailedEvent}
|
40
|
+
# for more details.
|
41
|
+
#
|
42
|
+
# Returned when input audio transcription is configured, and a transcription
|
43
|
+
# request for a user message failed. These events are separate from other `error`
|
44
|
+
# events so that the client can identify the related Item.
|
45
|
+
#
|
46
|
+
# @param content_index [Integer] The index of the content part containing the audio.
|
47
|
+
#
|
48
|
+
# @param error [OpenAI::Models::Realtime::ConversationItemInputAudioTranscriptionFailedEvent::Error] Details of the transcription error.
|
49
|
+
#
|
50
|
+
# @param event_id [String] The unique ID of the server event.
|
51
|
+
#
|
52
|
+
# @param item_id [String] The ID of the user message item.
|
53
|
+
#
|
54
|
+
# @param type [Symbol, :"conversation.item.input_audio_transcription.failed"] The event type, must be
|
55
|
+
|
56
|
+
# @see OpenAI::Models::Realtime::ConversationItemInputAudioTranscriptionFailedEvent#error
|
57
|
+
class Error < OpenAI::Internal::Type::BaseModel
|
58
|
+
# @!attribute code
|
59
|
+
# Error code, if any.
|
60
|
+
#
|
61
|
+
# @return [String, nil]
|
62
|
+
optional :code, String
|
63
|
+
|
64
|
+
# @!attribute message
|
65
|
+
# A human-readable error message.
|
66
|
+
#
|
67
|
+
# @return [String, nil]
|
68
|
+
optional :message, String
|
69
|
+
|
70
|
+
# @!attribute param
|
71
|
+
# Parameter related to the error, if any.
|
72
|
+
#
|
73
|
+
# @return [String, nil]
|
74
|
+
optional :param, String
|
75
|
+
|
76
|
+
# @!attribute type
|
77
|
+
# The type of error.
|
78
|
+
#
|
79
|
+
# @return [String, nil]
|
80
|
+
optional :type, String
|
81
|
+
|
82
|
+
# @!method initialize(code: nil, message: nil, param: nil, type: nil)
|
83
|
+
# Details of the transcription error.
|
84
|
+
#
|
85
|
+
# @param code [String] Error code, if any.
|
86
|
+
#
|
87
|
+
# @param message [String] A human-readable error message.
|
88
|
+
#
|
89
|
+
# @param param [String] Parameter related to the error, if any.
|
90
|
+
#
|
91
|
+
# @param type [String] The type of error.
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class ConversationItemInputAudioTranscriptionSegment < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute id
|
8
|
+
# The segment identifier.
|
9
|
+
#
|
10
|
+
# @return [String]
|
11
|
+
required :id, String
|
12
|
+
|
13
|
+
# @!attribute content_index
|
14
|
+
# The index of the input audio content part within the item.
|
15
|
+
#
|
16
|
+
# @return [Integer]
|
17
|
+
required :content_index, Integer
|
18
|
+
|
19
|
+
# @!attribute end_
|
20
|
+
# End time of the segment in seconds.
|
21
|
+
#
|
22
|
+
# @return [Float]
|
23
|
+
required :end_, Float, api_name: :end
|
24
|
+
|
25
|
+
# @!attribute event_id
|
26
|
+
# The unique ID of the server event.
|
27
|
+
#
|
28
|
+
# @return [String]
|
29
|
+
required :event_id, String
|
30
|
+
|
31
|
+
# @!attribute item_id
|
32
|
+
# The ID of the item containing the input audio content.
|
33
|
+
#
|
34
|
+
# @return [String]
|
35
|
+
required :item_id, String
|
36
|
+
|
37
|
+
# @!attribute speaker
|
38
|
+
# The detected speaker label for this segment.
|
39
|
+
#
|
40
|
+
# @return [String]
|
41
|
+
required :speaker, String
|
42
|
+
|
43
|
+
# @!attribute start
|
44
|
+
# Start time of the segment in seconds.
|
45
|
+
#
|
46
|
+
# @return [Float]
|
47
|
+
required :start, Float
|
48
|
+
|
49
|
+
# @!attribute text
|
50
|
+
# The text for this segment.
|
51
|
+
#
|
52
|
+
# @return [String]
|
53
|
+
required :text, String
|
54
|
+
|
55
|
+
# @!attribute type
|
56
|
+
# The event type, must be `conversation.item.input_audio_transcription.segment`.
|
57
|
+
#
|
58
|
+
# @return [Symbol, :"conversation.item.input_audio_transcription.segment"]
|
59
|
+
required :type, const: :"conversation.item.input_audio_transcription.segment"
|
60
|
+
|
61
|
+
# @!method initialize(id:, content_index:, end_:, event_id:, item_id:, speaker:, start:, text:, type: :"conversation.item.input_audio_transcription.segment")
|
62
|
+
# Returned when an input audio transcription segment is identified for an item.
|
63
|
+
#
|
64
|
+
# @param id [String] The segment identifier.
|
65
|
+
#
|
66
|
+
# @param content_index [Integer] The index of the input audio content part within the item.
|
67
|
+
#
|
68
|
+
# @param end_ [Float] End time of the segment in seconds.
|
69
|
+
#
|
70
|
+
# @param event_id [String] The unique ID of the server event.
|
71
|
+
#
|
72
|
+
# @param item_id [String] The ID of the item containing the input audio content.
|
73
|
+
#
|
74
|
+
# @param speaker [String] The detected speaker label for this segment.
|
75
|
+
#
|
76
|
+
# @param start [Float] Start time of the segment in seconds.
|
77
|
+
#
|
78
|
+
# @param text [String] The text for this segment.
|
79
|
+
#
|
80
|
+
# @param type [Symbol, :"conversation.item.input_audio_transcription.segment"] The event type, must be `conversation.item.input_audio_transcription.segment`.
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class ConversationItemRetrieveEvent < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute item_id
|
8
|
+
# The ID of the item to retrieve.
|
9
|
+
#
|
10
|
+
# @return [String]
|
11
|
+
required :item_id, String
|
12
|
+
|
13
|
+
# @!attribute type
|
14
|
+
# The event type, must be `conversation.item.retrieve`.
|
15
|
+
#
|
16
|
+
# @return [Symbol, :"conversation.item.retrieve"]
|
17
|
+
required :type, const: :"conversation.item.retrieve"
|
18
|
+
|
19
|
+
# @!attribute event_id
|
20
|
+
# Optional client-generated ID used to identify this event.
|
21
|
+
#
|
22
|
+
# @return [String, nil]
|
23
|
+
optional :event_id, String
|
24
|
+
|
25
|
+
# @!method initialize(item_id:, event_id: nil, type: :"conversation.item.retrieve")
|
26
|
+
# Send this event when you want to retrieve the server's representation of a
|
27
|
+
# specific item in the conversation history. This is useful, for example, to
|
28
|
+
# inspect user audio after noise cancellation and VAD. The server will respond
|
29
|
+
# with a `conversation.item.retrieved` event, unless the item does not exist in
|
30
|
+
# the conversation history, in which case the server will respond with an error.
|
31
|
+
#
|
32
|
+
# @param item_id [String] The ID of the item to retrieve.
|
33
|
+
#
|
34
|
+
# @param event_id [String] Optional client-generated ID used to identify this event.
|
35
|
+
#
|
36
|
+
# @param type [Symbol, :"conversation.item.retrieve"] The event type, must be `conversation.item.retrieve`.
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class ConversationItemTruncateEvent < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute audio_end_ms
|
8
|
+
# Inclusive duration up to which audio is truncated, in milliseconds. If the
|
9
|
+
# audio_end_ms is greater than the actual audio duration, the server will respond
|
10
|
+
# with an error.
|
11
|
+
#
|
12
|
+
# @return [Integer]
|
13
|
+
required :audio_end_ms, Integer
|
14
|
+
|
15
|
+
# @!attribute content_index
|
16
|
+
# The index of the content part to truncate. Set this to 0.
|
17
|
+
#
|
18
|
+
# @return [Integer]
|
19
|
+
required :content_index, Integer
|
20
|
+
|
21
|
+
# @!attribute item_id
|
22
|
+
# The ID of the assistant message item to truncate. Only assistant message items
|
23
|
+
# can be truncated.
|
24
|
+
#
|
25
|
+
# @return [String]
|
26
|
+
required :item_id, String
|
27
|
+
|
28
|
+
# @!attribute type
|
29
|
+
# The event type, must be `conversation.item.truncate`.
|
30
|
+
#
|
31
|
+
# @return [Symbol, :"conversation.item.truncate"]
|
32
|
+
required :type, const: :"conversation.item.truncate"
|
33
|
+
|
34
|
+
# @!attribute event_id
|
35
|
+
# Optional client-generated ID used to identify this event.
|
36
|
+
#
|
37
|
+
# @return [String, nil]
|
38
|
+
optional :event_id, String
|
39
|
+
|
40
|
+
# @!method initialize(audio_end_ms:, content_index:, item_id:, event_id: nil, type: :"conversation.item.truncate")
|
41
|
+
# Some parameter documentations has been truncated, see
|
42
|
+
# {OpenAI::Models::Realtime::ConversationItemTruncateEvent} for more details.
|
43
|
+
#
|
44
|
+
# Send this event to truncate a previous assistant message’s audio. The server
|
45
|
+
# will produce audio faster than realtime, so this event is useful when the user
|
46
|
+
# interrupts to truncate audio that has already been sent to the client but not
|
47
|
+
# yet played. This will synchronize the server's understanding of the audio with
|
48
|
+
# the client's playback.
|
49
|
+
#
|
50
|
+
# Truncating audio will delete the server-side text transcript to ensure there is
|
51
|
+
# not text in the context that hasn't been heard by the user.
|
52
|
+
#
|
53
|
+
# If successful, the server will respond with a `conversation.item.truncated`
|
54
|
+
# event.
|
55
|
+
#
|
56
|
+
# @param audio_end_ms [Integer] Inclusive duration up to which audio is truncated, in milliseconds. If
|
57
|
+
#
|
58
|
+
# @param content_index [Integer] The index of the content part to truncate. Set this to 0.
|
59
|
+
#
|
60
|
+
# @param item_id [String] The ID of the assistant message item to truncate. Only assistant message
|
61
|
+
#
|
62
|
+
# @param event_id [String] Optional client-generated ID used to identify this event.
|
63
|
+
#
|
64
|
+
# @param type [Symbol, :"conversation.item.truncate"] The event type, must be `conversation.item.truncate`.
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class ConversationItemTruncatedEvent < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute audio_end_ms
|
8
|
+
# The duration up to which the audio was truncated, in milliseconds.
|
9
|
+
#
|
10
|
+
# @return [Integer]
|
11
|
+
required :audio_end_ms, Integer
|
12
|
+
|
13
|
+
# @!attribute content_index
|
14
|
+
# The index of the content part that was truncated.
|
15
|
+
#
|
16
|
+
# @return [Integer]
|
17
|
+
required :content_index, Integer
|
18
|
+
|
19
|
+
# @!attribute event_id
|
20
|
+
# The unique ID of the server event.
|
21
|
+
#
|
22
|
+
# @return [String]
|
23
|
+
required :event_id, String
|
24
|
+
|
25
|
+
# @!attribute item_id
|
26
|
+
# The ID of the assistant message item that was truncated.
|
27
|
+
#
|
28
|
+
# @return [String]
|
29
|
+
required :item_id, String
|
30
|
+
|
31
|
+
# @!attribute type
|
32
|
+
# The event type, must be `conversation.item.truncated`.
|
33
|
+
#
|
34
|
+
# @return [Symbol, :"conversation.item.truncated"]
|
35
|
+
required :type, const: :"conversation.item.truncated"
|
36
|
+
|
37
|
+
# @!method initialize(audio_end_ms:, content_index:, event_id:, item_id:, type: :"conversation.item.truncated")
|
38
|
+
# Some parameter documentations has been truncated, see
|
39
|
+
# {OpenAI::Models::Realtime::ConversationItemTruncatedEvent} for more details.
|
40
|
+
#
|
41
|
+
# Returned when an earlier assistant audio message item is truncated by the client
|
42
|
+
# with a `conversation.item.truncate` event. This event is used to synchronize the
|
43
|
+
# server's understanding of the audio with the client's playback.
|
44
|
+
#
|
45
|
+
# This action will truncate the audio and remove the server-side text transcript
|
46
|
+
# to ensure there is no text in the context that hasn't been heard by the user.
|
47
|
+
#
|
48
|
+
# @param audio_end_ms [Integer] The duration up to which the audio was truncated, in milliseconds.
|
49
|
+
#
|
50
|
+
# @param content_index [Integer] The index of the content part that was truncated.
|
51
|
+
#
|
52
|
+
# @param event_id [String] The unique ID of the server event.
|
53
|
+
#
|
54
|
+
# @param item_id [String] The ID of the assistant message item that was truncated.
|
55
|
+
#
|
56
|
+
# @param type [Symbol, :"conversation.item.truncated"] The event type, must be `conversation.item.truncated`.
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,235 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class ConversationItemWithReference < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute id
|
8
|
+
# For an item of type (`message` | `function_call` | `function_call_output`) this
|
9
|
+
# field allows the client to assign the unique ID of the item. It is not required
|
10
|
+
# because the server will generate one if not provided.
|
11
|
+
#
|
12
|
+
# For an item of type `item_reference`, this field is required and is a reference
|
13
|
+
# to any item that has previously existed in the conversation.
|
14
|
+
#
|
15
|
+
# @return [String, nil]
|
16
|
+
optional :id, String
|
17
|
+
|
18
|
+
# @!attribute arguments
|
19
|
+
# The arguments of the function call (for `function_call` items).
|
20
|
+
#
|
21
|
+
# @return [String, nil]
|
22
|
+
optional :arguments, String
|
23
|
+
|
24
|
+
# @!attribute call_id
|
25
|
+
# The ID of the function call (for `function_call` and `function_call_output`
|
26
|
+
# items). If passed on a `function_call_output` item, the server will check that a
|
27
|
+
# `function_call` item with the same ID exists in the conversation history.
|
28
|
+
#
|
29
|
+
# @return [String, nil]
|
30
|
+
optional :call_id, String
|
31
|
+
|
32
|
+
# @!attribute content
|
33
|
+
# The content of the message, applicable for `message` items.
|
34
|
+
#
|
35
|
+
# - Message items of role `system` support only `input_text` content
|
36
|
+
# - Message items of role `user` support `input_text` and `input_audio` content
|
37
|
+
# - Message items of role `assistant` support `text` content.
|
38
|
+
#
|
39
|
+
# @return [Array<OpenAI::Models::Realtime::ConversationItemWithReference::Content>, nil]
|
40
|
+
optional :content,
|
41
|
+
-> { OpenAI::Internal::Type::ArrayOf[OpenAI::Realtime::ConversationItemWithReference::Content] }
|
42
|
+
|
43
|
+
# @!attribute name
|
44
|
+
# The name of the function being called (for `function_call` items).
|
45
|
+
#
|
46
|
+
# @return [String, nil]
|
47
|
+
optional :name, String
|
48
|
+
|
49
|
+
# @!attribute object
|
50
|
+
# Identifier for the API object being returned - always `realtime.item`.
|
51
|
+
#
|
52
|
+
# @return [Symbol, OpenAI::Models::Realtime::ConversationItemWithReference::Object, nil]
|
53
|
+
optional :object, enum: -> { OpenAI::Realtime::ConversationItemWithReference::Object }
|
54
|
+
|
55
|
+
# @!attribute output
|
56
|
+
# The output of the function call (for `function_call_output` items).
|
57
|
+
#
|
58
|
+
# @return [String, nil]
|
59
|
+
optional :output, String
|
60
|
+
|
61
|
+
# @!attribute role
|
62
|
+
# The role of the message sender (`user`, `assistant`, `system`), only applicable
|
63
|
+
# for `message` items.
|
64
|
+
#
|
65
|
+
# @return [Symbol, OpenAI::Models::Realtime::ConversationItemWithReference::Role, nil]
|
66
|
+
optional :role, enum: -> { OpenAI::Realtime::ConversationItemWithReference::Role }
|
67
|
+
|
68
|
+
# @!attribute status
|
69
|
+
# The status of the item (`completed`, `incomplete`, `in_progress`). These have no
|
70
|
+
# effect on the conversation, but are accepted for consistency with the
|
71
|
+
# `conversation.item.created` event.
|
72
|
+
#
|
73
|
+
# @return [Symbol, OpenAI::Models::Realtime::ConversationItemWithReference::Status, nil]
|
74
|
+
optional :status, enum: -> { OpenAI::Realtime::ConversationItemWithReference::Status }
|
75
|
+
|
76
|
+
# @!attribute type
|
77
|
+
# The type of the item (`message`, `function_call`, `function_call_output`,
|
78
|
+
# `item_reference`).
|
79
|
+
#
|
80
|
+
# @return [Symbol, OpenAI::Models::Realtime::ConversationItemWithReference::Type, nil]
|
81
|
+
optional :type, enum: -> { OpenAI::Realtime::ConversationItemWithReference::Type }
|
82
|
+
|
83
|
+
# @!method initialize(id: nil, arguments: nil, call_id: nil, content: nil, name: nil, object: nil, output: nil, role: nil, status: nil, type: nil)
|
84
|
+
# Some parameter documentations has been truncated, see
|
85
|
+
# {OpenAI::Models::Realtime::ConversationItemWithReference} for more details.
|
86
|
+
#
|
87
|
+
# The item to add to the conversation.
|
88
|
+
#
|
89
|
+
# @param id [String] For an item of type (`message` | `function_call` | `function_call_output`)
|
90
|
+
#
|
91
|
+
# @param arguments [String] The arguments of the function call (for `function_call` items).
|
92
|
+
#
|
93
|
+
# @param call_id [String] The ID of the function call (for `function_call` and
|
94
|
+
#
|
95
|
+
# @param content [Array<OpenAI::Models::Realtime::ConversationItemWithReference::Content>] The content of the message, applicable for `message` items.
|
96
|
+
#
|
97
|
+
# @param name [String] The name of the function being called (for `function_call` items).
|
98
|
+
#
|
99
|
+
# @param object [Symbol, OpenAI::Models::Realtime::ConversationItemWithReference::Object] Identifier for the API object being returned - always `realtime.item`.
|
100
|
+
#
|
101
|
+
# @param output [String] The output of the function call (for `function_call_output` items).
|
102
|
+
#
|
103
|
+
# @param role [Symbol, OpenAI::Models::Realtime::ConversationItemWithReference::Role] The role of the message sender (`user`, `assistant`, `system`), only
|
104
|
+
#
|
105
|
+
# @param status [Symbol, OpenAI::Models::Realtime::ConversationItemWithReference::Status] The status of the item (`completed`, `incomplete`, `in_progress`). These have no
|
106
|
+
#
|
107
|
+
# @param type [Symbol, OpenAI::Models::Realtime::ConversationItemWithReference::Type] The type of the item (`message`, `function_call`, `function_call_output`,
|
108
|
+
# `item\_
|
109
|
+
|
110
|
+
class Content < OpenAI::Internal::Type::BaseModel
|
111
|
+
# @!attribute id
|
112
|
+
# ID of a previous conversation item to reference (for `item_reference` content
|
113
|
+
# types in `response.create` events). These can reference both client and server
|
114
|
+
# created items.
|
115
|
+
#
|
116
|
+
# @return [String, nil]
|
117
|
+
optional :id, String
|
118
|
+
|
119
|
+
# @!attribute audio
|
120
|
+
# Base64-encoded audio bytes, used for `input_audio` content type.
|
121
|
+
#
|
122
|
+
# @return [String, nil]
|
123
|
+
optional :audio, String
|
124
|
+
|
125
|
+
# @!attribute text
|
126
|
+
# The text content, used for `input_text` and `text` content types.
|
127
|
+
#
|
128
|
+
# @return [String, nil]
|
129
|
+
optional :text, String
|
130
|
+
|
131
|
+
# @!attribute transcript
|
132
|
+
# The transcript of the audio, used for `input_audio` content type.
|
133
|
+
#
|
134
|
+
# @return [String, nil]
|
135
|
+
optional :transcript, String
|
136
|
+
|
137
|
+
# @!attribute type
|
138
|
+
# The content type (`input_text`, `input_audio`, `item_reference`, `text`).
|
139
|
+
#
|
140
|
+
# @return [Symbol, OpenAI::Models::Realtime::ConversationItemWithReference::Content::Type, nil]
|
141
|
+
optional :type, enum: -> { OpenAI::Realtime::ConversationItemWithReference::Content::Type }
|
142
|
+
|
143
|
+
# @!method initialize(id: nil, audio: nil, text: nil, transcript: nil, type: nil)
|
144
|
+
# Some parameter documentations has been truncated, see
|
145
|
+
# {OpenAI::Models::Realtime::ConversationItemWithReference::Content} for more
|
146
|
+
# details.
|
147
|
+
#
|
148
|
+
# @param id [String] ID of a previous conversation item to reference (for `item_reference`
|
149
|
+
#
|
150
|
+
# @param audio [String] Base64-encoded audio bytes, used for `input_audio` content type.
|
151
|
+
#
|
152
|
+
# @param text [String] The text content, used for `input_text` and `text` content types.
|
153
|
+
#
|
154
|
+
# @param transcript [String] The transcript of the audio, used for `input_audio` content type.
|
155
|
+
#
|
156
|
+
# @param type [Symbol, OpenAI::Models::Realtime::ConversationItemWithReference::Content::Type] The content type (`input_text`, `input_audio`, `item_reference`, `text`).
|
157
|
+
|
158
|
+
# The content type (`input_text`, `input_audio`, `item_reference`, `text`).
|
159
|
+
#
|
160
|
+
# @see OpenAI::Models::Realtime::ConversationItemWithReference::Content#type
|
161
|
+
module Type
|
162
|
+
extend OpenAI::Internal::Type::Enum
|
163
|
+
|
164
|
+
INPUT_TEXT = :input_text
|
165
|
+
INPUT_AUDIO = :input_audio
|
166
|
+
ITEM_REFERENCE = :item_reference
|
167
|
+
TEXT = :text
|
168
|
+
|
169
|
+
# @!method self.values
|
170
|
+
# @return [Array<Symbol>]
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
# Identifier for the API object being returned - always `realtime.item`.
|
175
|
+
#
|
176
|
+
# @see OpenAI::Models::Realtime::ConversationItemWithReference#object
|
177
|
+
module Object
|
178
|
+
extend OpenAI::Internal::Type::Enum
|
179
|
+
|
180
|
+
REALTIME_ITEM = :"realtime.item"
|
181
|
+
|
182
|
+
# @!method self.values
|
183
|
+
# @return [Array<Symbol>]
|
184
|
+
end
|
185
|
+
|
186
|
+
# The role of the message sender (`user`, `assistant`, `system`), only applicable
|
187
|
+
# for `message` items.
|
188
|
+
#
|
189
|
+
# @see OpenAI::Models::Realtime::ConversationItemWithReference#role
|
190
|
+
module Role
|
191
|
+
extend OpenAI::Internal::Type::Enum
|
192
|
+
|
193
|
+
USER = :user
|
194
|
+
ASSISTANT = :assistant
|
195
|
+
SYSTEM = :system
|
196
|
+
|
197
|
+
# @!method self.values
|
198
|
+
# @return [Array<Symbol>]
|
199
|
+
end
|
200
|
+
|
201
|
+
# The status of the item (`completed`, `incomplete`, `in_progress`). These have no
|
202
|
+
# effect on the conversation, but are accepted for consistency with the
|
203
|
+
# `conversation.item.created` event.
|
204
|
+
#
|
205
|
+
# @see OpenAI::Models::Realtime::ConversationItemWithReference#status
|
206
|
+
module Status
|
207
|
+
extend OpenAI::Internal::Type::Enum
|
208
|
+
|
209
|
+
COMPLETED = :completed
|
210
|
+
INCOMPLETE = :incomplete
|
211
|
+
IN_PROGRESS = :in_progress
|
212
|
+
|
213
|
+
# @!method self.values
|
214
|
+
# @return [Array<Symbol>]
|
215
|
+
end
|
216
|
+
|
217
|
+
# The type of the item (`message`, `function_call`, `function_call_output`,
|
218
|
+
# `item_reference`).
|
219
|
+
#
|
220
|
+
# @see OpenAI::Models::Realtime::ConversationItemWithReference#type
|
221
|
+
module Type
|
222
|
+
extend OpenAI::Internal::Type::Enum
|
223
|
+
|
224
|
+
MESSAGE = :message
|
225
|
+
FUNCTION_CALL = :function_call
|
226
|
+
FUNCTION_CALL_OUTPUT = :function_call_output
|
227
|
+
ITEM_REFERENCE = :item_reference
|
228
|
+
|
229
|
+
# @!method self.values
|
230
|
+
# @return [Array<Symbol>]
|
231
|
+
end
|
232
|
+
end
|
233
|
+
end
|
234
|
+
end
|
235
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class InputAudioBufferAppendEvent < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute audio
|
8
|
+
# Base64-encoded audio bytes. This must be in the format specified by the
|
9
|
+
# `input_audio_format` field in the session configuration.
|
10
|
+
#
|
11
|
+
# @return [String]
|
12
|
+
required :audio, String
|
13
|
+
|
14
|
+
# @!attribute type
|
15
|
+
# The event type, must be `input_audio_buffer.append`.
|
16
|
+
#
|
17
|
+
# @return [Symbol, :"input_audio_buffer.append"]
|
18
|
+
required :type, const: :"input_audio_buffer.append"
|
19
|
+
|
20
|
+
# @!attribute event_id
|
21
|
+
# Optional client-generated ID used to identify this event.
|
22
|
+
#
|
23
|
+
# @return [String, nil]
|
24
|
+
optional :event_id, String
|
25
|
+
|
26
|
+
# @!method initialize(audio:, event_id: nil, type: :"input_audio_buffer.append")
|
27
|
+
# Some parameter documentations has been truncated, see
|
28
|
+
# {OpenAI::Models::Realtime::InputAudioBufferAppendEvent} for more details.
|
29
|
+
#
|
30
|
+
# Send this event to append audio bytes to the input audio buffer. The audio
|
31
|
+
# buffer is temporary storage you can write to and later commit. In Server VAD
|
32
|
+
# mode, the audio buffer is used to detect speech and the server will decide when
|
33
|
+
# to commit. When Server VAD is disabled, you must commit the audio buffer
|
34
|
+
# manually.
|
35
|
+
#
|
36
|
+
# The client may choose how much audio to place in each event up to a maximum of
|
37
|
+
# 15 MiB, for example streaming smaller chunks from the client may allow the VAD
|
38
|
+
# to be more responsive. Unlike made other client events, the server will not send
|
39
|
+
# a confirmation response to this event.
|
40
|
+
#
|
41
|
+
# @param audio [String] Base64-encoded audio bytes. This must be in the format specified by the
|
42
|
+
#
|
43
|
+
# @param event_id [String] Optional client-generated ID used to identify this event.
|
44
|
+
#
|
45
|
+
# @param type [Symbol, :"input_audio_buffer.append"] The event type, must be `input_audio_buffer.append`.
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class InputAudioBufferClearEvent < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute type
|
8
|
+
# The event type, must be `input_audio_buffer.clear`.
|
9
|
+
#
|
10
|
+
# @return [Symbol, :"input_audio_buffer.clear"]
|
11
|
+
required :type, const: :"input_audio_buffer.clear"
|
12
|
+
|
13
|
+
# @!attribute event_id
|
14
|
+
# Optional client-generated ID used to identify this event.
|
15
|
+
#
|
16
|
+
# @return [String, nil]
|
17
|
+
optional :event_id, String
|
18
|
+
|
19
|
+
# @!method initialize(event_id: nil, type: :"input_audio_buffer.clear")
|
20
|
+
# Send this event to clear the audio bytes in the buffer. The server will respond
|
21
|
+
# with an `input_audio_buffer.cleared` event.
|
22
|
+
#
|
23
|
+
# @param event_id [String] Optional client-generated ID used to identify this event.
|
24
|
+
#
|
25
|
+
# @param type [Symbol, :"input_audio_buffer.clear"] The event type, must be `input_audio_buffer.clear`.
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|