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
|
@@ -45,9 +45,9 @@ module OpenAI
|
|
|
45
45
|
optional :filename, String, nil?: true
|
|
46
46
|
|
|
47
47
|
# @!attribute prompt_cache_breakpoint
|
|
48
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
49
|
-
#
|
|
50
|
-
# token block.
|
|
48
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
49
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
50
|
+
# not rounded to a token block.
|
|
51
51
|
#
|
|
52
52
|
# @return [OpenAI::Models::Responses::ResponseInputFileContent::PromptCacheBreakpoint, nil]
|
|
53
53
|
optional(
|
|
@@ -79,9 +79,9 @@ module OpenAI
|
|
|
79
79
|
# The name of the file to be sent to the model.
|
|
80
80
|
#
|
|
81
81
|
# @param prompt_cache_breakpoint [OpenAI::Models::Responses::ResponseInputFileContent::PromptCacheBreakpoint, nil]
|
|
82
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
83
|
-
#
|
|
84
|
-
# token block.
|
|
82
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
83
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
84
|
+
# not rounded to a token block.
|
|
85
85
|
#
|
|
86
86
|
# @param type [Symbol, :input_file]
|
|
87
87
|
# The type of the input item. Always `input_file`.
|
|
@@ -119,9 +119,9 @@ module OpenAI
|
|
|
119
119
|
optional :ttl, enum: -> { OpenAI::Responses::ResponseInputFileContent::PromptCacheBreakpoint::Ttl }
|
|
120
120
|
|
|
121
121
|
# @!method initialize(ttl: nil, mode: :explicit)
|
|
122
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
123
|
-
#
|
|
124
|
-
# token block.
|
|
122
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
123
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
124
|
+
# not rounded to a token block.
|
|
125
125
|
#
|
|
126
126
|
# @param ttl [Symbol, OpenAI::Models::Responses::ResponseInputFileContent::PromptCacheBreakpoint::Ttl]
|
|
127
127
|
# The minimum lifetime of this cache breakpoint. Defaults to the request TTL.
|
|
@@ -31,9 +31,9 @@ module OpenAI
|
|
|
31
31
|
optional :image_url, String, nil?: true
|
|
32
32
|
|
|
33
33
|
# @!attribute prompt_cache_breakpoint
|
|
34
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
35
|
-
#
|
|
36
|
-
# token block.
|
|
34
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
35
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
36
|
+
# not rounded to a token block.
|
|
37
37
|
#
|
|
38
38
|
# @return [OpenAI::Models::Responses::ResponseInputImage::PromptCacheBreakpoint, nil]
|
|
39
39
|
optional :prompt_cache_breakpoint, -> { OpenAI::Responses::ResponseInputImage::PromptCacheBreakpoint }
|
|
@@ -54,9 +54,9 @@ module OpenAI
|
|
|
54
54
|
# encoded image in a data URL.
|
|
55
55
|
#
|
|
56
56
|
# @param prompt_cache_breakpoint [OpenAI::Models::Responses::ResponseInputImage::PromptCacheBreakpoint]
|
|
57
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
58
|
-
#
|
|
59
|
-
# token block.
|
|
57
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
58
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
59
|
+
# not rounded to a token block.
|
|
60
60
|
#
|
|
61
61
|
# @param type [Symbol, :input_image]
|
|
62
62
|
# The type of the input item. Always `input_image`.
|
|
@@ -92,9 +92,9 @@ module OpenAI
|
|
|
92
92
|
optional :ttl, enum: -> { OpenAI::Responses::ResponseInputImage::PromptCacheBreakpoint::Ttl }
|
|
93
93
|
|
|
94
94
|
# @!method initialize(ttl: nil, mode: :explicit)
|
|
95
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
96
|
-
#
|
|
97
|
-
# token block.
|
|
95
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
96
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
97
|
+
# not rounded to a token block.
|
|
98
98
|
#
|
|
99
99
|
# @param ttl [Symbol, OpenAI::Models::Responses::ResponseInputImage::PromptCacheBreakpoint::Ttl]
|
|
100
100
|
# The minimum lifetime of this cache breakpoint. Defaults to the request TTL.
|
|
@@ -31,9 +31,9 @@ module OpenAI
|
|
|
31
31
|
optional :image_url, String, nil?: true
|
|
32
32
|
|
|
33
33
|
# @!attribute prompt_cache_breakpoint
|
|
34
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
35
|
-
#
|
|
36
|
-
# token block.
|
|
34
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
35
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
36
|
+
# not rounded to a token block.
|
|
37
37
|
#
|
|
38
38
|
# @return [OpenAI::Models::Responses::ResponseInputImageContent::PromptCacheBreakpoint, nil]
|
|
39
39
|
optional(
|
|
@@ -58,9 +58,9 @@ module OpenAI
|
|
|
58
58
|
# encoded image in a data URL.
|
|
59
59
|
#
|
|
60
60
|
# @param prompt_cache_breakpoint [OpenAI::Models::Responses::ResponseInputImageContent::PromptCacheBreakpoint, nil]
|
|
61
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
62
|
-
#
|
|
63
|
-
# token block.
|
|
61
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
62
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
63
|
+
# not rounded to a token block.
|
|
64
64
|
#
|
|
65
65
|
# @param type [Symbol, :input_image]
|
|
66
66
|
# The type of the input item. Always `input_image`.
|
|
@@ -96,9 +96,9 @@ module OpenAI
|
|
|
96
96
|
optional :ttl, enum: -> { OpenAI::Responses::ResponseInputImageContent::PromptCacheBreakpoint::Ttl }
|
|
97
97
|
|
|
98
98
|
# @!method initialize(ttl: nil, mode: :explicit)
|
|
99
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
100
|
-
#
|
|
101
|
-
# token block.
|
|
99
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
100
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
101
|
+
# not rounded to a token block.
|
|
102
102
|
#
|
|
103
103
|
# @param ttl [Symbol, OpenAI::Models::Responses::ResponseInputImageContent::PromptCacheBreakpoint::Ttl]
|
|
104
104
|
# The minimum lifetime of this cache breakpoint. Defaults to the request TTL.
|
|
@@ -56,9 +56,8 @@ module OpenAI
|
|
|
56
56
|
|
|
57
57
|
variant :additional_tools, -> { OpenAI::Responses::ResponseInputItem::AdditionalTools }
|
|
58
58
|
|
|
59
|
-
# An update to the conversation's response configuration.
|
|
60
|
-
#
|
|
61
|
-
# configuration update.
|
|
59
|
+
# An update to the conversation's response configuration. Supply reasoning,
|
|
60
|
+
# text, or both. Each setting stays in effect until a later update replaces it.
|
|
62
61
|
variant :configuration_update, -> { OpenAI::Responses::ResponseConfigurationUpdateItemParam }
|
|
63
62
|
|
|
64
63
|
# A description of the chain of thought used by a reasoning model while generating
|
|
@@ -17,9 +17,9 @@ module OpenAI
|
|
|
17
17
|
required :type, const: :input_text
|
|
18
18
|
|
|
19
19
|
# @!attribute prompt_cache_breakpoint
|
|
20
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
21
|
-
#
|
|
22
|
-
# token block.
|
|
20
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
21
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
22
|
+
# not rounded to a token block.
|
|
23
23
|
#
|
|
24
24
|
# @return [OpenAI::Models::Responses::ResponseInputText::PromptCacheBreakpoint, nil]
|
|
25
25
|
optional :prompt_cache_breakpoint, -> { OpenAI::Responses::ResponseInputText::PromptCacheBreakpoint }
|
|
@@ -31,9 +31,9 @@ module OpenAI
|
|
|
31
31
|
# The text input to the model.
|
|
32
32
|
#
|
|
33
33
|
# @param prompt_cache_breakpoint [OpenAI::Models::Responses::ResponseInputText::PromptCacheBreakpoint]
|
|
34
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
35
|
-
#
|
|
36
|
-
# token block.
|
|
34
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
35
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
36
|
+
# not rounded to a token block.
|
|
37
37
|
#
|
|
38
38
|
# @param type [Symbol, :input_text]
|
|
39
39
|
# The type of the input item. Always `input_text`.
|
|
@@ -53,9 +53,9 @@ module OpenAI
|
|
|
53
53
|
optional :ttl, enum: -> { OpenAI::Responses::ResponseInputText::PromptCacheBreakpoint::Ttl }
|
|
54
54
|
|
|
55
55
|
# @!method initialize(ttl: nil, mode: :explicit)
|
|
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
|
#
|
|
60
60
|
# @param ttl [Symbol, OpenAI::Models::Responses::ResponseInputText::PromptCacheBreakpoint::Ttl]
|
|
61
61
|
# The minimum lifetime of this cache breakpoint. Defaults to the request TTL.
|
|
@@ -17,9 +17,9 @@ module OpenAI
|
|
|
17
17
|
required :type, const: :input_text
|
|
18
18
|
|
|
19
19
|
# @!attribute prompt_cache_breakpoint
|
|
20
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
21
|
-
#
|
|
22
|
-
# token block.
|
|
20
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
21
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
22
|
+
# not rounded to a token block.
|
|
23
23
|
#
|
|
24
24
|
# @return [OpenAI::Models::Responses::ResponseInputTextContent::PromptCacheBreakpoint, nil]
|
|
25
25
|
optional(
|
|
@@ -35,9 +35,9 @@ module OpenAI
|
|
|
35
35
|
# The text input to the model.
|
|
36
36
|
#
|
|
37
37
|
# @param prompt_cache_breakpoint [OpenAI::Models::Responses::ResponseInputTextContent::PromptCacheBreakpoint, nil]
|
|
38
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
39
|
-
#
|
|
40
|
-
# token block.
|
|
38
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
39
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
40
|
+
# not rounded to a token block.
|
|
41
41
|
#
|
|
42
42
|
# @param type [Symbol, :input_text]
|
|
43
43
|
# The type of the input item. Always `input_text`.
|
|
@@ -57,9 +57,9 @@ module OpenAI
|
|
|
57
57
|
optional :ttl, enum: -> { OpenAI::Responses::ResponseInputTextContent::PromptCacheBreakpoint::Ttl }
|
|
58
58
|
|
|
59
59
|
# @!method initialize(ttl: nil, mode: :explicit)
|
|
60
|
-
# Marks the exact end of a reusable prompt prefix.
|
|
61
|
-
#
|
|
62
|
-
# token block.
|
|
60
|
+
# Marks the exact end of a reusable prompt prefix. When `ttl` is omitted, the
|
|
61
|
+
# breakpoint inherits the request's `prompt_cache_options.ttl`; the boundary is
|
|
62
|
+
# not rounded to a token block.
|
|
63
63
|
#
|
|
64
64
|
# @param ttl [Symbol, OpenAI::Models::Responses::ResponseInputTextContent::PromptCacheBreakpoint::Ttl]
|
|
65
65
|
# The minimum lifetime of this cache breakpoint. Defaults to the request TTL.
|
|
@@ -40,8 +40,8 @@ module OpenAI
|
|
|
40
40
|
|
|
41
41
|
variant :additional_tools, -> { OpenAI::Responses::ResponseItem::AdditionalTools }
|
|
42
42
|
|
|
43
|
-
# A configuration update
|
|
44
|
-
#
|
|
43
|
+
# A configuration update for subsequent responses. Each setting stays in effect
|
|
44
|
+
# until a later update replaces that setting.
|
|
45
45
|
variant :configuration_update, -> { OpenAI::Responses::ResponseConfigurationUpdateItem }
|
|
46
46
|
|
|
47
47
|
# A description of the chain of thought used by a reasoning model while generating
|
|
@@ -755,8 +755,8 @@ module OpenAI
|
|
|
755
755
|
# @!attribute input_fidelity
|
|
756
756
|
# Control how much effort the model will exert to match the style and features,
|
|
757
757
|
# especially facial features, of input images. Supports `high` and `low` on
|
|
758
|
-
# `gpt-image-1
|
|
759
|
-
#
|
|
758
|
+
# `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
|
|
759
|
+
# this parameter. Defaults to `low` on supported models.
|
|
760
760
|
#
|
|
761
761
|
# @return [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::InputFidelity, nil]
|
|
762
762
|
optional(
|
|
@@ -875,8 +875,8 @@ module OpenAI
|
|
|
875
875
|
# @param input_fidelity [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::InputFidelity, nil]
|
|
876
876
|
# Control how much effort the model will exert to match the style and features,
|
|
877
877
|
# especially facial features, of input images. Supports `high` and `low` on
|
|
878
|
-
# `gpt-image-1
|
|
879
|
-
#
|
|
878
|
+
# `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
|
|
879
|
+
# this parameter. Defaults to `low` on supported models.
|
|
880
880
|
#
|
|
881
881
|
# @param input_image_mask [OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::InputImageMask]
|
|
882
882
|
# Optional mask for inpainting. Contains `image_url` (string, optional) and
|
|
@@ -965,8 +965,8 @@ module OpenAI
|
|
|
965
965
|
|
|
966
966
|
# Control how much effort the model will exert to match the style and features,
|
|
967
967
|
# especially facial features, of input images. Supports `high` and `low` on
|
|
968
|
-
# `gpt-image-1
|
|
969
|
-
#
|
|
968
|
+
# `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
|
|
969
|
+
# this parameter. Defaults to `low` on supported models.
|
|
970
970
|
#
|
|
971
971
|
# @see OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration#input_fidelity
|
|
972
972
|
module InputFidelity
|
|
@@ -96,6 +96,14 @@ module OpenAI
|
|
|
96
96
|
nil?: true
|
|
97
97
|
)
|
|
98
98
|
|
|
99
|
+
# @!attribute generate
|
|
100
|
+
# Whether to generate output for this response. Defaults to true when omitted. Set
|
|
101
|
+
# to false to prepare request state without model output; the response ID can be
|
|
102
|
+
# used as previous_response_id on a later turn.
|
|
103
|
+
#
|
|
104
|
+
# @return [Boolean, nil]
|
|
105
|
+
optional :generate, OpenAI::Internal::Type::Boolean
|
|
106
|
+
|
|
99
107
|
# @!attribute include
|
|
100
108
|
# Specify additional output data to include in the model response. Currently
|
|
101
109
|
# supported values are:
|
|
@@ -463,7 +471,7 @@ module OpenAI
|
|
|
463
471
|
# @return [String, nil]
|
|
464
472
|
optional :user, String
|
|
465
473
|
|
|
466
|
-
# @!method initialize(access_programs: nil, background: nil, context_management: nil, conversation: nil, include: nil, input: nil, instructions: nil, max_output_tokens: nil, max_tool_calls: nil, metadata: nil, model: nil, moderation: nil, parallel_tool_calls: nil, previous_response_id: nil, prompt: nil, prompt_cache_key: nil, prompt_cache_options: nil, prompt_cache_retention: nil, reasoning: nil, safety_identifier: nil, service_tier: nil, store: nil, stream: nil, stream_id: nil, stream_options: nil, temperature: nil, text: nil, tool_choice: nil, tools: nil, top_logprobs: nil, top_p: nil, truncation: nil, user: nil, type: :"response.create")
|
|
474
|
+
# @!method initialize(access_programs: nil, background: nil, context_management: nil, conversation: nil, generate: nil, include: nil, input: nil, instructions: nil, max_output_tokens: nil, max_tool_calls: nil, metadata: nil, model: nil, moderation: nil, parallel_tool_calls: nil, previous_response_id: nil, prompt: nil, prompt_cache_key: nil, prompt_cache_options: nil, prompt_cache_retention: nil, reasoning: nil, safety_identifier: nil, service_tier: nil, store: nil, stream: nil, stream_id: nil, stream_options: nil, temperature: nil, text: nil, tool_choice: nil, tools: nil, top_logprobs: nil, top_p: nil, truncation: nil, user: nil, type: :"response.create")
|
|
467
475
|
# Client event for creating a response over a persistent WebSocket connection.
|
|
468
476
|
# This payload uses the same top-level fields as `POST /v1/responses`, plus
|
|
469
477
|
# WebSocket-only envelope metadata.
|
|
@@ -490,6 +498,11 @@ module OpenAI
|
|
|
490
498
|
# items from this response are automatically added to this conversation after this
|
|
491
499
|
# response completes.
|
|
492
500
|
#
|
|
501
|
+
# @param generate [Boolean]
|
|
502
|
+
# Whether to generate output for this response. Defaults to true when omitted. Set
|
|
503
|
+
# to false to prepare request state without model output; the response ID can be
|
|
504
|
+
# used as previous_response_id on a later turn.
|
|
505
|
+
#
|
|
493
506
|
# @param include [Array<Symbol, OpenAI::Models::Responses::ResponseIncludable>, nil]
|
|
494
507
|
# Specify additional output data to include in the model response. Currently
|
|
495
508
|
# supported values are:
|
|
@@ -636,8 +636,8 @@ module OpenAI
|
|
|
636
636
|
# @!attribute input_fidelity
|
|
637
637
|
# Control how much effort the model will exert to match the style and features,
|
|
638
638
|
# especially facial features, of input images. Supports `high` and `low` on
|
|
639
|
-
# `gpt-image-1
|
|
640
|
-
#
|
|
639
|
+
# `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
|
|
640
|
+
# this parameter. Defaults to `low` on supported models.
|
|
641
641
|
#
|
|
642
642
|
# @return [Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::InputFidelity, nil]
|
|
643
643
|
optional(
|
|
@@ -738,8 +738,8 @@ module OpenAI
|
|
|
738
738
|
# @param input_fidelity [Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::InputFidelity, nil]
|
|
739
739
|
# Control how much effort the model will exert to match the style and features,
|
|
740
740
|
# especially facial features, of input images. Supports `high` and `low` on
|
|
741
|
-
# `gpt-image-1
|
|
742
|
-
#
|
|
741
|
+
# `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
|
|
742
|
+
# this parameter. Defaults to `low` on supported models.
|
|
743
743
|
#
|
|
744
744
|
# @param input_image_mask [OpenAI::Models::Responses::Tool::ImageGeneration::InputImageMask]
|
|
745
745
|
# Optional mask for inpainting. Contains `image_url` (string, optional) and
|
|
@@ -828,8 +828,8 @@ module OpenAI
|
|
|
828
828
|
|
|
829
829
|
# Control how much effort the model will exert to match the style and features,
|
|
830
830
|
# especially facial features, of input images. Supports `high` and `low` on
|
|
831
|
-
# `gpt-image-1
|
|
832
|
-
#
|
|
831
|
+
# `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
|
|
832
|
+
# this parameter. Defaults to `low` on supported models.
|
|
833
833
|
#
|
|
834
834
|
# @see OpenAI::Models::Responses::Tool::ImageGeneration#input_fidelity
|
|
835
835
|
module InputFidelity
|
|
@@ -355,5 +355,11 @@ module OpenAI
|
|
|
355
355
|
@connection_configurator = connection_configurator
|
|
356
356
|
@pools = {}
|
|
357
357
|
end
|
|
358
|
+
|
|
359
|
+
# Whether this HTTP client has the same connection policy as the SDK default.
|
|
360
|
+
# @api private
|
|
361
|
+
def default_configuration?
|
|
362
|
+
@size == DEFAULT_MAX_CONNECTIONS && @connection_configurator.nil?
|
|
363
|
+
end
|
|
358
364
|
end
|
|
359
365
|
end
|
|
@@ -116,15 +116,6 @@ module OpenAI
|
|
|
116
116
|
if headers.key?("api-key")
|
|
117
117
|
raise OpenAI::Errors::Error, "Vertex authentication cannot be combined with a custom api-key header."
|
|
118
118
|
end
|
|
119
|
-
# The outer Google API version differs for stored Responses.
|
|
120
|
-
# Do not change other gateway layouts.
|
|
121
|
-
prefix = "#{base.path.delete_suffix("/")}/responses/"
|
|
122
|
-
if [:get, :delete].include?(request[:method]) &&
|
|
123
|
-
url.path.start_with?(prefix) &&
|
|
124
|
-
base.path.start_with?("/v1/projects/")
|
|
125
|
-
url = url.dup
|
|
126
|
-
url.path = url.path.sub(%r{\A/v1/}, "/v1beta1/")
|
|
127
|
-
end
|
|
128
119
|
|
|
129
120
|
headers.delete("openai-organization")
|
|
130
121
|
headers.delete("openai-project")
|
|
@@ -163,7 +154,6 @@ module OpenAI
|
|
|
163
154
|
context[:token] = token if context
|
|
164
155
|
|
|
165
156
|
request.merge(
|
|
166
|
-
url: url,
|
|
167
157
|
timeout: remaining,
|
|
168
158
|
headers: headers.merge("authorization" => "Bearer #{token}"),
|
|
169
159
|
provider_auth: AUTH_MARKER,
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Resources
|
|
5
|
+
class Admin
|
|
6
|
+
class Organization
|
|
7
|
+
class ExternalKeys
|
|
8
|
+
# Add an external key config for an organization
|
|
9
|
+
#
|
|
10
|
+
# @overload create(body:, request_options: {})
|
|
11
|
+
#
|
|
12
|
+
# @param body [OpenAI::Models::Admin::Organization::ExternalKeyCreateParams::Body::Aws, OpenAI::Models::Admin::Organization::ExternalKeyCreateParams::Body::Gcp, OpenAI::Models::Admin::Organization::ExternalKeyCreateParams::Body::Azure]
|
|
13
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
14
|
+
#
|
|
15
|
+
# @return [OpenAI::Models::Admin::Organization::ExternalKey]
|
|
16
|
+
#
|
|
17
|
+
# @see OpenAI::Models::Admin::Organization::ExternalKeyCreateParams
|
|
18
|
+
def create(params)
|
|
19
|
+
parsed, options = OpenAI::Admin::Organization::ExternalKeyCreateParams.dump_request(params)
|
|
20
|
+
@client.request(
|
|
21
|
+
method: :post,
|
|
22
|
+
path: "organization/external_keys",
|
|
23
|
+
body: parsed[:body],
|
|
24
|
+
model: OpenAI::Admin::Organization::ExternalKey,
|
|
25
|
+
security: {admin_api_key_auth: true},
|
|
26
|
+
options: options
|
|
27
|
+
)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Retrieve a stored external key registration for the user's organization.
|
|
31
|
+
#
|
|
32
|
+
# @overload retrieve(external_key_id, request_options: {})
|
|
33
|
+
#
|
|
34
|
+
# @param external_key_id [String]
|
|
35
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
36
|
+
#
|
|
37
|
+
# @return [OpenAI::Models::Admin::Organization::ExternalKey]
|
|
38
|
+
#
|
|
39
|
+
# @see OpenAI::Models::Admin::Organization::ExternalKeyRetrieveParams
|
|
40
|
+
def retrieve(external_key_id, params = {})
|
|
41
|
+
@client.request(
|
|
42
|
+
method: :get,
|
|
43
|
+
path: ["organization/external_keys/%1$s", external_key_id],
|
|
44
|
+
model: OpenAI::Admin::Organization::ExternalKey,
|
|
45
|
+
security: {admin_api_key_auth: true},
|
|
46
|
+
options: params[:request_options]
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# List the external key configs registered on the user's organization
|
|
51
|
+
#
|
|
52
|
+
# @overload list(after: nil, limit: nil, order: nil, purpose: nil, request_options: {})
|
|
53
|
+
#
|
|
54
|
+
# @param after [String, nil]
|
|
55
|
+
#
|
|
56
|
+
# @param limit [Integer]
|
|
57
|
+
#
|
|
58
|
+
# @param order [Symbol, OpenAI::Models::Admin::Organization::ExternalKeyListParams::Order]
|
|
59
|
+
#
|
|
60
|
+
# @param purpose [Symbol, OpenAI::Models::Admin::Organization::ExternalKeyListParams::Purpose]
|
|
61
|
+
# Filter by key purpose. When omitted, returns keys of all purposes.
|
|
62
|
+
#
|
|
63
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
64
|
+
#
|
|
65
|
+
# @return [OpenAI::Internal::CursorPage<OpenAI::Models::Admin::Organization::ExternalKey>]
|
|
66
|
+
#
|
|
67
|
+
# @see OpenAI::Models::Admin::Organization::ExternalKeyListParams
|
|
68
|
+
def list(params = {})
|
|
69
|
+
parsed, options = OpenAI::Admin::Organization::ExternalKeyListParams.dump_request(params)
|
|
70
|
+
query = OpenAI::Internal::Util.encode_query_params(parsed)
|
|
71
|
+
@client.request(
|
|
72
|
+
method: :get,
|
|
73
|
+
path: "organization/external_keys",
|
|
74
|
+
query: query,
|
|
75
|
+
page: OpenAI::Internal::CursorPage,
|
|
76
|
+
model: OpenAI::Admin::Organization::ExternalKey,
|
|
77
|
+
security: {admin_api_key_auth: true},
|
|
78
|
+
options: options
|
|
79
|
+
)
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Delete an external key config for the user's organization
|
|
83
|
+
#
|
|
84
|
+
# @overload delete(external_key_id, request_options: {})
|
|
85
|
+
#
|
|
86
|
+
# @param external_key_id [String]
|
|
87
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
88
|
+
#
|
|
89
|
+
# @return [OpenAI::Models::Admin::Organization::ExternalKey]
|
|
90
|
+
#
|
|
91
|
+
# @see OpenAI::Models::Admin::Organization::ExternalKeyDeleteParams
|
|
92
|
+
def delete(external_key_id, params = {})
|
|
93
|
+
@client.request(
|
|
94
|
+
method: :delete,
|
|
95
|
+
path: ["organization/external_keys/%1$s", external_key_id],
|
|
96
|
+
model: OpenAI::Admin::Organization::ExternalKey,
|
|
97
|
+
security: {admin_api_key_auth: true},
|
|
98
|
+
options: params[:request_options]
|
|
99
|
+
)
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Validate an external key config for the user's organization
|
|
103
|
+
#
|
|
104
|
+
# @overload validate(external_key_id, request_options: {})
|
|
105
|
+
#
|
|
106
|
+
# @param external_key_id [String]
|
|
107
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
108
|
+
#
|
|
109
|
+
# @return [OpenAI::Models::Admin::Organization::ExternalKeyValidateResponse]
|
|
110
|
+
#
|
|
111
|
+
# @see OpenAI::Models::Admin::Organization::ExternalKeyValidateParams
|
|
112
|
+
def validate(external_key_id, params = {})
|
|
113
|
+
@client.request(
|
|
114
|
+
method: :post,
|
|
115
|
+
path: ["organization/external_keys/%1$s/validate", external_key_id],
|
|
116
|
+
model: OpenAI::Models::Admin::Organization::ExternalKeyValidateResponse,
|
|
117
|
+
security: {admin_api_key_auth: true},
|
|
118
|
+
options: params[:request_options]
|
|
119
|
+
)
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# @api private
|
|
123
|
+
#
|
|
124
|
+
# @param client [OpenAI::Client]
|
|
125
|
+
def initialize(client:)
|
|
126
|
+
@client = client
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
end
|
|
@@ -29,6 +29,9 @@ module OpenAI
|
|
|
29
29
|
# @return [OpenAI::Resources::Admin::Organization::DataRetention]
|
|
30
30
|
attr_reader :data_retention
|
|
31
31
|
|
|
32
|
+
# @return [OpenAI::Resources::Admin::Organization::ExternalKeys]
|
|
33
|
+
attr_reader :external_keys
|
|
34
|
+
|
|
32
35
|
# @return [OpenAI::Resources::Admin::Organization::ExternalStorage]
|
|
33
36
|
attr_reader :external_storage
|
|
34
37
|
|
|
@@ -57,6 +60,7 @@ module OpenAI
|
|
|
57
60
|
@groups = OpenAI::Resources::Admin::Organization::Groups.new(client: client)
|
|
58
61
|
@roles = OpenAI::Resources::Admin::Organization::Roles.new(client: client)
|
|
59
62
|
@data_retention = OpenAI::Resources::Admin::Organization::DataRetention.new(client: client)
|
|
63
|
+
@external_keys = OpenAI::Resources::Admin::Organization::ExternalKeys.new(client: client)
|
|
60
64
|
@external_storage = OpenAI::Resources::Admin::Organization::ExternalStorage.new(client: client)
|
|
61
65
|
@spend_limit = OpenAI::Resources::Admin::Organization::SpendLimit.new(client: client)
|
|
62
66
|
@spend_alerts = OpenAI::Resources::Admin::Organization::SpendAlerts.new(client: client)
|
|
@@ -9,6 +9,14 @@ module OpenAI
|
|
|
9
9
|
#
|
|
10
10
|
# Returns the audio file content, or a stream of audio events.
|
|
11
11
|
#
|
|
12
|
+
# The `tts-1`, `tts-1-hd`, `gpt-4o-mini-tts`, `gpt-4o-mini-tts-2025-03-20`, and
|
|
13
|
+
# `gpt-4o-mini-tts-2025-12-15` models are deprecated and scheduled to shut down on
|
|
14
|
+
# January 6, 2027. These examples use the existing Speech API; for new
|
|
15
|
+
# integrations, migrate to `gpt-realtime-2.1-mini` through the
|
|
16
|
+
# [Realtime API](https://developers.openai.com/api/docs/guides/realtime). See the
|
|
17
|
+
# [deprecation schedule](https://developers.openai.com/api/docs/deprecations) for
|
|
18
|
+
# migration details.
|
|
19
|
+
#
|
|
12
20
|
# @overload create(input:, model:, voice:, instructions: nil, response_format: nil, speed: nil, stream_format: nil, request_options: {})
|
|
13
21
|
#
|
|
14
22
|
# @param input [String]
|
|
@@ -5,8 +5,16 @@ module OpenAI
|
|
|
5
5
|
class Audio
|
|
6
6
|
# Turn audio into text or text into audio.
|
|
7
7
|
class Translations
|
|
8
|
+
# @deprecated
|
|
9
|
+
#
|
|
8
10
|
# Translates audio into English.
|
|
9
11
|
#
|
|
12
|
+
# This endpoint supports only `whisper-1`. The endpoint and model are deprecated
|
|
13
|
+
# and scheduled to shut down on February 26, 2027. Migrate to
|
|
14
|
+
# `/v1/realtime/translations`, which requires a separate integration. See the
|
|
15
|
+
# [deprecation schedule](https://developers.openai.com/api/docs/deprecations) for
|
|
16
|
+
# details.
|
|
17
|
+
#
|
|
10
18
|
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
11
19
|
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
12
20
|
# content type.
|
|
@@ -32,7 +32,7 @@ module OpenAI
|
|
|
32
32
|
# the session or streams its events when stream is true. See
|
|
33
33
|
# [running sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions).
|
|
34
34
|
#
|
|
35
|
-
# @overload create(environment:, agent: nil, agent_id: nil, input: nil, metadata: nil, spend_control: nil, vault_ids: nil, request_options: {})
|
|
35
|
+
# @overload create(environment:, agent: nil, agent_id: nil, input: nil, metadata: nil, review: nil, spend_control: nil, vault_ids: nil, request_options: {})
|
|
36
36
|
#
|
|
37
37
|
# @param environment [OpenAI::Models::Beta::EnvironmentParam::None, OpenAI::Models::Beta::EnvironmentParam::OpenAIHosted, OpenAI::Models::Beta::EnvironmentParam::SelfHosted]
|
|
38
38
|
# An inline execution environment or a reference to an environment template.
|
|
@@ -55,6 +55,9 @@ module OpenAI
|
|
|
55
55
|
# Up to 16 string key-value pairs, with keys up to 64 and values up to 512
|
|
56
56
|
# characters. Omission or null defaults to an empty map.
|
|
57
57
|
#
|
|
58
|
+
# @param review [Symbol, OpenAI::Models::Beta::Agents::SessionCreateParams::Review]
|
|
59
|
+
# Action review mode. Omit to use none.
|
|
60
|
+
#
|
|
58
61
|
# @param spend_control [OpenAI::Models::Beta::Agents::SessionCreateParams::SpendControl, nil]
|
|
59
62
|
# Optional spending limit in USD cents. Omission or null creates an unlimited
|
|
60
63
|
# session.
|
|
@@ -92,7 +95,7 @@ module OpenAI
|
|
|
92
95
|
# the session or streams its events when stream is true. See
|
|
93
96
|
# [running sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions).
|
|
94
97
|
#
|
|
95
|
-
# @overload create_streaming(environment:, agent: nil, agent_id: nil, input: nil, output_type: nil, tool_handlers: {}, metadata: nil, spend_control: nil, vault_ids: nil, request_options: {})
|
|
98
|
+
# @overload create_streaming(environment:, agent: nil, agent_id: nil, input: nil, output_type: nil, tool_handlers: {}, metadata: nil, review: nil, spend_control: nil, vault_ids: nil, request_options: {})
|
|
96
99
|
#
|
|
97
100
|
# @param environment [OpenAI::Models::Beta::EnvironmentParam::None, OpenAI::Models::Beta::EnvironmentParam::OpenAIHosted, OpenAI::Models::Beta::EnvironmentParam::SelfHosted]
|
|
98
101
|
# An inline execution environment or a reference to an environment template.
|
|
@@ -115,6 +118,9 @@ module OpenAI
|
|
|
115
118
|
# Up to 16 string key-value pairs, with keys up to 64 and values up to 512
|
|
116
119
|
# characters. Omission or null defaults to an empty map.
|
|
117
120
|
#
|
|
121
|
+
# @param review [Symbol, OpenAI::Models::Beta::Agents::SessionCreateParams::Review]
|
|
122
|
+
# Action review mode. Omit to use none.
|
|
123
|
+
#
|
|
118
124
|
# @param spend_control [OpenAI::Models::Beta::Agents::SessionCreateParams::SpendControl, nil]
|
|
119
125
|
# Optional spending limit in USD cents. Omission or null creates an unlimited
|
|
120
126
|
# session.
|
|
@@ -188,23 +194,27 @@ module OpenAI
|
|
|
188
194
|
)
|
|
189
195
|
end
|
|
190
196
|
|
|
191
|
-
# Updates session metadata, model, reasoning effort, or service tier. Model
|
|
197
|
+
# Updates session tools, metadata, model, reasoning effort, or service tier. Model
|
|
192
198
|
# settings apply to subsequent turns. Omitted fields are unchanged. See
|
|
193
199
|
# [managing sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage).
|
|
194
200
|
#
|
|
195
|
-
# @overload update(session_id, agent: nil, metadata: nil, spend_control: nil, request_options: {})
|
|
201
|
+
# @overload update(session_id, agent: nil, metadata: nil, review: nil, spend_control: nil, request_options: {})
|
|
196
202
|
#
|
|
197
203
|
# @param session_id [String]
|
|
198
204
|
# The ID of the session.
|
|
199
205
|
#
|
|
200
206
|
# @param agent [OpenAI::Models::Beta::Agents::SessionUpdateParams::Agent]
|
|
201
|
-
#
|
|
207
|
+
# Agent settings to update on this session. Omitted fields stay unchanged.
|
|
202
208
|
#
|
|
203
209
|
# @param metadata [Hash{Symbol=>String}, nil]
|
|
204
210
|
# Replaces all metadata. Omit to leave unchanged, or pass null or {} to clear it.
|
|
205
211
|
# Up to 16 string key-value pairs, with keys up to 64 and values up to 512
|
|
206
212
|
# characters.
|
|
207
213
|
#
|
|
214
|
+
# @param review [Symbol, OpenAI::Models::Beta::Agents::SessionUpdateParams::Review]
|
|
215
|
+
# Default action review for new root turns. Existing turns and their subagents
|
|
216
|
+
# keep their review mode.
|
|
217
|
+
#
|
|
208
218
|
# @param spend_control [OpenAI::Models::Beta::Agents::SessionUpdateParams::SpendControl, nil]
|
|
209
219
|
# Omit to retain the limit; null or a null limit removes it without resetting
|
|
210
220
|
# spend.
|
|
@@ -231,7 +241,7 @@ module OpenAI
|
|
|
231
241
|
# order. See
|
|
232
242
|
# [managing sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage).
|
|
233
243
|
#
|
|
234
|
-
# @overload list(after: nil, agent_id: nil, limit: nil, order: nil, request_options: {})
|
|
244
|
+
# @overload list(after: nil, agent_id: nil, limit: nil, metadata: nil, order: nil, request_options: {})
|
|
235
245
|
#
|
|
236
246
|
# @param after [String]
|
|
237
247
|
# Return resources after this resource ID in the selected order.
|
|
@@ -243,6 +253,12 @@ module OpenAI
|
|
|
243
253
|
# @param limit [Integer]
|
|
244
254
|
# The maximum number of resources to return, between 1 and 100. Defaults to 20.
|
|
245
255
|
#
|
|
256
|
+
# @param metadata [Hash{Symbol=>String}]
|
|
257
|
+
# Exact string matches supplied as `metadata[key]=value`. All supplied pairs must
|
|
258
|
+
# match. Up to 16 pairs, with keys from 1 to 64 characters and values up to 512
|
|
259
|
+
# characters. New sessions and metadata updates may take time to appear in
|
|
260
|
+
# filtered results.
|
|
261
|
+
#
|
|
246
262
|
# @param order [Symbol, OpenAI::Models::Beta::Agents::SessionListParams::Order]
|
|
247
263
|
# The order in which resources are returned. Defaults to `desc`.
|
|
248
264
|
#
|