openai 0.113.0 → 0.115.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 +54 -0
- data/README.md +17 -2
- data/docs/architecture/security-model.md +11 -16
- data/examples/responses/websocket_workflows.rb +78 -3
- data/lib/openai/auth/subject_token_providers/azure_managed_identity_token_provider.rb +10 -8
- data/lib/openai/auth/subject_token_providers/gcp_id_token_provider.rb +8 -7
- data/lib/openai/helpers/chat/tool_runner.rb +1 -1
- data/lib/openai/helpers/live/websocket.rb +31 -0
- data/lib/openai/helpers/realtime/connection.rb +33 -0
- data/lib/openai/helpers/realtime/connection_manager.rb +1 -0
- data/lib/openai/helpers/realtime/conversation_item_variant_resolver.rb +5 -0
- data/lib/openai/helpers/realtime/recovery.rb +5 -1
- data/lib/openai/helpers/realtime/translation.rb +5 -0
- data/lib/openai/helpers/realtime/transports/async_websocket.rb +19 -0
- data/lib/openai/helpers/responses_websocket/connection.rb +53 -15
- data/lib/openai/helpers/responses_websocket/connection_manager.rb +1 -0
- data/lib/openai/helpers/responses_websocket/connection_resources.rb +1 -1
- data/lib/openai/helpers/structured_output/response_parser.rb +1 -0
- data/lib/openai/helpers/structured_output.rb +58 -0
- data/lib/openai/helpers/websocket/connection_manager.rb +11 -0
- data/lib/openai/helpers/websocket/resource.rb +1 -0
- data/lib/openai/helpers/websocket/typed_connection.rb +1 -0
- data/lib/openai/internal/type/array_of.rb +1 -1
- data/lib/openai/internal/type/hash_of.rb +1 -1
- data/lib/openai/internal/type/request_parameters.rb +2 -1
- data/lib/openai/internal/type/union.rb +18 -6
- data/lib/openai/models/admin/organization/external_key.rb +169 -0
- data/lib/openai/models/admin/organization/external_key_create_params.rb +311 -0
- data/lib/openai/models/admin/organization/external_key_delete_params.rb +24 -0
- data/lib/openai/models/admin/organization/external_key_list_params.rb +69 -0
- data/lib/openai/models/admin/organization/external_key_retrieve_params.rb +24 -0
- data/lib/openai/models/admin/organization/external_key_validate_params.rb +24 -0
- data/lib/openai/models/admin/organization/external_key_validate_response.rb +20 -0
- data/lib/openai/models/audio/speech_model.rb +12 -0
- data/lib/openai/models/audio_model.rb +15 -0
- data/lib/openai/models/beta/agent.rb +49 -1
- data/lib/openai/models/beta/agent_create_params.rb +51 -1
- data/lib/openai/models/beta/agent_session.rb +75 -2
- data/lib/openai/models/beta/agent_update_params.rb +62 -1
- data/lib/openai/models/beta/agents/session_create_params.rb +94 -2
- data/lib/openai/models/beta/agents/session_list_params.rb +16 -1
- data/lib/openai/models/beta/agents/session_update_params.rb +50 -5
- data/lib/openai/models/beta/assistant_update_params.rb +18 -0
- data/lib/openai/models/beta/beta_response.rb +224 -1
- data/lib/openai/models/beta/beta_response_configuration_update_item.rb +64 -3
- data/lib/openai/models/beta/beta_response_configuration_update_item_param.rb +64 -4
- data/lib/openai/models/beta/beta_response_input_file.rb +9 -9
- data/lib/openai/models/beta/beta_response_input_file_content.rb +9 -9
- data/lib/openai/models/beta/beta_response_input_image.rb +9 -9
- data/lib/openai/models/beta/beta_response_input_image_content.rb +9 -9
- data/lib/openai/models/beta/beta_response_input_item.rb +2 -3
- data/lib/openai/models/beta/beta_response_input_text.rb +9 -9
- data/lib/openai/models/beta/beta_response_input_text_content.rb +9 -9
- data/lib/openai/models/beta/beta_response_item.rb +11 -11
- data/lib/openai/models/beta/beta_response_output_item.rb +9 -9
- data/lib/openai/models/beta/beta_response_tool_search_output_item_param.rb +6 -6
- data/lib/openai/models/beta/beta_responses_client_event.rb +20 -1
- data/lib/openai/models/beta/beta_tool.rb +6 -6
- data/lib/openai/models/beta/response_compact_params.rb +6 -0
- data/lib/openai/models/beta/response_create_params.rb +6 -0
- data/lib/openai/models/chat/chat_completion_content_part.rb +9 -9
- data/lib/openai/models/chat/chat_completion_content_part_image.rb +9 -9
- data/lib/openai/models/chat/chat_completion_content_part_input_audio.rb +9 -9
- data/lib/openai/models/chat/chat_completion_content_part_text.rb +9 -9
- data/lib/openai/models/chat_model.rb +6 -0
- data/lib/openai/models/conversations/computer_screenshot_content.rb +9 -9
- data/lib/openai/models/conversations/conversation_item.rb +2 -2
- data/lib/openai/models/image_edit_params.rb +46 -25
- data/lib/openai/models/live/fork_server_event.rb +43 -3
- data/lib/openai/models/live/server_event.rb +43 -3
- data/lib/openai/models/live/sideband_client_event.rb +40 -1
- data/lib/openai/models/live/sideband_server_event.rb +43 -3
- data/lib/openai/models/realtime/audio_transcription.rb +15 -0
- data/lib/openai/models/realtime/conversation_item_added.rb +2 -2
- data/lib/openai/models/realtime/conversation_item_create_event.rb +2 -2
- data/lib/openai/models/realtime/conversation_item_created_event.rb +2 -2
- data/lib/openai/models/realtime/conversation_item_done.rb +2 -2
- data/lib/openai/models/realtime/realtime_response.rb +2 -2
- data/lib/openai/models/realtime/realtime_response_create_params.rb +2 -2
- data/lib/openai/models/realtime/realtime_server_event.rb +2 -2
- data/lib/openai/models/realtime/realtime_session.rb +18 -0
- data/lib/openai/models/realtime/realtime_session_create_request.rb +18 -0
- data/lib/openai/models/realtime/realtime_session_create_response.rb +18 -0
- data/lib/openai/models/realtime/response_output_item_added_event.rb +2 -2
- data/lib/openai/models/realtime/response_output_item_done_event.rb +2 -2
- data/lib/openai/models/responses/response.rb +221 -1
- data/lib/openai/models/responses/response_compact_params.rb +6 -0
- data/lib/openai/models/responses/response_configuration_update_item.rb +50 -3
- data/lib/openai/models/responses/response_configuration_update_item_param.rb +50 -4
- data/lib/openai/models/responses/response_input_file.rb +9 -9
- data/lib/openai/models/responses/response_input_file_content.rb +9 -9
- data/lib/openai/models/responses/response_input_image.rb +9 -9
- data/lib/openai/models/responses/response_input_image_content.rb +9 -9
- data/lib/openai/models/responses/response_input_item.rb +2 -3
- data/lib/openai/models/responses/response_input_text.rb +9 -9
- data/lib/openai/models/responses/response_input_text_content.rb +9 -9
- data/lib/openai/models/responses/response_item.rb +2 -2
- data/lib/openai/models/responses/response_tool_search_output_item_param.rb +6 -6
- data/lib/openai/models/responses/responses_client_event.rb +14 -1
- data/lib/openai/models/responses/tool.rb +6 -6
- data/lib/openai/net_http_client.rb +6 -0
- data/lib/openai/providers/vertex.rb +0 -10
- data/lib/openai/resources/admin/organization/external_keys.rb +132 -0
- data/lib/openai/resources/admin/organization.rb +4 -0
- data/lib/openai/resources/audio/speech.rb +8 -0
- data/lib/openai/resources/audio/translations.rb +8 -0
- data/lib/openai/resources/beta/agents/sessions.rb +22 -6
- data/lib/openai/resources/beta/agents.rb +17 -2
- data/lib/openai/resources/images.rb +36 -18
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +8 -0
- data/rbi/openai/helpers/live/websocket.rbi +1 -12
- data/rbi/openai/helpers/realtime/connection.rbi +5 -0
- data/rbi/openai/helpers/realtime/transports/async_websocket.rbi +5 -0
- data/rbi/openai/helpers/responses_websocket/connection.rbi +7 -2
- data/rbi/openai/helpers/structured_output.rbi +10 -0
- data/rbi/openai/internal/type/array_of.rbi +1 -1
- data/rbi/openai/internal/type/hash_of.rbi +1 -1
- data/rbi/openai/internal/type/union.rbi +5 -0
- data/rbi/openai/models/admin/organization/external_key.rbi +301 -0
- data/rbi/openai/models/admin/organization/external_key_create_params.rbi +532 -0
- data/rbi/openai/models/admin/organization/external_key_delete_params.rbi +57 -0
- data/rbi/openai/models/admin/organization/external_key_list_params.rbi +129 -0
- data/rbi/openai/models/admin/organization/external_key_retrieve_params.rbi +57 -0
- data/rbi/openai/models/admin/organization/external_key_validate_params.rbi +57 -0
- data/rbi/openai/models/admin/organization/external_key_validate_response.rbi +50 -0
- data/rbi/openai/models/beta/agent.rbi +103 -1
- data/rbi/openai/models/beta/agent_create_params.rbi +109 -0
- data/rbi/openai/models/beta/agent_session.rbi +136 -3
- data/rbi/openai/models/beta/agent_update_params.rbi +120 -0
- data/rbi/openai/models/beta/agents/session_create_params.rbi +153 -0
- data/rbi/openai/models/beta/agents/session_list_params.rbi +19 -0
- data/rbi/openai/models/beta/agents/session_update_params.rbi +94 -6
- data/rbi/openai/models/beta/beta_response.rbi +394 -0
- data/rbi/openai/models/beta/beta_response_configuration_update_item.rbi +113 -3
- data/rbi/openai/models/beta/beta_response_configuration_update_item_param.rbi +125 -4
- data/rbi/openai/models/beta/beta_response_input_file.rbi +9 -9
- data/rbi/openai/models/beta/beta_response_input_file_content.rbi +9 -9
- data/rbi/openai/models/beta/beta_response_input_image.rbi +9 -9
- data/rbi/openai/models/beta/beta_response_input_image_content.rbi +9 -9
- data/rbi/openai/models/beta/beta_response_input_text.rbi +9 -9
- data/rbi/openai/models/beta/beta_response_input_text_content.rbi +9 -9
- data/rbi/openai/models/beta/beta_response_item.rbi +9 -9
- data/rbi/openai/models/beta/beta_response_output_item.rbi +9 -9
- data/rbi/openai/models/beta/beta_response_tool_search_output_item_param.rbi +6 -6
- data/rbi/openai/models/beta/beta_responses_client_event.rbi +17 -0
- data/rbi/openai/models/beta/beta_tool.rbi +6 -6
- data/rbi/openai/models/chat/chat_completion_content_part.rbi +9 -9
- data/rbi/openai/models/chat/chat_completion_content_part_image.rbi +9 -9
- data/rbi/openai/models/chat/chat_completion_content_part_input_audio.rbi +9 -9
- data/rbi/openai/models/chat/chat_completion_content_part_text.rbi +9 -9
- data/rbi/openai/models/conversations/computer_screenshot_content.rbi +9 -9
- data/rbi/openai/models/decision_create_params.rbi +4 -1
- data/rbi/openai/models/image_edit_params.rbi +49 -24
- data/rbi/openai/models/live/fork_server_event.rbi +65 -1
- data/rbi/openai/models/live/server_event.rbi +65 -1
- data/rbi/openai/models/live/sideband_client_event.rbi +60 -0
- data/rbi/openai/models/live/sideband_server_event.rbi +65 -1
- data/rbi/openai/models/realtime/conversation_item_added.rbi +6 -3
- data/rbi/openai/models/realtime/conversation_item_create_event.rbi +6 -3
- data/rbi/openai/models/realtime/conversation_item_created_event.rbi +6 -3
- data/rbi/openai/models/realtime/conversation_item_done.rbi +6 -3
- data/rbi/openai/models/realtime/realtime_response.rbi +8 -4
- data/rbi/openai/models/realtime/realtime_response_create_params.rbi +8 -4
- data/rbi/openai/models/realtime/realtime_server_event.rbi +6 -3
- data/rbi/openai/models/realtime/response_output_item_added_event.rbi +6 -3
- data/rbi/openai/models/realtime/response_output_item_done_event.rbi +6 -3
- data/rbi/openai/models/responses/response.rbi +394 -0
- data/rbi/openai/models/responses/response_configuration_update_item.rbi +76 -3
- data/rbi/openai/models/responses/response_configuration_update_item_param.rbi +74 -4
- data/rbi/openai/models/responses/response_input_file.rbi +9 -9
- data/rbi/openai/models/responses/response_input_file_content.rbi +9 -9
- data/rbi/openai/models/responses/response_input_image.rbi +9 -9
- data/rbi/openai/models/responses/response_input_image_content.rbi +9 -9
- data/rbi/openai/models/responses/response_input_text.rbi +9 -9
- data/rbi/openai/models/responses/response_input_text_content.rbi +9 -9
- data/rbi/openai/models/responses/response_tool_search_output_item_param.rbi +6 -6
- data/rbi/openai/models/responses/responses_client_event.rbi +17 -0
- data/rbi/openai/models/responses/tool.rbi +6 -6
- data/rbi/openai/net_http_client.rbi +5 -0
- data/rbi/openai/resources/admin/organization/external_keys.rbi +86 -0
- data/rbi/openai/resources/admin/organization.rbi +3 -0
- data/rbi/openai/resources/audio/speech.rbi +8 -0
- data/rbi/openai/resources/audio/translations.rbi +6 -0
- data/rbi/openai/resources/beta/agents/sessions.rbi +18 -2
- data/rbi/openai/resources/beta/agents.rbi +15 -0
- data/rbi/openai/resources/images.rbi +34 -16
- data/rbi/openai/resources/responses.rbi +2 -0
- data/realtime.md +6 -0
- data/responses-websocket.md +53 -0
- data/sig/openai/helpers/live/websocket.rbs +1 -9
- data/sig/openai/helpers/realtime/connection.rbs +3 -0
- data/sig/openai/helpers/realtime/transports/async_websocket.rbs +3 -0
- data/sig/openai/helpers/responses_websocket/connection.rbs +7 -1
- data/sig/openai/helpers/structured_output.rbs +9 -0
- data/sig/openai/internal/type/union.rbs +4 -0
- data/sig/openai/models/admin/organization/external_key.rbs +186 -0
- data/sig/openai/models/admin/organization/external_key_create_params.rbs +423 -0
- data/sig/openai/models/admin/organization/external_key_delete_params.rbs +27 -0
- data/sig/openai/models/admin/organization/external_key_list_params.rbs +81 -0
- data/sig/openai/models/admin/organization/external_key_retrieve_params.rbs +27 -0
- data/sig/openai/models/admin/organization/external_key_validate_params.rbs +27 -0
- data/sig/openai/models/admin/organization/external_key_validate_response.rbs +17 -0
- data/sig/openai/models/admin/organization/external_storage_create_params.rbs +72 -2
- data/sig/openai/models/audio/speech_create_params.rbs +15 -2
- data/sig/openai/models/audio/transcription_create_params.rbs +30 -2
- data/sig/openai/models/audio/voice_create_params.rbs +47 -2
- data/sig/openai/models/beta/agent.rbs +54 -2
- data/sig/openai/models/beta/agent_create_params.rbs +54 -0
- data/sig/openai/models/beta/agent_session.rbs +82 -3
- data/sig/openai/models/beta/agent_update_params.rbs +64 -0
- data/sig/openai/models/beta/agents/session_create_params.rbs +91 -0
- data/sig/openai/models/beta/agents/session_list_params.rbs +20 -0
- data/sig/openai/models/beta/agents/session_update_params.rbs +48 -6
- data/sig/openai/models/beta/assistant_create_params.rbs +5 -2
- data/sig/openai/models/beta/beta_response.rbs +223 -0
- data/sig/openai/models/beta/beta_response_configuration_update_item.rbs +58 -2
- data/sig/openai/models/beta/beta_response_configuration_update_item_param.rbs +58 -2
- data/sig/openai/models/beta/beta_response_input_file.rbs +9 -9
- data/sig/openai/models/beta/beta_response_input_file_content.rbs +6 -6
- data/sig/openai/models/beta/beta_response_input_image.rbs +9 -9
- data/sig/openai/models/beta/beta_response_input_image_content.rbs +6 -6
- data/sig/openai/models/beta/beta_response_input_text.rbs +9 -9
- data/sig/openai/models/beta/beta_response_input_text_content.rbs +6 -6
- data/sig/openai/models/beta/beta_response_item.rbs +9 -9
- data/sig/openai/models/beta/beta_response_output_item.rbs +9 -9
- data/sig/openai/models/beta/beta_response_tool_search_output_item_param.rbs +4 -4
- data/sig/openai/models/beta/beta_responses_client_event.rbs +17 -0
- data/sig/openai/models/beta/beta_tool.rbs +4 -4
- data/sig/openai/models/beta/response_create_params.rbs +5 -2
- data/sig/openai/models/beta/responses/input_token_count_params.rbs +10 -2
- data/sig/openai/models/beta/thread_create_and_run_params.rbs +11 -5
- data/sig/openai/models/beta/thread_create_params.rbs +11 -5
- data/sig/openai/models/beta/threads/message_create_params.rbs +6 -3
- data/sig/openai/models/beta/threads/run_create_params.rbs +6 -3
- data/sig/openai/models/chat/chat_completion_content_part.rbs +9 -9
- data/sig/openai/models/chat/chat_completion_content_part_image.rbs +9 -9
- data/sig/openai/models/chat/chat_completion_content_part_input_audio.rbs +9 -9
- data/sig/openai/models/chat/chat_completion_content_part_text.rbs +9 -9
- data/sig/openai/models/conversations/computer_screenshot_content.rbs +9 -9
- data/sig/openai/models/decision_create_params.rbs +27 -2
- data/sig/openai/models/eval_create_params.rbs +25 -4
- data/sig/openai/models/evals/run_create_params.rbs +52 -8
- data/sig/openai/models/image_edit_params.rbs +47 -16
- data/sig/openai/models/live/fork_server_event.rbs +39 -0
- data/sig/openai/models/live/server_event.rbs +39 -0
- data/sig/openai/models/live/session_accept_params.rbs +39 -2
- data/sig/openai/models/live/sideband_client_event.rbs +32 -0
- data/sig/openai/models/live/sideband_server_event.rbs +39 -0
- data/sig/openai/models/realtime/conversation_item.rbs +1 -0
- data/sig/openai/models/responses/input_token_count_params.rbs +10 -2
- data/sig/openai/models/responses/response.rbs +223 -0
- data/sig/openai/models/responses/response_configuration_update_item.rbs +45 -2
- data/sig/openai/models/responses/response_configuration_update_item_param.rbs +45 -2
- data/sig/openai/models/responses/response_create_params.rbs +5 -2
- data/sig/openai/models/responses/response_input_file.rbs +9 -9
- data/sig/openai/models/responses/response_input_file_content.rbs +6 -6
- data/sig/openai/models/responses/response_input_image.rbs +9 -9
- data/sig/openai/models/responses/response_input_image_content.rbs +6 -6
- data/sig/openai/models/responses/response_input_text.rbs +9 -9
- data/sig/openai/models/responses/response_input_text_content.rbs +6 -6
- data/sig/openai/models/responses/response_tool_search_output_item_param.rbs +4 -4
- data/sig/openai/models/responses/responses_client_event.rbs +17 -0
- data/sig/openai/models/responses/tool.rbs +4 -4
- data/sig/openai/models/video_edit_params.rbs +11 -2
- data/sig/openai/models/video_extend_params.rbs +11 -2
- data/sig/openai/net_http_client.rbs +3 -0
- data/sig/openai/resources/admin/organization/external_keys.rbs +70 -0
- data/sig/openai/resources/admin/organization/external_storage.rbs +23 -1
- data/sig/openai/resources/admin/organization.rbs +2 -0
- data/sig/openai/resources/audio/speech.rbs +2 -1
- data/sig/openai/resources/audio/transcriptions.rbs +14 -2
- data/sig/openai/resources/audio/voices.rbs +14 -1
- data/sig/openai/resources/beta/agents/sessions.rbs +4 -0
- data/sig/openai/resources/beta/agents.rbs +4 -0
- data/sig/openai/resources/beta/responses/input_tokens.rbs +2 -1
- data/sig/openai/resources/beta/responses.rbs +4 -2
- data/sig/openai/resources/decisions.rbs +7 -1
- data/sig/openai/resources/images.rbs +2 -0
- data/sig/openai/resources/responses/input_tokens.rbs +2 -1
- data/sig/openai/resources/responses.rbs +5 -2
- data/sig/openai/resources/videos.rbs +2 -2
- metadata +25 -1
|
@@ -26,9 +26,9 @@ module OpenAI
|
|
|
26
26
|
sig { returns(Symbol) }
|
|
27
27
|
attr_accessor :type
|
|
28
28
|
|
|
29
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
30
|
-
#
|
|
31
|
-
# token block.
|
|
29
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
30
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
31
|
+
# not rounded to a token block.
|
|
32
32
|
sig { returns(T.nilable(OpenAI::Chat::ChatCompletionContentPartImage::PromptCacheBreakpoint)) }
|
|
33
33
|
attr_reader :prompt_cache_breakpoint
|
|
34
34
|
|
|
@@ -55,9 +55,9 @@ module OpenAI
|
|
|
55
55
|
|
|
56
56
|
image_url:,
|
|
57
57
|
|
|
58
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
59
|
-
#
|
|
60
|
-
# token block.
|
|
58
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
59
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
60
|
+
# not rounded to a token block.
|
|
61
61
|
prompt_cache_breakpoint: nil,
|
|
62
62
|
|
|
63
63
|
# The type of the content part.
|
|
@@ -171,9 +171,9 @@ module OpenAI
|
|
|
171
171
|
sig { params(ttl: OpenAI::Chat::ChatCompletionContentPartImage::PromptCacheBreakpoint::Ttl::OrSymbol).void }
|
|
172
172
|
attr_writer :ttl
|
|
173
173
|
|
|
174
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
175
|
-
#
|
|
176
|
-
# token block.
|
|
174
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
175
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
176
|
+
# not rounded to a token block.
|
|
177
177
|
sig do
|
|
178
178
|
params(
|
|
179
179
|
|
|
@@ -26,9 +26,9 @@ module OpenAI
|
|
|
26
26
|
sig { returns(Symbol) }
|
|
27
27
|
attr_accessor :type
|
|
28
28
|
|
|
29
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
30
|
-
#
|
|
31
|
-
# token block.
|
|
29
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
30
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
31
|
+
# not rounded to a token block.
|
|
32
32
|
sig { returns(T.nilable(OpenAI::Chat::ChatCompletionContentPartInputAudio::PromptCacheBreakpoint)) }
|
|
33
33
|
attr_reader :prompt_cache_breakpoint
|
|
34
34
|
|
|
@@ -56,9 +56,9 @@ module OpenAI
|
|
|
56
56
|
|
|
57
57
|
input_audio:,
|
|
58
58
|
|
|
59
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
60
|
-
#
|
|
61
|
-
# token block.
|
|
59
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
60
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
61
|
+
# not rounded to a token block.
|
|
62
62
|
prompt_cache_breakpoint: nil,
|
|
63
63
|
|
|
64
64
|
# The type of the content part. Always `input_audio`.
|
|
@@ -168,9 +168,9 @@ module OpenAI
|
|
|
168
168
|
}
|
|
169
169
|
attr_writer :ttl
|
|
170
170
|
|
|
171
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
172
|
-
#
|
|
173
|
-
# token block.
|
|
171
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
172
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
173
|
+
# not rounded to a token block.
|
|
174
174
|
sig do
|
|
175
175
|
params(
|
|
176
176
|
|
|
@@ -24,9 +24,9 @@ module OpenAI
|
|
|
24
24
|
sig { returns(Symbol) }
|
|
25
25
|
attr_accessor :type
|
|
26
26
|
|
|
27
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
28
|
-
#
|
|
29
|
-
# token block.
|
|
27
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
28
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
29
|
+
# not rounded to a token block.
|
|
30
30
|
sig { returns(T.nilable(OpenAI::Chat::ChatCompletionContentPartText::PromptCacheBreakpoint)) }
|
|
31
31
|
attr_reader :prompt_cache_breakpoint
|
|
32
32
|
|
|
@@ -53,9 +53,9 @@ module OpenAI
|
|
|
53
53
|
# The text content.
|
|
54
54
|
text:,
|
|
55
55
|
|
|
56
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
57
|
-
#
|
|
58
|
-
# token block.
|
|
56
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
57
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
58
|
+
# not rounded to a token block.
|
|
59
59
|
prompt_cache_breakpoint: nil,
|
|
60
60
|
|
|
61
61
|
# The type of the content part.
|
|
@@ -95,9 +95,9 @@ module OpenAI
|
|
|
95
95
|
sig { params(ttl: OpenAI::Chat::ChatCompletionContentPartText::PromptCacheBreakpoint::Ttl::OrSymbol).void }
|
|
96
96
|
attr_writer :ttl
|
|
97
97
|
|
|
98
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
99
|
-
#
|
|
100
|
-
# token block.
|
|
98
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
99
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
100
|
+
# not rounded to a token block.
|
|
101
101
|
sig do
|
|
102
102
|
params(
|
|
103
103
|
|
|
@@ -32,9 +32,9 @@ module OpenAI
|
|
|
32
32
|
sig { returns(Symbol) }
|
|
33
33
|
attr_accessor :type
|
|
34
34
|
|
|
35
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
36
|
-
#
|
|
37
|
-
# token block.
|
|
35
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
36
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
37
|
+
# not rounded to a token block.
|
|
38
38
|
sig { returns(T.nilable(OpenAI::Conversations::ComputerScreenshotContent::PromptCacheBreakpoint)) }
|
|
39
39
|
attr_reader :prompt_cache_breakpoint
|
|
40
40
|
|
|
@@ -74,9 +74,9 @@ module OpenAI
|
|
|
74
74
|
# The URL of the screenshot image.
|
|
75
75
|
image_url:,
|
|
76
76
|
|
|
77
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
78
|
-
#
|
|
79
|
-
# token block.
|
|
77
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
78
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
79
|
+
# not rounded to a token block.
|
|
80
80
|
prompt_cache_breakpoint: nil,
|
|
81
81
|
|
|
82
82
|
# Specifies the event type. For a computer screenshot, this property is always set
|
|
@@ -143,9 +143,9 @@ module OpenAI
|
|
|
143
143
|
}
|
|
144
144
|
attr_writer :ttl
|
|
145
145
|
|
|
146
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
147
|
-
#
|
|
148
|
-
# token block.
|
|
146
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
147
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
148
|
+
# not rounded to a token block.
|
|
149
149
|
sig do
|
|
150
150
|
params(
|
|
151
151
|
|
|
@@ -160,7 +160,10 @@ module OpenAI
|
|
|
160
160
|
|
|
161
161
|
Variants = T.type_alias {
|
|
162
162
|
T.any(
|
|
163
|
-
|
|
163
|
+
T.any(
|
|
164
|
+
OpenAI::DecisionInputMessage::Variants,
|
|
165
|
+
OpenAI::DecisionCreateParams::Input::UnionMember1::DecisionInputUserMessage
|
|
166
|
+
),
|
|
164
167
|
OpenAI::DecisionCreateParams::Input::UnionMember1::DecisionInputDeveloperMessage,
|
|
165
168
|
OpenAI::DecisionCreateParams::Input::UnionMember1::DecisionInputSystemMessage,
|
|
166
169
|
OpenAI::DecisionCreateParams::Input::UnionMember1::DecisionInputAssistantMessage,
|
|
@@ -17,12 +17,12 @@ module OpenAI
|
|
|
17
17
|
|
|
18
18
|
# The image(s) to edit. Must be a supported image file or an array of images.
|
|
19
19
|
#
|
|
20
|
-
# For the GPT image models (`gpt-image-1`, `gpt-image-1
|
|
21
|
-
# `gpt-image-2
|
|
22
|
-
# `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
|
|
23
|
-
# `gpt-image-2.5-flare-2026-09-08
|
|
24
|
-
#
|
|
25
|
-
#
|
|
20
|
+
# For the GPT image models (`gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
|
|
21
|
+
# `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
|
|
22
|
+
# `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and
|
|
23
|
+
# `gpt-image-2.5-flare-2026-09-08`), each image should be a `png`, `webp`, or
|
|
24
|
+
# `jpg` file less than 50MB. You can provide up to 16 images.
|
|
25
|
+
# `chatgpt-image-latest` follows the same input constraints as GPT image models.
|
|
26
26
|
#
|
|
27
27
|
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
28
28
|
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
@@ -49,11 +49,24 @@ module OpenAI
|
|
|
49
49
|
|
|
50
50
|
# Control how much effort the model will exert to match the style and features,
|
|
51
51
|
# especially facial features, of input images. Supports `high` and `low` on
|
|
52
|
-
# `gpt-image-1
|
|
53
|
-
#
|
|
52
|
+
# `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
|
|
53
|
+
# this parameter. Defaults to `low` on supported models.
|
|
54
54
|
sig { returns(T.nilable(OpenAI::ImageEditParams::InputFidelity::OrSymbol)) }
|
|
55
55
|
attr_accessor :input_fidelity
|
|
56
56
|
|
|
57
|
+
# A transparent PNG overlaid on the first image to guide the edit. Must match that
|
|
58
|
+
# image's dimensions after orientation and contain transparent pixels. Supports
|
|
59
|
+
# GPT Image 2.5 and 2.6. Cannot be combined with mask.
|
|
60
|
+
#
|
|
61
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
62
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
63
|
+
# content type.
|
|
64
|
+
sig { returns(T.nilable(OpenAI::Internal::FileInput)) }
|
|
65
|
+
attr_reader :markup
|
|
66
|
+
|
|
67
|
+
sig { params(markup: OpenAI::Internal::FileInput).void }
|
|
68
|
+
attr_writer :markup
|
|
69
|
+
|
|
57
70
|
# An additional image whose fully transparent areas (e.g. where alpha is zero)
|
|
58
71
|
# indicate where `image` should be edited. If there are multiple images provided,
|
|
59
72
|
# the mask will be applied on the first image. Must be a valid PNG file, less than
|
|
@@ -160,6 +173,8 @@ module OpenAI
|
|
|
160
173
|
|
|
161
174
|
input_fidelity: T.nilable(OpenAI::ImageEditParams::InputFidelity::OrSymbol),
|
|
162
175
|
|
|
176
|
+
markup: OpenAI::Internal::FileInput,
|
|
177
|
+
|
|
163
178
|
mask: OpenAI::Internal::FileInput,
|
|
164
179
|
|
|
165
180
|
model: T.nilable(T.any(String, OpenAI::ImageModel::OrSymbol)),
|
|
@@ -190,12 +205,12 @@ module OpenAI
|
|
|
190
205
|
|
|
191
206
|
# The image(s) to edit. Must be a supported image file or an array of images.
|
|
192
207
|
#
|
|
193
|
-
# For the GPT image models (`gpt-image-1`, `gpt-image-1
|
|
194
|
-
# `gpt-image-2
|
|
195
|
-
# `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
|
|
196
|
-
# `gpt-image-2.5-flare-2026-09-08
|
|
197
|
-
#
|
|
198
|
-
#
|
|
208
|
+
# For the GPT image models (`gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
|
|
209
|
+
# `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
|
|
210
|
+
# `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and
|
|
211
|
+
# `gpt-image-2.5-flare-2026-09-08`), each image should be a `png`, `webp`, or
|
|
212
|
+
# `jpg` file less than 50MB. You can provide up to 16 images.
|
|
213
|
+
# `chatgpt-image-latest` follows the same input constraints as GPT image models.
|
|
199
214
|
#
|
|
200
215
|
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
201
216
|
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
@@ -219,10 +234,19 @@ module OpenAI
|
|
|
219
234
|
|
|
220
235
|
# Control how much effort the model will exert to match the style and features,
|
|
221
236
|
# especially facial features, of input images. Supports `high` and `low` on
|
|
222
|
-
# `gpt-image-1
|
|
223
|
-
#
|
|
237
|
+
# `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
|
|
238
|
+
# this parameter. Defaults to `low` on supported models.
|
|
224
239
|
input_fidelity: nil,
|
|
225
240
|
|
|
241
|
+
# A transparent PNG overlaid on the first image to guide the edit. Must match that
|
|
242
|
+
# image's dimensions after orientation and contain transparent pixels. Supports
|
|
243
|
+
# GPT Image 2.5 and 2.6. Cannot be combined with mask.
|
|
244
|
+
#
|
|
245
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
246
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
247
|
+
# content type.
|
|
248
|
+
markup: nil,
|
|
249
|
+
|
|
226
250
|
# An additional image whose fully transparent areas (e.g. where alpha is zero)
|
|
227
251
|
# indicate where `image` should be edited. If there are multiple images provided,
|
|
228
252
|
# the mask will be applied on the first image. Must be a valid PNG file, less than
|
|
@@ -312,6 +336,7 @@ module OpenAI
|
|
|
312
336
|
prompt: String,
|
|
313
337
|
background: T.nilable(OpenAI::ImageEditParams::Background::OrSymbol),
|
|
314
338
|
input_fidelity: T.nilable(OpenAI::ImageEditParams::InputFidelity::OrSymbol),
|
|
339
|
+
markup: OpenAI::Internal::FileInput,
|
|
315
340
|
mask: OpenAI::Internal::FileInput,
|
|
316
341
|
model: T.nilable(T.any(String, OpenAI::ImageModel::OrSymbol)),
|
|
317
342
|
n: T.nilable(Integer),
|
|
@@ -332,12 +357,12 @@ module OpenAI
|
|
|
332
357
|
|
|
333
358
|
# The image(s) to edit. Must be a supported image file or an array of images.
|
|
334
359
|
#
|
|
335
|
-
# For the GPT image models (`gpt-image-1`, `gpt-image-1
|
|
336
|
-
# `gpt-image-2
|
|
337
|
-
# `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
|
|
338
|
-
# `gpt-image-2.5-flare-2026-09-08
|
|
339
|
-
#
|
|
340
|
-
#
|
|
360
|
+
# For the GPT image models (`gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
|
|
361
|
+
# `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
|
|
362
|
+
# `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and
|
|
363
|
+
# `gpt-image-2.5-flare-2026-09-08`), each image should be a `png`, `webp`, or
|
|
364
|
+
# `jpg` file less than 50MB. You can provide up to 16 images.
|
|
365
|
+
# `chatgpt-image-latest` follows the same input constraints as GPT image models.
|
|
341
366
|
module Image
|
|
342
367
|
extend OpenAI::Internal::Type::Union
|
|
343
368
|
|
|
@@ -380,8 +405,8 @@ module OpenAI
|
|
|
380
405
|
|
|
381
406
|
# Control how much effort the model will exert to match the style and features,
|
|
382
407
|
# especially facial features, of input images. Supports `high` and `low` on
|
|
383
|
-
# `gpt-image-1
|
|
384
|
-
#
|
|
408
|
+
# `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
|
|
409
|
+
# this parameter. Defaults to `low` on supported models.
|
|
385
410
|
module InputFidelity
|
|
386
411
|
extend OpenAI::Internal::Type::Enum
|
|
387
412
|
|
|
@@ -39,6 +39,7 @@ module OpenAI
|
|
|
39
39
|
OpenAI::Live::InfoEvent,
|
|
40
40
|
OpenAI::Live::ForkServerEvent::TransportDtmfReceived,
|
|
41
41
|
OpenAI::Live::ForkServerEvent::TransportDtmfSend,
|
|
42
|
+
OpenAI::Live::ForkServerEvent::TransportDtmfSent,
|
|
42
43
|
OpenAI::Live::ForkServerEvent::TransportRinging,
|
|
43
44
|
OpenAI::Live::ForkServerEvent::TransportAnswered,
|
|
44
45
|
OpenAI::Live::ForkServerEvent::TransportFailed
|
|
@@ -171,6 +172,69 @@ module OpenAI
|
|
|
171
172
|
sig { params(client_event_id: String).void }
|
|
172
173
|
attr_writer :client_event_id
|
|
173
174
|
|
|
175
|
+
# Legacy SIP DTMF delivery notification retained for SDK compatibility and saved
|
|
176
|
+
# events. Current servers confirm delivery with transport.dtmf.sent;
|
|
177
|
+
# transport.dtmf.send is now the client command.
|
|
178
|
+
sig do
|
|
179
|
+
params(
|
|
180
|
+
|
|
181
|
+
event: String,
|
|
182
|
+
|
|
183
|
+
event_id: String,
|
|
184
|
+
|
|
185
|
+
client_event_id: String,
|
|
186
|
+
|
|
187
|
+
type: Symbol
|
|
188
|
+
)
|
|
189
|
+
.returns(T.attached_class)
|
|
190
|
+
end
|
|
191
|
+
def self.new(
|
|
192
|
+
|
|
193
|
+
event:,
|
|
194
|
+
|
|
195
|
+
event_id:,
|
|
196
|
+
|
|
197
|
+
# The event_id of the client command, when supplied.
|
|
198
|
+
client_event_id: nil,
|
|
199
|
+
|
|
200
|
+
type: :"transport.dtmf.send"
|
|
201
|
+
)
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
sig do
|
|
205
|
+
override.returns(
|
|
206
|
+
{event: String, event_id: String, type: Symbol, client_event_id: T.nilable(String)}
|
|
207
|
+
)
|
|
208
|
+
end
|
|
209
|
+
def to_hash
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
class TransportDtmfSent < OpenAI::Internal::Type::BaseModel
|
|
215
|
+
OrHash = T.type_alias do
|
|
216
|
+
T.any(
|
|
217
|
+
OpenAI::Live::ForkServerEvent::TransportDtmfSent,
|
|
218
|
+
OpenAI::Internal::AnyHash
|
|
219
|
+
)
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
sig { returns(String) }
|
|
223
|
+
attr_accessor :event
|
|
224
|
+
|
|
225
|
+
sig { returns(String) }
|
|
226
|
+
attr_accessor :event_id
|
|
227
|
+
|
|
228
|
+
sig { returns(Symbol) }
|
|
229
|
+
attr_accessor :type
|
|
230
|
+
|
|
231
|
+
# The event_id of the client command, when supplied.
|
|
232
|
+
sig { returns(T.nilable(String)) }
|
|
233
|
+
attr_reader :client_event_id
|
|
234
|
+
|
|
235
|
+
sig { params(client_event_id: String).void }
|
|
236
|
+
attr_writer :client_event_id
|
|
237
|
+
|
|
174
238
|
# A SIP DTMF keypress successfully sent to the SIP trunk. Delivered only to
|
|
175
239
|
# sideband observers; this is not a client command.
|
|
176
240
|
sig do
|
|
@@ -195,7 +259,7 @@ module OpenAI
|
|
|
195
259
|
# The event_id of the client command, when supplied.
|
|
196
260
|
client_event_id: nil,
|
|
197
261
|
|
|
198
|
-
type: :"transport.dtmf.
|
|
262
|
+
type: :"transport.dtmf.sent"
|
|
199
263
|
)
|
|
200
264
|
end
|
|
201
265
|
|
|
@@ -39,6 +39,7 @@ module OpenAI
|
|
|
39
39
|
OpenAI::Live::InfoEvent,
|
|
40
40
|
OpenAI::Live::ServerEvent::TransportDtmfReceived,
|
|
41
41
|
OpenAI::Live::ServerEvent::TransportDtmfSend,
|
|
42
|
+
OpenAI::Live::ServerEvent::TransportDtmfSent,
|
|
42
43
|
OpenAI::Live::ServerEvent::TransportRinging,
|
|
43
44
|
OpenAI::Live::ServerEvent::TransportAnswered,
|
|
44
45
|
OpenAI::Live::ServerEvent::TransportFailed
|
|
@@ -171,6 +172,69 @@ module OpenAI
|
|
|
171
172
|
sig { params(client_event_id: String).void }
|
|
172
173
|
attr_writer :client_event_id
|
|
173
174
|
|
|
175
|
+
# Legacy SIP DTMF delivery notification retained for SDK compatibility and saved
|
|
176
|
+
# events. Current servers confirm delivery with transport.dtmf.sent;
|
|
177
|
+
# transport.dtmf.send is now the client command.
|
|
178
|
+
sig do
|
|
179
|
+
params(
|
|
180
|
+
|
|
181
|
+
event: String,
|
|
182
|
+
|
|
183
|
+
event_id: String,
|
|
184
|
+
|
|
185
|
+
client_event_id: String,
|
|
186
|
+
|
|
187
|
+
type: Symbol
|
|
188
|
+
)
|
|
189
|
+
.returns(T.attached_class)
|
|
190
|
+
end
|
|
191
|
+
def self.new(
|
|
192
|
+
|
|
193
|
+
event:,
|
|
194
|
+
|
|
195
|
+
event_id:,
|
|
196
|
+
|
|
197
|
+
# The event_id of the client command, when supplied.
|
|
198
|
+
client_event_id: nil,
|
|
199
|
+
|
|
200
|
+
type: :"transport.dtmf.send"
|
|
201
|
+
)
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
sig do
|
|
205
|
+
override.returns(
|
|
206
|
+
{event: String, event_id: String, type: Symbol, client_event_id: T.nilable(String)}
|
|
207
|
+
)
|
|
208
|
+
end
|
|
209
|
+
def to_hash
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
class TransportDtmfSent < OpenAI::Internal::Type::BaseModel
|
|
215
|
+
OrHash = T.type_alias do
|
|
216
|
+
T.any(
|
|
217
|
+
OpenAI::Live::ServerEvent::TransportDtmfSent,
|
|
218
|
+
OpenAI::Internal::AnyHash
|
|
219
|
+
)
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
sig { returns(String) }
|
|
223
|
+
attr_accessor :event
|
|
224
|
+
|
|
225
|
+
sig { returns(String) }
|
|
226
|
+
attr_accessor :event_id
|
|
227
|
+
|
|
228
|
+
sig { returns(Symbol) }
|
|
229
|
+
attr_accessor :type
|
|
230
|
+
|
|
231
|
+
# The event_id of the client command, when supplied.
|
|
232
|
+
sig { returns(T.nilable(String)) }
|
|
233
|
+
attr_reader :client_event_id
|
|
234
|
+
|
|
235
|
+
sig { params(client_event_id: String).void }
|
|
236
|
+
attr_writer :client_event_id
|
|
237
|
+
|
|
174
238
|
# A SIP DTMF keypress successfully sent to the SIP trunk. Delivered only to
|
|
175
239
|
# sideband observers; this is not a client command.
|
|
176
240
|
sig do
|
|
@@ -195,7 +259,7 @@ module OpenAI
|
|
|
195
259
|
# The event_id of the client command, when supplied.
|
|
196
260
|
client_event_id: nil,
|
|
197
261
|
|
|
198
|
-
type: :"transport.dtmf.
|
|
262
|
+
type: :"transport.dtmf.sent"
|
|
199
263
|
)
|
|
200
264
|
end
|
|
201
265
|
|
|
@@ -16,6 +16,7 @@ module OpenAI
|
|
|
16
16
|
OpenAI::Live::InputAudioMuteEvent,
|
|
17
17
|
OpenAI::Live::InputAudioUnmuteEvent,
|
|
18
18
|
OpenAI::Live::OutputAudioFixturePlayEvent,
|
|
19
|
+
OpenAI::Live::SidebandClientEvent::TransportDtmfSend,
|
|
19
20
|
OpenAI::Live::InstructionsAppendEvent,
|
|
20
21
|
OpenAI::Live::ThinkingAppendEvent,
|
|
21
22
|
OpenAI::Live::CommentaryAppendEvent,
|
|
@@ -28,6 +29,65 @@ module OpenAI
|
|
|
28
29
|
)
|
|
29
30
|
end
|
|
30
31
|
|
|
32
|
+
class TransportDtmfSend < OpenAI::Internal::Type::BaseModel
|
|
33
|
+
OrHash = T.type_alias do
|
|
34
|
+
T.any(
|
|
35
|
+
OpenAI::Live::SidebandClientEvent::TransportDtmfSend,
|
|
36
|
+
OpenAI::Internal::AnyHash
|
|
37
|
+
)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# The DTMF key to send: one of `0`–`9`, `A`–`D`, `*`, or `#`.
|
|
41
|
+
sig { returns(String) }
|
|
42
|
+
attr_accessor :event
|
|
43
|
+
|
|
44
|
+
sig { returns(Symbol) }
|
|
45
|
+
attr_accessor :type
|
|
46
|
+
|
|
47
|
+
# Optional client identifier for correlating this command with a server event's
|
|
48
|
+
# client_event_id or error.client_event_id.
|
|
49
|
+
sig { returns(T.nilable(String)) }
|
|
50
|
+
attr_accessor :event_id
|
|
51
|
+
|
|
52
|
+
# Send one DTMF keypress to the SIP trunk through a Live sideband connection. This
|
|
53
|
+
# command is supported only for SIP calls. A successful send emits
|
|
54
|
+
# `transport.dtmf.sent` on sideband. If you provide `event_id`, the success
|
|
55
|
+
# notification includes it as `client_event_id`; a failure includes it as
|
|
56
|
+
# `error.client_event_id`. Send separate events for multiple keypresses.
|
|
57
|
+
sig do
|
|
58
|
+
params(
|
|
59
|
+
|
|
60
|
+
event: String,
|
|
61
|
+
|
|
62
|
+
event_id: T.nilable(String),
|
|
63
|
+
|
|
64
|
+
type: Symbol
|
|
65
|
+
)
|
|
66
|
+
.returns(T.attached_class)
|
|
67
|
+
end
|
|
68
|
+
def self.new(
|
|
69
|
+
|
|
70
|
+
# The DTMF key to send: one of `0`–`9`, `A`–`D`, `*`, or `#`.
|
|
71
|
+
event:,
|
|
72
|
+
|
|
73
|
+
# Optional client identifier for correlating this command with a server event's
|
|
74
|
+
# client_event_id or error.client_event_id.
|
|
75
|
+
event_id: nil,
|
|
76
|
+
|
|
77
|
+
type: :"transport.dtmf.send"
|
|
78
|
+
)
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
sig do
|
|
82
|
+
override.returns(
|
|
83
|
+
{event: String, type: Symbol, event_id: T.nilable(String)}
|
|
84
|
+
)
|
|
85
|
+
end
|
|
86
|
+
def to_hash
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
end
|
|
90
|
+
|
|
31
91
|
sig { override.returns(T::Array[OpenAI::Live::SidebandClientEvent::Variants]) }
|
|
32
92
|
def self.variants
|
|
33
93
|
end
|
|
@@ -36,6 +36,7 @@ module OpenAI
|
|
|
36
36
|
OpenAI::Live::OutputAudioDeltaEvent,
|
|
37
37
|
OpenAI::Live::SidebandServerEvent::TransportDtmfReceived,
|
|
38
38
|
OpenAI::Live::SidebandServerEvent::TransportDtmfSend,
|
|
39
|
+
OpenAI::Live::SidebandServerEvent::TransportDtmfSent,
|
|
39
40
|
OpenAI::Live::SidebandServerEvent::TransportRinging,
|
|
40
41
|
OpenAI::Live::SidebandServerEvent::TransportAnswered,
|
|
41
42
|
OpenAI::Live::SidebandServerEvent::TransportFailed
|
|
@@ -168,6 +169,69 @@ module OpenAI
|
|
|
168
169
|
sig { params(client_event_id: String).void }
|
|
169
170
|
attr_writer :client_event_id
|
|
170
171
|
|
|
172
|
+
# Legacy SIP DTMF delivery notification retained for SDK compatibility and saved
|
|
173
|
+
# events. Current servers confirm delivery with transport.dtmf.sent;
|
|
174
|
+
# transport.dtmf.send is now the client command.
|
|
175
|
+
sig do
|
|
176
|
+
params(
|
|
177
|
+
|
|
178
|
+
event: String,
|
|
179
|
+
|
|
180
|
+
event_id: String,
|
|
181
|
+
|
|
182
|
+
client_event_id: String,
|
|
183
|
+
|
|
184
|
+
type: Symbol
|
|
185
|
+
)
|
|
186
|
+
.returns(T.attached_class)
|
|
187
|
+
end
|
|
188
|
+
def self.new(
|
|
189
|
+
|
|
190
|
+
event:,
|
|
191
|
+
|
|
192
|
+
event_id:,
|
|
193
|
+
|
|
194
|
+
# The event_id of the client command, when supplied.
|
|
195
|
+
client_event_id: nil,
|
|
196
|
+
|
|
197
|
+
type: :"transport.dtmf.send"
|
|
198
|
+
)
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
sig do
|
|
202
|
+
override.returns(
|
|
203
|
+
{event: String, event_id: String, type: Symbol, client_event_id: T.nilable(String)}
|
|
204
|
+
)
|
|
205
|
+
end
|
|
206
|
+
def to_hash
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
class TransportDtmfSent < OpenAI::Internal::Type::BaseModel
|
|
212
|
+
OrHash = T.type_alias do
|
|
213
|
+
T.any(
|
|
214
|
+
OpenAI::Live::SidebandServerEvent::TransportDtmfSent,
|
|
215
|
+
OpenAI::Internal::AnyHash
|
|
216
|
+
)
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
sig { returns(String) }
|
|
220
|
+
attr_accessor :event
|
|
221
|
+
|
|
222
|
+
sig { returns(String) }
|
|
223
|
+
attr_accessor :event_id
|
|
224
|
+
|
|
225
|
+
sig { returns(Symbol) }
|
|
226
|
+
attr_accessor :type
|
|
227
|
+
|
|
228
|
+
# The event_id of the client command, when supplied.
|
|
229
|
+
sig { returns(T.nilable(String)) }
|
|
230
|
+
attr_reader :client_event_id
|
|
231
|
+
|
|
232
|
+
sig { params(client_event_id: String).void }
|
|
233
|
+
attr_writer :client_event_id
|
|
234
|
+
|
|
171
235
|
# A SIP DTMF keypress successfully sent to the SIP trunk. Delivered only to
|
|
172
236
|
# sideband observers; this is not a client command.
|
|
173
237
|
sig do
|
|
@@ -192,7 +256,7 @@ module OpenAI
|
|
|
192
256
|
# The event_id of the client command, when supplied.
|
|
193
257
|
client_event_id: nil,
|
|
194
258
|
|
|
195
|
-
type: :"transport.dtmf.
|
|
259
|
+
type: :"transport.dtmf.sent"
|
|
196
260
|
)
|
|
197
261
|
end
|
|
198
262
|
|
|
@@ -30,7 +30,8 @@ module OpenAI
|
|
|
30
30
|
OpenAI::Realtime::RealtimeMcpApprovalResponse,
|
|
31
31
|
OpenAI::Realtime::RealtimeMcpListTools,
|
|
32
32
|
OpenAI::Realtime::RealtimeMcpToolCall,
|
|
33
|
-
OpenAI::Realtime::RealtimeMcpApprovalRequest
|
|
33
|
+
OpenAI::Realtime::RealtimeMcpApprovalRequest,
|
|
34
|
+
OpenAI::Realtime::ConversationItemWithReference
|
|
34
35
|
)
|
|
35
36
|
)
|
|
36
37
|
}
|
|
@@ -73,7 +74,8 @@ module OpenAI
|
|
|
73
74
|
OpenAI::Realtime::RealtimeMcpApprovalResponse::OrHash,
|
|
74
75
|
OpenAI::Realtime::RealtimeMcpListTools::OrHash,
|
|
75
76
|
OpenAI::Realtime::RealtimeMcpToolCall::OrHash,
|
|
76
|
-
OpenAI::Realtime::RealtimeMcpApprovalRequest::OrHash
|
|
77
|
+
OpenAI::Realtime::RealtimeMcpApprovalRequest::OrHash,
|
|
78
|
+
OpenAI::Realtime::ConversationItemWithReference::OrHash
|
|
77
79
|
),
|
|
78
80
|
|
|
79
81
|
previous_item_id: T.nilable(String),
|
|
@@ -113,7 +115,8 @@ module OpenAI
|
|
|
113
115
|
OpenAI::Realtime::RealtimeMcpApprovalResponse,
|
|
114
116
|
OpenAI::Realtime::RealtimeMcpListTools,
|
|
115
117
|
OpenAI::Realtime::RealtimeMcpToolCall,
|
|
116
|
-
OpenAI::Realtime::RealtimeMcpApprovalRequest
|
|
118
|
+
OpenAI::Realtime::RealtimeMcpApprovalRequest,
|
|
119
|
+
OpenAI::Realtime::ConversationItemWithReference
|
|
117
120
|
),
|
|
118
121
|
type: Symbol,
|
|
119
122
|
previous_item_id: T.nilable(String)
|