openai 0.19.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +28 -0
- data/README.md +1 -1
- data/lib/openai/client.rb +4 -0
- data/lib/openai/internal/stream.rb +3 -2
- data/lib/openai/models/audio/speech_create_params.rb +6 -0
- data/lib/openai/models/chat/chat_completion_audio_param.rb +6 -0
- data/lib/openai/models/chat/chat_completion_message.rb +7 -5
- data/lib/openai/models/chat/chat_completion_message_function_tool_call.rb +7 -5
- data/lib/openai/models/conversations/item_list_params.rb +2 -0
- data/lib/openai/models/evals/run_cancel_response.rb +2 -2
- data/lib/openai/models/evals/run_create_params.rb +2 -2
- data/lib/openai/models/evals/run_create_response.rb +2 -2
- data/lib/openai/models/evals/run_list_response.rb +2 -2
- data/lib/openai/models/evals/run_retrieve_response.rb +2 -2
- data/lib/openai/models/realtime/client_secret_create_params.rb +93 -0
- data/lib/openai/models/realtime/client_secret_create_response.rb +300 -0
- data/lib/openai/models/realtime/conversation_created_event.rb +70 -0
- data/lib/openai/models/realtime/conversation_item.rb +44 -0
- data/lib/openai/models/realtime/conversation_item_added.rb +48 -0
- data/lib/openai/models/realtime/conversation_item_create_event.rb +57 -0
- data/lib/openai/models/realtime/conversation_item_created_event.rb +59 -0
- data/lib/openai/models/realtime/conversation_item_delete_event.rb +39 -0
- data/lib/openai/models/realtime/conversation_item_deleted_event.rb +38 -0
- data/lib/openai/models/realtime/conversation_item_done.rb +48 -0
- data/lib/openai/models/realtime/conversation_item_input_audio_transcription_completed_event.rb +189 -0
- data/lib/openai/models/realtime/conversation_item_input_audio_transcription_delta_event.rb +63 -0
- data/lib/openai/models/realtime/conversation_item_input_audio_transcription_failed_event.rb +96 -0
- data/lib/openai/models/realtime/conversation_item_input_audio_transcription_segment.rb +84 -0
- data/lib/openai/models/realtime/conversation_item_retrieve_event.rb +40 -0
- data/lib/openai/models/realtime/conversation_item_truncate_event.rb +68 -0
- data/lib/openai/models/realtime/conversation_item_truncated_event.rb +60 -0
- data/lib/openai/models/realtime/conversation_item_with_reference.rb +235 -0
- data/lib/openai/models/realtime/input_audio_buffer_append_event.rb +49 -0
- data/lib/openai/models/realtime/input_audio_buffer_clear_event.rb +29 -0
- data/lib/openai/models/realtime/input_audio_buffer_cleared_event.rb +29 -0
- data/lib/openai/models/realtime/input_audio_buffer_commit_event.rb +35 -0
- data/lib/openai/models/realtime/input_audio_buffer_committed_event.rb +51 -0
- data/lib/openai/models/realtime/input_audio_buffer_speech_started_event.rb +59 -0
- data/lib/openai/models/realtime/input_audio_buffer_speech_stopped_event.rb +51 -0
- data/lib/openai/models/realtime/input_audio_buffer_timeout_triggered.rb +52 -0
- data/lib/openai/models/realtime/log_prob_properties.rb +39 -0
- data/lib/openai/models/realtime/mcp_list_tools_completed.rb +36 -0
- data/lib/openai/models/realtime/mcp_list_tools_failed.rb +36 -0
- data/lib/openai/models/realtime/mcp_list_tools_in_progress.rb +36 -0
- data/lib/openai/models/realtime/output_audio_buffer_clear_event.rb +32 -0
- data/lib/openai/models/realtime/rate_limits_updated_event.rb +91 -0
- data/lib/openai/models/realtime/realtime_audio_config.rb +446 -0
- data/lib/openai/models/realtime/realtime_client_event.rb +123 -0
- data/lib/openai/models/realtime/realtime_client_secret_config.rb +64 -0
- data/lib/openai/models/realtime/realtime_conversation_item_assistant_message.rb +118 -0
- data/lib/openai/models/realtime/realtime_conversation_item_function_call.rb +94 -0
- data/lib/openai/models/realtime/realtime_conversation_item_function_call_output.rb +86 -0
- data/lib/openai/models/realtime/realtime_conversation_item_system_message.rb +118 -0
- data/lib/openai/models/realtime/realtime_conversation_item_user_message.rb +135 -0
- data/lib/openai/models/realtime/realtime_error.rb +55 -0
- data/lib/openai/models/realtime/realtime_error_event.rb +38 -0
- data/lib/openai/models/realtime/realtime_mcp_approval_request.rb +52 -0
- data/lib/openai/models/realtime/realtime_mcp_approval_response.rb +52 -0
- data/lib/openai/models/realtime/realtime_mcp_list_tools.rb +84 -0
- data/lib/openai/models/realtime/realtime_mcp_protocol_error.rb +29 -0
- data/lib/openai/models/realtime/realtime_mcp_tool_call.rb +94 -0
- data/lib/openai/models/realtime/realtime_mcp_tool_execution_error.rb +23 -0
- data/lib/openai/models/realtime/realtime_mcphttp_error.rb +29 -0
- data/lib/openai/models/realtime/realtime_response.rb +259 -0
- data/lib/openai/models/realtime/realtime_response_status.rb +103 -0
- data/lib/openai/models/realtime/realtime_response_usage.rb +61 -0
- data/lib/openai/models/realtime/realtime_response_usage_input_token_details.rb +36 -0
- data/lib/openai/models/realtime/realtime_response_usage_output_token_details.rb +28 -0
- data/lib/openai/models/realtime/realtime_server_event.rb +369 -0
- data/lib/openai/models/realtime/realtime_session.rb +696 -0
- data/lib/openai/models/realtime/realtime_session_create_request.rb +234 -0
- data/lib/openai/models/realtime/realtime_session_create_response.rb +579 -0
- data/lib/openai/models/realtime/realtime_tool_choice_config.rb +32 -0
- data/lib/openai/models/realtime/realtime_tools_config.rb +11 -0
- data/lib/openai/models/realtime/realtime_tools_config_union.rb +379 -0
- data/lib/openai/models/realtime/realtime_tracing_config.rb +61 -0
- data/lib/openai/models/realtime/realtime_transcription_session_create_request.rb +312 -0
- data/lib/openai/models/realtime/realtime_truncation.rb +67 -0
- data/lib/openai/models/realtime/response_audio_delta_event.rb +68 -0
- data/lib/openai/models/realtime/response_audio_done_event.rb +61 -0
- data/lib/openai/models/realtime/response_audio_transcript_delta_event.rb +68 -0
- data/lib/openai/models/realtime/response_audio_transcript_done_event.rb +70 -0
- data/lib/openai/models/realtime/response_cancel_event.rb +42 -0
- data/lib/openai/models/realtime/response_content_part_added_event.rb +120 -0
- data/lib/openai/models/realtime/response_content_part_done_event.rb +120 -0
- data/lib/openai/models/realtime/response_create_event.rb +391 -0
- data/lib/openai/models/realtime/response_created_event.rb +37 -0
- data/lib/openai/models/realtime/response_done_event.rb +38 -0
- data/lib/openai/models/realtime/response_function_call_arguments_delta_event.rb +72 -0
- data/lib/openai/models/realtime/response_function_call_arguments_done_event.rb +73 -0
- data/lib/openai/models/realtime/response_mcp_call_arguments_delta.rb +68 -0
- data/lib/openai/models/realtime/response_mcp_call_arguments_done.rb +60 -0
- data/lib/openai/models/realtime/response_mcp_call_completed.rb +44 -0
- data/lib/openai/models/realtime/response_mcp_call_failed.rb +44 -0
- data/lib/openai/models/realtime/response_mcp_call_in_progress.rb +44 -0
- data/lib/openai/models/realtime/response_output_item_added_event.rb +52 -0
- data/lib/openai/models/realtime/response_output_item_done_event.rb +53 -0
- data/lib/openai/models/realtime/response_text_delta_event.rb +68 -0
- data/lib/openai/models/realtime/response_text_done_event.rb +69 -0
- data/lib/openai/models/realtime/session_created_event.rb +38 -0
- data/lib/openai/models/realtime/session_update_event.rb +44 -0
- data/lib/openai/models/realtime/session_updated_event.rb +37 -0
- data/lib/openai/models/realtime/transcription_session_created.rb +278 -0
- data/lib/openai/models/realtime/transcription_session_update.rb +36 -0
- data/lib/openai/models/realtime/transcription_session_updated_event.rb +279 -0
- data/lib/openai/models/responses/response.rb +6 -3
- data/lib/openai/models/responses/response_create_params.rb +8 -3
- data/lib/openai/models/responses/response_function_tool_call.rb +7 -5
- data/lib/openai/models/responses/response_function_web_search.rb +35 -1
- data/lib/openai/models/responses/response_includable.rb +2 -0
- data/lib/openai/models/responses/response_output_text.rb +7 -5
- data/lib/openai/models/responses/tool.rb +6 -2
- data/lib/openai/models/responses/web_search_preview_tool.rb +124 -0
- data/lib/openai/models/responses/web_search_tool.rb +58 -21
- data/lib/openai/models/webhooks/realtime_call_incoming_webhook_event.rb +119 -0
- data/lib/openai/models/webhooks/unwrap_webhook_event.rb +4 -1
- data/lib/openai/models.rb +2 -0
- data/lib/openai/resources/conversations.rb +1 -1
- data/lib/openai/resources/realtime/client_secrets.rb +44 -0
- data/lib/openai/resources/realtime.rb +18 -0
- data/lib/openai/resources/responses.rb +2 -2
- data/lib/openai/resources/webhooks.rb +1 -1
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +95 -0
- data/rbi/openai/client.rbi +3 -0
- data/rbi/openai/models/audio/speech_create_params.rbi +10 -0
- data/rbi/openai/models/chat/chat_completion_audio_param.rbi +10 -0
- data/rbi/openai/models/conversations/item_list_params.rbi +4 -0
- data/rbi/openai/models/evals/run_cancel_response.rbi +4 -2
- data/rbi/openai/models/evals/run_create_params.rbi +8 -4
- data/rbi/openai/models/evals/run_create_response.rbi +4 -2
- data/rbi/openai/models/evals/run_list_response.rbi +4 -2
- data/rbi/openai/models/evals/run_retrieve_response.rbi +4 -2
- data/rbi/openai/models/realtime/client_secret_create_params.rbi +222 -0
- data/rbi/openai/models/realtime/client_secret_create_response.rbi +676 -0
- data/rbi/openai/models/realtime/conversation_created_event.rbi +164 -0
- data/rbi/openai/models/realtime/conversation_item.rbi +35 -0
- data/rbi/openai/models/realtime/conversation_item_added.rbi +105 -0
- data/rbi/openai/models/realtime/conversation_item_create_event.rbi +123 -0
- data/rbi/openai/models/realtime/conversation_item_created_event.rbi +117 -0
- data/rbi/openai/models/realtime/conversation_item_delete_event.rbi +57 -0
- data/rbi/openai/models/realtime/conversation_item_deleted_event.rbi +53 -0
- data/rbi/openai/models/realtime/conversation_item_done.rbi +105 -0
- data/rbi/openai/models/realtime/conversation_item_input_audio_transcription_completed_event.rbi +305 -0
- data/rbi/openai/models/realtime/conversation_item_input_audio_transcription_delta_event.rbi +93 -0
- data/rbi/openai/models/realtime/conversation_item_input_audio_transcription_failed_event.rbi +158 -0
- data/rbi/openai/models/realtime/conversation_item_input_audio_transcription_segment.rbi +107 -0
- data/rbi/openai/models/realtime/conversation_item_retrieve_event.rbi +58 -0
- data/rbi/openai/models/realtime/conversation_item_truncate_event.rbi +94 -0
- data/rbi/openai/models/realtime/conversation_item_truncated_event.rbi +80 -0
- data/rbi/openai/models/realtime/conversation_item_with_reference.rbi +549 -0
- data/rbi/openai/models/realtime/input_audio_buffer_append_event.rbi +65 -0
- data/rbi/openai/models/realtime/input_audio_buffer_clear_event.rbi +43 -0
- data/rbi/openai/models/realtime/input_audio_buffer_cleared_event.rbi +40 -0
- data/rbi/openai/models/realtime/input_audio_buffer_commit_event.rbi +49 -0
- data/rbi/openai/models/realtime/input_audio_buffer_committed_event.rbi +72 -0
- data/rbi/openai/models/realtime/input_audio_buffer_speech_started_event.rbi +82 -0
- data/rbi/openai/models/realtime/input_audio_buffer_speech_stopped_event.rbi +73 -0
- data/rbi/openai/models/realtime/input_audio_buffer_timeout_triggered.rbi +75 -0
- data/rbi/openai/models/realtime/log_prob_properties.rbi +55 -0
- data/rbi/openai/models/realtime/mcp_list_tools_completed.rbi +51 -0
- data/rbi/openai/models/realtime/mcp_list_tools_failed.rbi +51 -0
- data/rbi/openai/models/realtime/mcp_list_tools_in_progress.rbi +51 -0
- data/rbi/openai/models/realtime/output_audio_buffer_clear_event.rbi +46 -0
- data/rbi/openai/models/realtime/rate_limits_updated_event.rbi +187 -0
- data/rbi/openai/models/realtime/realtime_audio_config.rbi +1004 -0
- data/rbi/openai/models/realtime/realtime_client_event.rbi +38 -0
- data/rbi/openai/models/realtime/realtime_client_secret_config.rbi +147 -0
- data/rbi/openai/models/realtime/realtime_conversation_item_assistant_message.rbi +292 -0
- data/rbi/openai/models/realtime/realtime_conversation_item_function_call.rbi +199 -0
- data/rbi/openai/models/realtime/realtime_conversation_item_function_call_output.rbi +188 -0
- data/rbi/openai/models/realtime/realtime_conversation_item_system_message.rbi +292 -0
- data/rbi/openai/models/realtime/realtime_conversation_item_user_message.rbi +319 -0
- data/rbi/openai/models/realtime/realtime_error.rbi +72 -0
- data/rbi/openai/models/realtime/realtime_error_event.rbi +64 -0
- data/rbi/openai/models/realtime/realtime_mcp_approval_request.rbi +75 -0
- data/rbi/openai/models/realtime/realtime_mcp_approval_response.rbi +75 -0
- data/rbi/openai/models/realtime/realtime_mcp_list_tools.rbi +131 -0
- data/rbi/openai/models/realtime/realtime_mcp_protocol_error.rbi +40 -0
- data/rbi/openai/models/realtime/realtime_mcp_tool_call.rbi +145 -0
- data/rbi/openai/models/realtime/realtime_mcp_tool_execution_error.rbi +31 -0
- data/rbi/openai/models/realtime/realtime_mcphttp_error.rbi +40 -0
- data/rbi/openai/models/realtime/realtime_response.rbi +573 -0
- data/rbi/openai/models/realtime/realtime_response_status.rbi +233 -0
- data/rbi/openai/models/realtime/realtime_response_usage.rbi +121 -0
- data/rbi/openai/models/realtime/realtime_response_usage_input_token_details.rbi +68 -0
- data/rbi/openai/models/realtime/realtime_response_usage_output_token_details.rbi +51 -0
- data/rbi/openai/models/realtime/realtime_server_event.rbi +311 -0
- data/rbi/openai/models/realtime/realtime_session.rbi +1426 -0
- data/rbi/openai/models/realtime/realtime_session_create_request.rbi +560 -0
- data/rbi/openai/models/realtime/realtime_session_create_response.rbi +1249 -0
- data/rbi/openai/models/realtime/realtime_tool_choice_config.rbi +30 -0
- data/rbi/openai/models/realtime/realtime_tools_config.rbi +15 -0
- data/rbi/openai/models/realtime/realtime_tools_config_union.rbi +755 -0
- data/rbi/openai/models/realtime/realtime_tracing_config.rbi +95 -0
- data/rbi/openai/models/realtime/realtime_transcription_session_create_request.rbi +703 -0
- data/rbi/openai/models/realtime/realtime_truncation.rbi +117 -0
- data/rbi/openai/models/realtime/response_audio_delta_event.rbi +91 -0
- data/rbi/openai/models/realtime/response_audio_done_event.rbi +84 -0
- data/rbi/openai/models/realtime/response_audio_transcript_delta_event.rbi +91 -0
- data/rbi/openai/models/realtime/response_audio_transcript_done_event.rbi +93 -0
- data/rbi/openai/models/realtime/response_cancel_event.rbi +63 -0
- data/rbi/openai/models/realtime/response_content_part_added_event.rbi +219 -0
- data/rbi/openai/models/realtime/response_content_part_done_event.rbi +219 -0
- data/rbi/openai/models/realtime/response_create_event.rbi +863 -0
- data/rbi/openai/models/realtime/response_created_event.rbi +65 -0
- data/rbi/openai/models/realtime/response_done_event.rbi +66 -0
- data/rbi/openai/models/realtime/response_function_call_arguments_delta_event.rbi +91 -0
- data/rbi/openai/models/realtime/response_function_call_arguments_done_event.rbi +92 -0
- data/rbi/openai/models/realtime/response_mcp_call_arguments_delta.rbi +91 -0
- data/rbi/openai/models/realtime/response_mcp_call_arguments_done.rbi +83 -0
- data/rbi/openai/models/realtime/response_mcp_call_completed.rbi +67 -0
- data/rbi/openai/models/realtime/response_mcp_call_failed.rbi +67 -0
- data/rbi/openai/models/realtime/response_mcp_call_in_progress.rbi +67 -0
- data/rbi/openai/models/realtime/response_output_item_added_event.rbi +111 -0
- data/rbi/openai/models/realtime/response_output_item_done_event.rbi +112 -0
- data/rbi/openai/models/realtime/response_text_delta_event.rbi +91 -0
- data/rbi/openai/models/realtime/response_text_done_event.rbi +92 -0
- data/rbi/openai/models/realtime/session_created_event.rbi +64 -0
- data/rbi/openai/models/realtime/session_update_event.rbi +77 -0
- data/rbi/openai/models/realtime/session_updated_event.rbi +63 -0
- data/rbi/openai/models/realtime/transcription_session_created.rbi +653 -0
- data/rbi/openai/models/realtime/transcription_session_update.rbi +74 -0
- data/rbi/openai/models/realtime/transcription_session_updated_event.rbi +657 -0
- data/rbi/openai/models/responses/response.rbi +10 -3
- data/rbi/openai/models/responses/response_create_params.rbi +20 -6
- data/rbi/openai/models/responses/response_function_web_search.rbi +78 -2
- data/rbi/openai/models/responses/response_includable.rbi +2 -0
- data/rbi/openai/models/responses/tool.rbi +2 -1
- data/rbi/openai/models/responses/web_search_preview_tool.rbi +245 -0
- data/rbi/openai/models/responses/web_search_tool.rbi +120 -23
- data/rbi/openai/models/webhooks/realtime_call_incoming_webhook_event.rbi +222 -0
- data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +1 -0
- data/rbi/openai/models.rbi +2 -0
- data/rbi/openai/resources/conversations/items.rbi +2 -0
- data/rbi/openai/resources/conversations.rbi +1 -1
- data/rbi/openai/resources/realtime/client_secrets.rbi +38 -0
- data/rbi/openai/resources/realtime.rbi +15 -0
- data/rbi/openai/resources/responses.rbi +16 -4
- data/rbi/openai/resources/webhooks.rbi +1 -0
- data/sig/openai/client.rbs +2 -0
- data/sig/openai/models/audio/speech_create_params.rbs +4 -0
- data/sig/openai/models/chat/chat_completion_audio_param.rbs +4 -0
- data/sig/openai/models/realtime/client_secret_create_params.rbs +89 -0
- data/sig/openai/models/realtime/client_secret_create_response.rbs +292 -0
- data/sig/openai/models/realtime/conversation_created_event.rbs +70 -0
- data/sig/openai/models/realtime/conversation_item.rbs +22 -0
- data/sig/openai/models/realtime/conversation_item_added.rbs +37 -0
- data/sig/openai/models/realtime/conversation_item_create_event.rbs +41 -0
- data/sig/openai/models/realtime/conversation_item_created_event.rbs +37 -0
- data/sig/openai/models/realtime/conversation_item_delete_event.rbs +30 -0
- data/sig/openai/models/realtime/conversation_item_deleted_event.rbs +32 -0
- data/sig/openai/models/realtime/conversation_item_done.rbs +37 -0
- data/sig/openai/models/realtime/conversation_item_input_audio_transcription_completed_event.rbs +136 -0
- data/sig/openai/models/realtime/conversation_item_input_audio_transcription_delta_event.rbs +51 -0
- data/sig/openai/models/realtime/conversation_item_input_audio_transcription_failed_event.rbs +77 -0
- data/sig/openai/models/realtime/conversation_item_input_audio_transcription_segment.rbs +62 -0
- data/sig/openai/models/realtime/conversation_item_retrieve_event.rbs +34 -0
- data/sig/openai/models/realtime/conversation_item_truncate_event.rbs +44 -0
- data/sig/openai/models/realtime/conversation_item_truncated_event.rbs +42 -0
- data/sig/openai/models/realtime/conversation_item_with_reference.rbs +207 -0
- data/sig/openai/models/realtime/input_audio_buffer_append_event.rbs +30 -0
- data/sig/openai/models/realtime/input_audio_buffer_clear_event.rbs +23 -0
- data/sig/openai/models/realtime/input_audio_buffer_cleared_event.rbs +24 -0
- data/sig/openai/models/realtime/input_audio_buffer_commit_event.rbs +23 -0
- data/sig/openai/models/realtime/input_audio_buffer_committed_event.rbs +37 -0
- data/sig/openai/models/realtime/input_audio_buffer_speech_started_event.rbs +37 -0
- data/sig/openai/models/realtime/input_audio_buffer_speech_stopped_event.rbs +37 -0
- data/sig/openai/models/realtime/input_audio_buffer_timeout_triggered.rbs +42 -0
- data/sig/openai/models/realtime/log_prob_properties.rbs +28 -0
- data/sig/openai/models/realtime/mcp_list_tools_completed.rbs +28 -0
- data/sig/openai/models/realtime/mcp_list_tools_failed.rbs +28 -0
- data/sig/openai/models/realtime/mcp_list_tools_in_progress.rbs +32 -0
- data/sig/openai/models/realtime/output_audio_buffer_clear_event.rbs +23 -0
- data/sig/openai/models/realtime/rate_limits_updated_event.rbs +85 -0
- data/sig/openai/models/realtime/realtime_audio_config.rbs +354 -0
- data/sig/openai/models/realtime/realtime_client_event.rbs +25 -0
- data/sig/openai/models/realtime/realtime_client_secret_config.rbs +60 -0
- data/sig/openai/models/realtime/realtime_conversation_item_assistant_message.rbs +117 -0
- data/sig/openai/models/realtime/realtime_conversation_item_function_call.rbs +86 -0
- data/sig/openai/models/realtime/realtime_conversation_item_function_call_output.rbs +79 -0
- data/sig/openai/models/realtime/realtime_conversation_item_system_message.rbs +117 -0
- data/sig/openai/models/realtime/realtime_conversation_item_user_message.rbs +132 -0
- data/sig/openai/models/realtime/realtime_error.rbs +42 -0
- data/sig/openai/models/realtime/realtime_error_event.rbs +32 -0
- data/sig/openai/models/realtime/realtime_mcp_approval_request.rbs +42 -0
- data/sig/openai/models/realtime/realtime_mcp_approval_response.rbs +42 -0
- data/sig/openai/models/realtime/realtime_mcp_list_tools.rbs +71 -0
- data/sig/openai/models/realtime/realtime_mcp_protocol_error.rbs +28 -0
- data/sig/openai/models/realtime/realtime_mcp_tool_call.rbs +68 -0
- data/sig/openai/models/realtime/realtime_mcp_tool_execution_error.rbs +18 -0
- data/sig/openai/models/realtime/realtime_mcphttp_error.rbs +24 -0
- data/sig/openai/models/realtime/realtime_response.rbs +210 -0
- data/sig/openai/models/realtime/realtime_response_status.rbs +90 -0
- data/sig/openai/models/realtime/realtime_response_usage.rbs +56 -0
- data/sig/openai/models/realtime/realtime_response_usage_input_token_details.rbs +34 -0
- data/sig/openai/models/realtime/realtime_response_usage_output_token_details.rbs +22 -0
- data/sig/openai/models/realtime/realtime_server_event.rbs +168 -0
- data/sig/openai/models/realtime/realtime_session.rbs +521 -0
- data/sig/openai/models/realtime/realtime_session_create_request.rbs +178 -0
- data/sig/openai/models/realtime/realtime_session_create_response.rbs +526 -0
- data/sig/openai/models/realtime/realtime_tool_choice_config.rbs +16 -0
- data/sig/openai/models/realtime/realtime_tools_config.rbs +10 -0
- data/sig/openai/models/realtime/realtime_tools_config_union.rbs +280 -0
- data/sig/openai/models/realtime/realtime_tracing_config.rbs +43 -0
- data/sig/openai/models/realtime/realtime_transcription_session_create_request.rbs +242 -0
- data/sig/openai/models/realtime/realtime_truncation.rbs +53 -0
- data/sig/openai/models/realtime/response_audio_delta_event.rbs +52 -0
- data/sig/openai/models/realtime/response_audio_done_event.rbs +47 -0
- data/sig/openai/models/realtime/response_audio_transcript_delta_event.rbs +52 -0
- data/sig/openai/models/realtime/response_audio_transcript_done_event.rbs +52 -0
- data/sig/openai/models/realtime/response_cancel_event.rbs +32 -0
- data/sig/openai/models/realtime/response_content_part_added_event.rbs +105 -0
- data/sig/openai/models/realtime/response_content_part_done_event.rbs +105 -0
- data/sig/openai/models/realtime/response_create_event.rbs +281 -0
- data/sig/openai/models/realtime/response_created_event.rbs +32 -0
- data/sig/openai/models/realtime/response_done_event.rbs +32 -0
- data/sig/openai/models/realtime/response_function_call_arguments_delta_event.rbs +52 -0
- data/sig/openai/models/realtime/response_function_call_arguments_done_event.rbs +52 -0
- data/sig/openai/models/realtime/response_mcp_call_arguments_delta.rbs +52 -0
- data/sig/openai/models/realtime/response_mcp_call_arguments_done.rbs +47 -0
- data/sig/openai/models/realtime/response_mcp_call_completed.rbs +37 -0
- data/sig/openai/models/realtime/response_mcp_call_failed.rbs +37 -0
- data/sig/openai/models/realtime/response_mcp_call_in_progress.rbs +37 -0
- data/sig/openai/models/realtime/response_output_item_added_event.rbs +42 -0
- data/sig/openai/models/realtime/response_output_item_done_event.rbs +42 -0
- data/sig/openai/models/realtime/response_text_delta_event.rbs +52 -0
- data/sig/openai/models/realtime/response_text_done_event.rbs +52 -0
- data/sig/openai/models/realtime/session_created_event.rbs +32 -0
- data/sig/openai/models/realtime/session_update_event.rbs +34 -0
- data/sig/openai/models/realtime/session_updated_event.rbs +32 -0
- data/sig/openai/models/realtime/transcription_session_created.rbs +282 -0
- data/sig/openai/models/realtime/transcription_session_update.rbs +34 -0
- data/sig/openai/models/realtime/transcription_session_updated_event.rbs +282 -0
- data/sig/openai/models/responses/response_function_web_search.rbs +34 -3
- data/sig/openai/models/responses/tool.rbs +1 -0
- data/sig/openai/models/responses/web_search_preview_tool.rbs +96 -0
- data/sig/openai/models/responses/web_search_tool.rbs +39 -10
- data/sig/openai/models/webhooks/realtime_call_incoming_webhook_event.rbs +90 -0
- data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +1 -0
- data/sig/openai/models.rbs +2 -0
- data/sig/openai/resources/realtime/client_secrets.rbs +15 -0
- data/sig/openai/resources/realtime.rbs +9 -0
- data/sig/openai/resources/webhooks.rbs +1 -0
- metadata +287 -2
@@ -0,0 +1,123 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
# A realtime client event.
|
7
|
+
module RealtimeClientEvent
|
8
|
+
extend OpenAI::Internal::Type::Union
|
9
|
+
|
10
|
+
discriminator :type
|
11
|
+
|
12
|
+
# Add a new Item to the Conversation's context, including messages, function
|
13
|
+
# calls, and function call responses. This event can be used both to populate a
|
14
|
+
# "history" of the conversation and to add new items mid-stream, but has the
|
15
|
+
# current limitation that it cannot populate assistant audio messages.
|
16
|
+
#
|
17
|
+
# If successful, the server will respond with a `conversation.item.created`
|
18
|
+
# event, otherwise an `error` event will be sent.
|
19
|
+
variant :"conversation.item.create", -> { OpenAI::Realtime::ConversationItemCreateEvent }
|
20
|
+
|
21
|
+
# Send this event when you want to remove any item from the conversation
|
22
|
+
# history. The server will respond with a `conversation.item.deleted` event,
|
23
|
+
# unless the item does not exist in the conversation history, in which case the
|
24
|
+
# server will respond with an error.
|
25
|
+
variant :"conversation.item.delete", -> { OpenAI::Realtime::ConversationItemDeleteEvent }
|
26
|
+
|
27
|
+
# Send this event when you want to retrieve the server's representation of a specific item in the conversation history. This is useful, for example, to inspect user audio after noise cancellation and VAD.
|
28
|
+
# The server will respond with a `conversation.item.retrieved` event,
|
29
|
+
# unless the item does not exist in the conversation history, in which case the
|
30
|
+
# server will respond with an error.
|
31
|
+
variant :"conversation.item.retrieve", -> { OpenAI::Realtime::ConversationItemRetrieveEvent }
|
32
|
+
|
33
|
+
# Send this event to truncate a previous assistant message’s audio. The server
|
34
|
+
# will produce audio faster than realtime, so this event is useful when the user
|
35
|
+
# interrupts to truncate audio that has already been sent to the client but not
|
36
|
+
# yet played. This will synchronize the server's understanding of the audio with
|
37
|
+
# the client's playback.
|
38
|
+
#
|
39
|
+
# Truncating audio will delete the server-side text transcript to ensure there
|
40
|
+
# is not text in the context that hasn't been heard by the user.
|
41
|
+
#
|
42
|
+
# If successful, the server will respond with a `conversation.item.truncated`
|
43
|
+
# event.
|
44
|
+
variant :"conversation.item.truncate", -> { OpenAI::Realtime::ConversationItemTruncateEvent }
|
45
|
+
|
46
|
+
# Send this event to append audio bytes to the input audio buffer. The audio
|
47
|
+
# buffer is temporary storage you can write to and later commit. In Server VAD
|
48
|
+
# mode, the audio buffer is used to detect speech and the server will decide
|
49
|
+
# when to commit. When Server VAD is disabled, you must commit the audio buffer
|
50
|
+
# manually.
|
51
|
+
#
|
52
|
+
# The client may choose how much audio to place in each event up to a maximum
|
53
|
+
# of 15 MiB, for example streaming smaller chunks from the client may allow the
|
54
|
+
# VAD to be more responsive. Unlike made other client events, the server will
|
55
|
+
# not send a confirmation response to this event.
|
56
|
+
variant :"input_audio_buffer.append", -> { OpenAI::Realtime::InputAudioBufferAppendEvent }
|
57
|
+
|
58
|
+
# Send this event to clear the audio bytes in the buffer. The server will
|
59
|
+
# respond with an `input_audio_buffer.cleared` event.
|
60
|
+
variant :"input_audio_buffer.clear", -> { OpenAI::Realtime::InputAudioBufferClearEvent }
|
61
|
+
|
62
|
+
# **WebRTC Only:** Emit to cut off the current audio response. This will trigger the server to
|
63
|
+
# stop generating audio and emit a `output_audio_buffer.cleared` event. This
|
64
|
+
# event should be preceded by a `response.cancel` client event to stop the
|
65
|
+
# generation of the current response.
|
66
|
+
# [Learn more](https://platform.openai.com/docs/guides/realtime-conversations#client-and-server-events-for-audio-in-webrtc).
|
67
|
+
variant :"output_audio_buffer.clear", -> { OpenAI::Realtime::OutputAudioBufferClearEvent }
|
68
|
+
|
69
|
+
# Send this event to commit the user input audio buffer, which will create a
|
70
|
+
# new user message item in the conversation. This event will produce an error
|
71
|
+
# if the input audio buffer is empty. When in Server VAD mode, the client does
|
72
|
+
# not need to send this event, the server will commit the audio buffer
|
73
|
+
# automatically.
|
74
|
+
#
|
75
|
+
# Committing the input audio buffer will trigger input audio transcription
|
76
|
+
# (if enabled in session configuration), but it will not create a response
|
77
|
+
# from the model. The server will respond with an `input_audio_buffer.committed`
|
78
|
+
# event.
|
79
|
+
variant :"input_audio_buffer.commit", -> { OpenAI::Realtime::InputAudioBufferCommitEvent }
|
80
|
+
|
81
|
+
# Send this event to cancel an in-progress response. The server will respond
|
82
|
+
# with a `response.done` event with a status of `response.status=cancelled`. If
|
83
|
+
# there is no response to cancel, the server will respond with an error.
|
84
|
+
variant :"response.cancel", -> { OpenAI::Realtime::ResponseCancelEvent }
|
85
|
+
|
86
|
+
# This event instructs the server to create a Response, which means triggering
|
87
|
+
# model inference. When in Server VAD mode, the server will create Responses
|
88
|
+
# automatically.
|
89
|
+
#
|
90
|
+
# A Response will include at least one Item, and may have two, in which case
|
91
|
+
# the second will be a function call. These Items will be appended to the
|
92
|
+
# conversation history.
|
93
|
+
#
|
94
|
+
# The server will respond with a `response.created` event, events for Items
|
95
|
+
# and content created, and finally a `response.done` event to indicate the
|
96
|
+
# Response is complete.
|
97
|
+
#
|
98
|
+
# The `response.create` event includes inference configuration like
|
99
|
+
# `instructions`, and `temperature`. These fields will override the Session's
|
100
|
+
# configuration for this Response only.
|
101
|
+
variant :"response.create", -> { OpenAI::Realtime::ResponseCreateEvent }
|
102
|
+
|
103
|
+
# Send this event to update the session’s default configuration.
|
104
|
+
# The client may send this event at any time to update any field,
|
105
|
+
# except for `voice`. However, note that once a session has been
|
106
|
+
# initialized with a particular `model`, it can’t be changed to
|
107
|
+
# another model using `session.update`.
|
108
|
+
#
|
109
|
+
# When the server receives a `session.update`, it will respond
|
110
|
+
# with a `session.updated` event showing the full, effective configuration.
|
111
|
+
# Only the fields that are present are updated. To clear a field like
|
112
|
+
# `instructions`, pass an empty string.
|
113
|
+
variant :"session.update", -> { OpenAI::Realtime::SessionUpdateEvent }
|
114
|
+
|
115
|
+
# Send this event to update a transcription session.
|
116
|
+
variant :"transcription_session.update", -> { OpenAI::Realtime::TranscriptionSessionUpdate }
|
117
|
+
|
118
|
+
# @!method self.variants
|
119
|
+
# @return [Array(OpenAI::Models::Realtime::ConversationItemCreateEvent, OpenAI::Models::Realtime::ConversationItemDeleteEvent, OpenAI::Models::Realtime::ConversationItemRetrieveEvent, OpenAI::Models::Realtime::ConversationItemTruncateEvent, OpenAI::Models::Realtime::InputAudioBufferAppendEvent, OpenAI::Models::Realtime::InputAudioBufferClearEvent, OpenAI::Models::Realtime::OutputAudioBufferClearEvent, OpenAI::Models::Realtime::InputAudioBufferCommitEvent, OpenAI::Models::Realtime::ResponseCancelEvent, OpenAI::Models::Realtime::ResponseCreateEvent, OpenAI::Models::Realtime::SessionUpdateEvent, OpenAI::Models::Realtime::TranscriptionSessionUpdate)]
|
120
|
+
end
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class RealtimeClientSecretConfig < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute expires_after
|
8
|
+
# Configuration for the ephemeral token expiration.
|
9
|
+
#
|
10
|
+
# @return [OpenAI::Models::Realtime::RealtimeClientSecretConfig::ExpiresAfter, nil]
|
11
|
+
optional :expires_after, -> { OpenAI::Realtime::RealtimeClientSecretConfig::ExpiresAfter }
|
12
|
+
|
13
|
+
# @!method initialize(expires_after: nil)
|
14
|
+
# Some parameter documentations has been truncated, see
|
15
|
+
# {OpenAI::Models::Realtime::RealtimeClientSecretConfig} for more details.
|
16
|
+
#
|
17
|
+
# Configuration options for the generated client secret.
|
18
|
+
#
|
19
|
+
# @param expires_after [OpenAI::Models::Realtime::RealtimeClientSecretConfig::ExpiresAfter] Configuration for the ephemeral token expiration.
|
20
|
+
|
21
|
+
# @see OpenAI::Models::Realtime::RealtimeClientSecretConfig#expires_after
|
22
|
+
class ExpiresAfter < OpenAI::Internal::Type::BaseModel
|
23
|
+
# @!attribute anchor
|
24
|
+
# The anchor point for the ephemeral token expiration. Only `created_at` is
|
25
|
+
# currently supported.
|
26
|
+
#
|
27
|
+
# @return [Symbol, OpenAI::Models::Realtime::RealtimeClientSecretConfig::ExpiresAfter::Anchor]
|
28
|
+
required :anchor, enum: -> { OpenAI::Realtime::RealtimeClientSecretConfig::ExpiresAfter::Anchor }
|
29
|
+
|
30
|
+
# @!attribute seconds
|
31
|
+
# The number of seconds from the anchor point to the expiration. Select a value
|
32
|
+
# between `10` and `7200`.
|
33
|
+
#
|
34
|
+
# @return [Integer, nil]
|
35
|
+
optional :seconds, Integer
|
36
|
+
|
37
|
+
# @!method initialize(anchor:, seconds: nil)
|
38
|
+
# Some parameter documentations has been truncated, see
|
39
|
+
# {OpenAI::Models::Realtime::RealtimeClientSecretConfig::ExpiresAfter} for more
|
40
|
+
# details.
|
41
|
+
#
|
42
|
+
# Configuration for the ephemeral token expiration.
|
43
|
+
#
|
44
|
+
# @param anchor [Symbol, OpenAI::Models::Realtime::RealtimeClientSecretConfig::ExpiresAfter::Anchor] The anchor point for the ephemeral token expiration. Only `created_at` is curren
|
45
|
+
#
|
46
|
+
# @param seconds [Integer] The number of seconds from the anchor point to the expiration. Select a value be
|
47
|
+
|
48
|
+
# The anchor point for the ephemeral token expiration. Only `created_at` is
|
49
|
+
# currently supported.
|
50
|
+
#
|
51
|
+
# @see OpenAI::Models::Realtime::RealtimeClientSecretConfig::ExpiresAfter#anchor
|
52
|
+
module Anchor
|
53
|
+
extend OpenAI::Internal::Type::Enum
|
54
|
+
|
55
|
+
CREATED_AT = :created_at
|
56
|
+
|
57
|
+
# @!method self.values
|
58
|
+
# @return [Array<Symbol>]
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,118 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class RealtimeConversationItemAssistantMessage < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute content
|
8
|
+
# The content of the message.
|
9
|
+
#
|
10
|
+
# @return [Array<OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Content>]
|
11
|
+
required :content,
|
12
|
+
-> { OpenAI::Internal::Type::ArrayOf[OpenAI::Realtime::RealtimeConversationItemAssistantMessage::Content] }
|
13
|
+
|
14
|
+
# @!attribute role
|
15
|
+
# The role of the message sender. Always `assistant`.
|
16
|
+
#
|
17
|
+
# @return [Symbol, :assistant]
|
18
|
+
required :role, const: :assistant
|
19
|
+
|
20
|
+
# @!attribute type
|
21
|
+
# The type of the item. Always `message`.
|
22
|
+
#
|
23
|
+
# @return [Symbol, :message]
|
24
|
+
required :type, const: :message
|
25
|
+
|
26
|
+
# @!attribute id
|
27
|
+
# The unique ID of the item.
|
28
|
+
#
|
29
|
+
# @return [String, nil]
|
30
|
+
optional :id, String
|
31
|
+
|
32
|
+
# @!attribute object
|
33
|
+
# Identifier for the API object being returned - always `realtime.item`.
|
34
|
+
#
|
35
|
+
# @return [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Object, nil]
|
36
|
+
optional :object, enum: -> { OpenAI::Realtime::RealtimeConversationItemAssistantMessage::Object }
|
37
|
+
|
38
|
+
# @!attribute status
|
39
|
+
# The status of the item. Has no effect on the conversation.
|
40
|
+
#
|
41
|
+
# @return [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Status, nil]
|
42
|
+
optional :status, enum: -> { OpenAI::Realtime::RealtimeConversationItemAssistantMessage::Status }
|
43
|
+
|
44
|
+
# @!method initialize(content:, id: nil, object: nil, status: nil, role: :assistant, type: :message)
|
45
|
+
# An assistant message item in a Realtime conversation.
|
46
|
+
#
|
47
|
+
# @param content [Array<OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Content>] The content of the message.
|
48
|
+
#
|
49
|
+
# @param id [String] The unique ID of the item.
|
50
|
+
#
|
51
|
+
# @param object [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Object] Identifier for the API object being returned - always `realtime.item`.
|
52
|
+
#
|
53
|
+
# @param status [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Status] The status of the item. Has no effect on the conversation.
|
54
|
+
#
|
55
|
+
# @param role [Symbol, :assistant] The role of the message sender. Always `assistant`.
|
56
|
+
#
|
57
|
+
# @param type [Symbol, :message] The type of the item. Always `message`.
|
58
|
+
|
59
|
+
class Content < OpenAI::Internal::Type::BaseModel
|
60
|
+
# @!attribute text
|
61
|
+
# The text content.
|
62
|
+
#
|
63
|
+
# @return [String, nil]
|
64
|
+
optional :text, String
|
65
|
+
|
66
|
+
# @!attribute type
|
67
|
+
# The content type. Always `text` for assistant messages.
|
68
|
+
#
|
69
|
+
# @return [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Content::Type, nil]
|
70
|
+
optional :type, enum: -> { OpenAI::Realtime::RealtimeConversationItemAssistantMessage::Content::Type }
|
71
|
+
|
72
|
+
# @!method initialize(text: nil, type: nil)
|
73
|
+
# @param text [String] The text content.
|
74
|
+
#
|
75
|
+
# @param type [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Content::Type] The content type. Always `text` for assistant messages.
|
76
|
+
|
77
|
+
# The content type. Always `text` for assistant messages.
|
78
|
+
#
|
79
|
+
# @see OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Content#type
|
80
|
+
module Type
|
81
|
+
extend OpenAI::Internal::Type::Enum
|
82
|
+
|
83
|
+
TEXT = :text
|
84
|
+
|
85
|
+
# @!method self.values
|
86
|
+
# @return [Array<Symbol>]
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
# Identifier for the API object being returned - always `realtime.item`.
|
91
|
+
#
|
92
|
+
# @see OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage#object
|
93
|
+
module Object
|
94
|
+
extend OpenAI::Internal::Type::Enum
|
95
|
+
|
96
|
+
REALTIME_ITEM = :"realtime.item"
|
97
|
+
|
98
|
+
# @!method self.values
|
99
|
+
# @return [Array<Symbol>]
|
100
|
+
end
|
101
|
+
|
102
|
+
# The status of the item. Has no effect on the conversation.
|
103
|
+
#
|
104
|
+
# @see OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage#status
|
105
|
+
module Status
|
106
|
+
extend OpenAI::Internal::Type::Enum
|
107
|
+
|
108
|
+
COMPLETED = :completed
|
109
|
+
INCOMPLETE = :incomplete
|
110
|
+
IN_PROGRESS = :in_progress
|
111
|
+
|
112
|
+
# @!method self.values
|
113
|
+
# @return [Array<Symbol>]
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class RealtimeConversationItemFunctionCall < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute arguments
|
8
|
+
# The arguments of the function call.
|
9
|
+
#
|
10
|
+
# @return [String]
|
11
|
+
required :arguments, String
|
12
|
+
|
13
|
+
# @!attribute name
|
14
|
+
# The name of the function being called.
|
15
|
+
#
|
16
|
+
# @return [String]
|
17
|
+
required :name, String
|
18
|
+
|
19
|
+
# @!attribute type
|
20
|
+
# The type of the item. Always `function_call`.
|
21
|
+
#
|
22
|
+
# @return [Symbol, :function_call]
|
23
|
+
required :type, const: :function_call
|
24
|
+
|
25
|
+
# @!attribute id
|
26
|
+
# The unique ID of the item.
|
27
|
+
#
|
28
|
+
# @return [String, nil]
|
29
|
+
optional :id, String
|
30
|
+
|
31
|
+
# @!attribute call_id
|
32
|
+
# The ID of the function call.
|
33
|
+
#
|
34
|
+
# @return [String, nil]
|
35
|
+
optional :call_id, String
|
36
|
+
|
37
|
+
# @!attribute object
|
38
|
+
# Identifier for the API object being returned - always `realtime.item`.
|
39
|
+
#
|
40
|
+
# @return [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemFunctionCall::Object, nil]
|
41
|
+
optional :object, enum: -> { OpenAI::Realtime::RealtimeConversationItemFunctionCall::Object }
|
42
|
+
|
43
|
+
# @!attribute status
|
44
|
+
# The status of the item. Has no effect on the conversation.
|
45
|
+
#
|
46
|
+
# @return [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemFunctionCall::Status, nil]
|
47
|
+
optional :status, enum: -> { OpenAI::Realtime::RealtimeConversationItemFunctionCall::Status }
|
48
|
+
|
49
|
+
# @!method initialize(arguments:, name:, id: nil, call_id: nil, object: nil, status: nil, type: :function_call)
|
50
|
+
# A function call item in a Realtime conversation.
|
51
|
+
#
|
52
|
+
# @param arguments [String] The arguments of the function call.
|
53
|
+
#
|
54
|
+
# @param name [String] The name of the function being called.
|
55
|
+
#
|
56
|
+
# @param id [String] The unique ID of the item.
|
57
|
+
#
|
58
|
+
# @param call_id [String] The ID of the function call.
|
59
|
+
#
|
60
|
+
# @param object [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemFunctionCall::Object] Identifier for the API object being returned - always `realtime.item`.
|
61
|
+
#
|
62
|
+
# @param status [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemFunctionCall::Status] The status of the item. Has no effect on the conversation.
|
63
|
+
#
|
64
|
+
# @param type [Symbol, :function_call] The type of the item. Always `function_call`.
|
65
|
+
|
66
|
+
# Identifier for the API object being returned - always `realtime.item`.
|
67
|
+
#
|
68
|
+
# @see OpenAI::Models::Realtime::RealtimeConversationItemFunctionCall#object
|
69
|
+
module Object
|
70
|
+
extend OpenAI::Internal::Type::Enum
|
71
|
+
|
72
|
+
REALTIME_ITEM = :"realtime.item"
|
73
|
+
|
74
|
+
# @!method self.values
|
75
|
+
# @return [Array<Symbol>]
|
76
|
+
end
|
77
|
+
|
78
|
+
# The status of the item. Has no effect on the conversation.
|
79
|
+
#
|
80
|
+
# @see OpenAI::Models::Realtime::RealtimeConversationItemFunctionCall#status
|
81
|
+
module Status
|
82
|
+
extend OpenAI::Internal::Type::Enum
|
83
|
+
|
84
|
+
COMPLETED = :completed
|
85
|
+
INCOMPLETE = :incomplete
|
86
|
+
IN_PROGRESS = :in_progress
|
87
|
+
|
88
|
+
# @!method self.values
|
89
|
+
# @return [Array<Symbol>]
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class RealtimeConversationItemFunctionCallOutput < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute call_id
|
8
|
+
# The ID of the function call this output is for.
|
9
|
+
#
|
10
|
+
# @return [String]
|
11
|
+
required :call_id, String
|
12
|
+
|
13
|
+
# @!attribute output
|
14
|
+
# The output of the function call.
|
15
|
+
#
|
16
|
+
# @return [String]
|
17
|
+
required :output, String
|
18
|
+
|
19
|
+
# @!attribute type
|
20
|
+
# The type of the item. Always `function_call_output`.
|
21
|
+
#
|
22
|
+
# @return [Symbol, :function_call_output]
|
23
|
+
required :type, const: :function_call_output
|
24
|
+
|
25
|
+
# @!attribute id
|
26
|
+
# The unique ID of the item.
|
27
|
+
#
|
28
|
+
# @return [String, nil]
|
29
|
+
optional :id, String
|
30
|
+
|
31
|
+
# @!attribute object
|
32
|
+
# Identifier for the API object being returned - always `realtime.item`.
|
33
|
+
#
|
34
|
+
# @return [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemFunctionCallOutput::Object, nil]
|
35
|
+
optional :object, enum: -> { OpenAI::Realtime::RealtimeConversationItemFunctionCallOutput::Object }
|
36
|
+
|
37
|
+
# @!attribute status
|
38
|
+
# The status of the item. Has no effect on the conversation.
|
39
|
+
#
|
40
|
+
# @return [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemFunctionCallOutput::Status, nil]
|
41
|
+
optional :status, enum: -> { OpenAI::Realtime::RealtimeConversationItemFunctionCallOutput::Status }
|
42
|
+
|
43
|
+
# @!method initialize(call_id:, output:, id: nil, object: nil, status: nil, type: :function_call_output)
|
44
|
+
# A function call output item in a Realtime conversation.
|
45
|
+
#
|
46
|
+
# @param call_id [String] The ID of the function call this output is for.
|
47
|
+
#
|
48
|
+
# @param output [String] The output of the function call.
|
49
|
+
#
|
50
|
+
# @param id [String] The unique ID of the item.
|
51
|
+
#
|
52
|
+
# @param object [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemFunctionCallOutput::Object] Identifier for the API object being returned - always `realtime.item`.
|
53
|
+
#
|
54
|
+
# @param status [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemFunctionCallOutput::Status] The status of the item. Has no effect on the conversation.
|
55
|
+
#
|
56
|
+
# @param type [Symbol, :function_call_output] The type of the item. Always `function_call_output`.
|
57
|
+
|
58
|
+
# Identifier for the API object being returned - always `realtime.item`.
|
59
|
+
#
|
60
|
+
# @see OpenAI::Models::Realtime::RealtimeConversationItemFunctionCallOutput#object
|
61
|
+
module Object
|
62
|
+
extend OpenAI::Internal::Type::Enum
|
63
|
+
|
64
|
+
REALTIME_ITEM = :"realtime.item"
|
65
|
+
|
66
|
+
# @!method self.values
|
67
|
+
# @return [Array<Symbol>]
|
68
|
+
end
|
69
|
+
|
70
|
+
# The status of the item. Has no effect on the conversation.
|
71
|
+
#
|
72
|
+
# @see OpenAI::Models::Realtime::RealtimeConversationItemFunctionCallOutput#status
|
73
|
+
module Status
|
74
|
+
extend OpenAI::Internal::Type::Enum
|
75
|
+
|
76
|
+
COMPLETED = :completed
|
77
|
+
INCOMPLETE = :incomplete
|
78
|
+
IN_PROGRESS = :in_progress
|
79
|
+
|
80
|
+
# @!method self.values
|
81
|
+
# @return [Array<Symbol>]
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
@@ -0,0 +1,118 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Realtime
|
6
|
+
class RealtimeConversationItemSystemMessage < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute content
|
8
|
+
# The content of the message.
|
9
|
+
#
|
10
|
+
# @return [Array<OpenAI::Models::Realtime::RealtimeConversationItemSystemMessage::Content>]
|
11
|
+
required :content,
|
12
|
+
-> { OpenAI::Internal::Type::ArrayOf[OpenAI::Realtime::RealtimeConversationItemSystemMessage::Content] }
|
13
|
+
|
14
|
+
# @!attribute role
|
15
|
+
# The role of the message sender. Always `system`.
|
16
|
+
#
|
17
|
+
# @return [Symbol, :system]
|
18
|
+
required :role, const: :system
|
19
|
+
|
20
|
+
# @!attribute type
|
21
|
+
# The type of the item. Always `message`.
|
22
|
+
#
|
23
|
+
# @return [Symbol, :message]
|
24
|
+
required :type, const: :message
|
25
|
+
|
26
|
+
# @!attribute id
|
27
|
+
# The unique ID of the item.
|
28
|
+
#
|
29
|
+
# @return [String, nil]
|
30
|
+
optional :id, String
|
31
|
+
|
32
|
+
# @!attribute object
|
33
|
+
# Identifier for the API object being returned - always `realtime.item`.
|
34
|
+
#
|
35
|
+
# @return [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemSystemMessage::Object, nil]
|
36
|
+
optional :object, enum: -> { OpenAI::Realtime::RealtimeConversationItemSystemMessage::Object }
|
37
|
+
|
38
|
+
# @!attribute status
|
39
|
+
# The status of the item. Has no effect on the conversation.
|
40
|
+
#
|
41
|
+
# @return [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemSystemMessage::Status, nil]
|
42
|
+
optional :status, enum: -> { OpenAI::Realtime::RealtimeConversationItemSystemMessage::Status }
|
43
|
+
|
44
|
+
# @!method initialize(content:, id: nil, object: nil, status: nil, role: :system, type: :message)
|
45
|
+
# A system message item in a Realtime conversation.
|
46
|
+
#
|
47
|
+
# @param content [Array<OpenAI::Models::Realtime::RealtimeConversationItemSystemMessage::Content>] The content of the message.
|
48
|
+
#
|
49
|
+
# @param id [String] The unique ID of the item.
|
50
|
+
#
|
51
|
+
# @param object [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemSystemMessage::Object] Identifier for the API object being returned - always `realtime.item`.
|
52
|
+
#
|
53
|
+
# @param status [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemSystemMessage::Status] The status of the item. Has no effect on the conversation.
|
54
|
+
#
|
55
|
+
# @param role [Symbol, :system] The role of the message sender. Always `system`.
|
56
|
+
#
|
57
|
+
# @param type [Symbol, :message] The type of the item. Always `message`.
|
58
|
+
|
59
|
+
class Content < OpenAI::Internal::Type::BaseModel
|
60
|
+
# @!attribute text
|
61
|
+
# The text content.
|
62
|
+
#
|
63
|
+
# @return [String, nil]
|
64
|
+
optional :text, String
|
65
|
+
|
66
|
+
# @!attribute type
|
67
|
+
# The content type. Always `input_text` for system messages.
|
68
|
+
#
|
69
|
+
# @return [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemSystemMessage::Content::Type, nil]
|
70
|
+
optional :type, enum: -> { OpenAI::Realtime::RealtimeConversationItemSystemMessage::Content::Type }
|
71
|
+
|
72
|
+
# @!method initialize(text: nil, type: nil)
|
73
|
+
# @param text [String] The text content.
|
74
|
+
#
|
75
|
+
# @param type [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemSystemMessage::Content::Type] The content type. Always `input_text` for system messages.
|
76
|
+
|
77
|
+
# The content type. Always `input_text` for system messages.
|
78
|
+
#
|
79
|
+
# @see OpenAI::Models::Realtime::RealtimeConversationItemSystemMessage::Content#type
|
80
|
+
module Type
|
81
|
+
extend OpenAI::Internal::Type::Enum
|
82
|
+
|
83
|
+
INPUT_TEXT = :input_text
|
84
|
+
|
85
|
+
# @!method self.values
|
86
|
+
# @return [Array<Symbol>]
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
# Identifier for the API object being returned - always `realtime.item`.
|
91
|
+
#
|
92
|
+
# @see OpenAI::Models::Realtime::RealtimeConversationItemSystemMessage#object
|
93
|
+
module Object
|
94
|
+
extend OpenAI::Internal::Type::Enum
|
95
|
+
|
96
|
+
REALTIME_ITEM = :"realtime.item"
|
97
|
+
|
98
|
+
# @!method self.values
|
99
|
+
# @return [Array<Symbol>]
|
100
|
+
end
|
101
|
+
|
102
|
+
# The status of the item. Has no effect on the conversation.
|
103
|
+
#
|
104
|
+
# @see OpenAI::Models::Realtime::RealtimeConversationItemSystemMessage#status
|
105
|
+
module Status
|
106
|
+
extend OpenAI::Internal::Type::Enum
|
107
|
+
|
108
|
+
COMPLETED = :completed
|
109
|
+
INCOMPLETE = :incomplete
|
110
|
+
IN_PROGRESS = :in_progress
|
111
|
+
|
112
|
+
# @!method self.values
|
113
|
+
# @return [Array<Symbol>]
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|