openai 0.114.0 → 0.115.1
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 +43 -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/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_item.rb +2 -3
- data/lib/openai/models/beta/beta_response_item.rb +2 -2
- 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_model.rb +6 -0
- 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_item.rb +2 -3
- 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_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/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_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_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/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_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 +43 -1
|
@@ -56,6 +56,15 @@ module OpenAI
|
|
|
56
56
|
sig { returns(T.nilable(T.any(String, OpenAI::Responses::ResponseConversationParam))) }
|
|
57
57
|
attr_accessor :conversation
|
|
58
58
|
|
|
59
|
+
# Whether to generate output for this response. Defaults to true when omitted. Set
|
|
60
|
+
# to false to prepare request state without model output; the response ID can be
|
|
61
|
+
# used as previous_response_id on a later turn.
|
|
62
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
63
|
+
attr_reader :generate
|
|
64
|
+
|
|
65
|
+
sig { params(generate: T::Boolean).void }
|
|
66
|
+
attr_writer :generate
|
|
67
|
+
|
|
59
68
|
# Specify additional output data to include in the model response. Currently
|
|
60
69
|
# supported values are:
|
|
61
70
|
#
|
|
@@ -496,6 +505,8 @@ module OpenAI
|
|
|
496
505
|
|
|
497
506
|
conversation: T.nilable(T.any(String, OpenAI::Responses::ResponseConversationParam::OrHash)),
|
|
498
507
|
|
|
508
|
+
generate: T::Boolean,
|
|
509
|
+
|
|
499
510
|
include: T.nilable(T::Array[OpenAI::Responses::ResponseIncludable::OrSymbol]),
|
|
500
511
|
|
|
501
512
|
input: OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Input::Variants,
|
|
@@ -607,6 +618,11 @@ module OpenAI
|
|
|
607
618
|
# response completes.
|
|
608
619
|
conversation: nil,
|
|
609
620
|
|
|
621
|
+
# Whether to generate output for this response. Defaults to true when omitted. Set
|
|
622
|
+
# to false to prepare request state without model output; the response ID can be
|
|
623
|
+
# used as previous_response_id on a later turn.
|
|
624
|
+
generate: nil,
|
|
625
|
+
|
|
610
626
|
# Specify additional output data to include in the model response. Currently
|
|
611
627
|
# supported values are:
|
|
612
628
|
#
|
|
@@ -870,6 +886,7 @@ module OpenAI
|
|
|
870
886
|
T::Array[OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ContextManagement]
|
|
871
887
|
),
|
|
872
888
|
conversation: T.nilable(T.any(String, OpenAI::Responses::ResponseConversationParam)),
|
|
889
|
+
generate: T.nilable(T::Boolean),
|
|
873
890
|
include: T.nilable(T::Array[OpenAI::Responses::ResponseIncludable::OrSymbol]),
|
|
874
891
|
input: T.nilable(OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Input::Variants),
|
|
875
892
|
instructions: T.nilable(String),
|
|
@@ -979,8 +979,8 @@ module OpenAI
|
|
|
979
979
|
|
|
980
980
|
# Control how much effort the model will exert to match the style and features,
|
|
981
981
|
# especially facial features, of input images. Supports `high` and `low` on
|
|
982
|
-
# `gpt-image-1
|
|
983
|
-
#
|
|
982
|
+
# `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
|
|
983
|
+
# this parameter. Defaults to `low` on supported models.
|
|
984
984
|
sig { returns(T.nilable(OpenAI::Responses::Tool::ImageGeneration::InputFidelity::OrSymbol)) }
|
|
985
985
|
attr_accessor :input_fidelity
|
|
986
986
|
|
|
@@ -1110,8 +1110,8 @@ module OpenAI
|
|
|
1110
1110
|
|
|
1111
1111
|
# Control how much effort the model will exert to match the style and features,
|
|
1112
1112
|
# especially facial features, of input images. Supports `high` and `low` on
|
|
1113
|
-
# `gpt-image-1
|
|
1114
|
-
#
|
|
1113
|
+
# `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
|
|
1114
|
+
# this parameter. Defaults to `low` on supported models.
|
|
1115
1115
|
input_fidelity: nil,
|
|
1116
1116
|
|
|
1117
1117
|
# Optional mask for inpainting. Contains `image_url` (string, optional) and
|
|
@@ -1229,8 +1229,8 @@ module OpenAI
|
|
|
1229
1229
|
|
|
1230
1230
|
# Control how much effort the model will exert to match the style and features,
|
|
1231
1231
|
# especially facial features, of input images. Supports `high` and `low` on
|
|
1232
|
-
# `gpt-image-1
|
|
1233
|
-
#
|
|
1232
|
+
# `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
|
|
1233
|
+
# this parameter. Defaults to `low` on supported models.
|
|
1234
1234
|
module InputFidelity
|
|
1235
1235
|
extend OpenAI::Internal::Type::Enum
|
|
1236
1236
|
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Resources
|
|
5
|
+
|
|
6
|
+
class Admin
|
|
7
|
+
|
|
8
|
+
class Organization
|
|
9
|
+
|
|
10
|
+
class ExternalKeys
|
|
11
|
+
|
|
12
|
+
# Add an external key config for an organization
|
|
13
|
+
sig {
|
|
14
|
+
params(
|
|
15
|
+
body: T.any(
|
|
16
|
+
OpenAI::Admin::Organization::ExternalKeyCreateParams::Body::Aws::OrHash,
|
|
17
|
+
OpenAI::Admin::Organization::ExternalKeyCreateParams::Body::Gcp::OrHash,
|
|
18
|
+
OpenAI::Admin::Organization::ExternalKeyCreateParams::Body::Azure::OrHash
|
|
19
|
+
),
|
|
20
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
21
|
+
)
|
|
22
|
+
.returns(OpenAI::Admin::Organization::ExternalKey)
|
|
23
|
+
}
|
|
24
|
+
def create(body:, request_options: {})
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Retrieve a stored external key registration for the user's organization.
|
|
28
|
+
sig {
|
|
29
|
+
params(external_key_id: String, request_options: OpenAI::RequestOptions::OrHash).returns(
|
|
30
|
+
OpenAI::Admin::Organization::ExternalKey
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
def retrieve(external_key_id, request_options: {})
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# List the external key configs registered on the user's organization
|
|
37
|
+
sig {
|
|
38
|
+
params(
|
|
39
|
+
after: T.nilable(String),
|
|
40
|
+
limit: Integer,
|
|
41
|
+
order: OpenAI::Admin::Organization::ExternalKeyListParams::Order::OrSymbol,
|
|
42
|
+
purpose: OpenAI::Admin::Organization::ExternalKeyListParams::Purpose::OrSymbol,
|
|
43
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
44
|
+
)
|
|
45
|
+
.returns(OpenAI::Internal::CursorPage[OpenAI::Admin::Organization::ExternalKey])
|
|
46
|
+
}
|
|
47
|
+
def list(
|
|
48
|
+
after: nil,
|
|
49
|
+
limit: nil,
|
|
50
|
+
order: nil,
|
|
51
|
+
# Filter by key purpose. When omitted, returns keys of all purposes.
|
|
52
|
+
purpose: nil,
|
|
53
|
+
request_options: {}
|
|
54
|
+
)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Delete an external key config for the user's organization
|
|
58
|
+
sig {
|
|
59
|
+
params(external_key_id: String, request_options: OpenAI::RequestOptions::OrHash).returns(
|
|
60
|
+
OpenAI::Admin::Organization::ExternalKey
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
def delete(external_key_id, request_options: {})
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Validate an external key config for the user's organization
|
|
67
|
+
sig {
|
|
68
|
+
params(external_key_id: String, request_options: OpenAI::RequestOptions::OrHash).returns(
|
|
69
|
+
OpenAI::Models::Admin::Organization::ExternalKeyValidateResponse
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
def validate(external_key_id, request_options: {})
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# @api private
|
|
76
|
+
sig { params(client: OpenAI::Client).returns(T.attached_class) }
|
|
77
|
+
def self.new(client:)
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
end
|
|
86
|
+
end
|
|
@@ -32,6 +32,9 @@ module OpenAI
|
|
|
32
32
|
sig { returns(OpenAI::Resources::Admin::Organization::DataRetention) }
|
|
33
33
|
attr_reader :data_retention
|
|
34
34
|
|
|
35
|
+
sig { returns(OpenAI::Resources::Admin::Organization::ExternalKeys) }
|
|
36
|
+
attr_reader :external_keys
|
|
37
|
+
|
|
35
38
|
sig { returns(OpenAI::Resources::Admin::Organization::ExternalStorage) }
|
|
36
39
|
attr_reader :external_storage
|
|
37
40
|
|
|
@@ -11,6 +11,14 @@ module OpenAI
|
|
|
11
11
|
# Generates audio from the input text.
|
|
12
12
|
#
|
|
13
13
|
# Returns the audio file content, or a stream of audio events.
|
|
14
|
+
#
|
|
15
|
+
# The `tts-1`, `tts-1-hd`, `gpt-4o-mini-tts`, `gpt-4o-mini-tts-2025-03-20`, and
|
|
16
|
+
# `gpt-4o-mini-tts-2025-12-15` models are deprecated and scheduled to shut down on
|
|
17
|
+
# January 6, 2027. These examples use the existing Speech API; for new
|
|
18
|
+
# integrations, migrate to `gpt-realtime-2.1-mini` through the
|
|
19
|
+
# [Realtime API](https://developers.openai.com/api/docs/guides/realtime). See the
|
|
20
|
+
# [deprecation schedule](https://developers.openai.com/api/docs/deprecations) for
|
|
21
|
+
# migration details.
|
|
14
22
|
sig {
|
|
15
23
|
params(
|
|
16
24
|
input: String,
|
|
@@ -9,6 +9,12 @@ module OpenAI
|
|
|
9
9
|
class Translations
|
|
10
10
|
|
|
11
11
|
# Translates audio into English.
|
|
12
|
+
#
|
|
13
|
+
# This endpoint supports only `whisper-1`. The endpoint and model are deprecated
|
|
14
|
+
# and scheduled to shut down on February 26, 2027. Migrate to
|
|
15
|
+
# `/v1/realtime/translations`, which requires a separate integration. See the
|
|
16
|
+
# [deprecation schedule](https://developers.openai.com/api/docs/deprecations) for
|
|
17
|
+
# details.
|
|
12
18
|
sig {
|
|
13
19
|
params(
|
|
14
20
|
file: OpenAI::Internal::FileInput,
|
|
@@ -44,6 +44,7 @@ module OpenAI
|
|
|
44
44
|
agent_id: String,
|
|
45
45
|
input: T.nilable(OpenAI::Beta::Agents::SessionCreateParams::Input::Variants),
|
|
46
46
|
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
47
|
+
review: OpenAI::Beta::Agents::SessionCreateParams::Review::OrSymbol,
|
|
47
48
|
spend_control: T.nilable(OpenAI::Beta::Agents::SessionCreateParams::SpendControl::OrHash),
|
|
48
49
|
vault_ids: T.nilable(T::Array[String]),
|
|
49
50
|
stream: T.noreturn,
|
|
@@ -68,6 +69,8 @@ module OpenAI
|
|
|
68
69
|
# Up to 16 string key-value pairs, with keys up to 64 and values up to 512
|
|
69
70
|
# characters. Omission or null defaults to an empty map.
|
|
70
71
|
metadata: nil,
|
|
72
|
+
# Action review mode. Omit to use none.
|
|
73
|
+
review: nil,
|
|
71
74
|
# Optional spending limit in USD cents. Omission or null creates an unlimited
|
|
72
75
|
# session.
|
|
73
76
|
spend_control: nil,
|
|
@@ -99,6 +102,7 @@ module OpenAI
|
|
|
99
102
|
output_type: T.nilable(T.class_of(OpenAI::Helpers::StructuredOutput::BaseModel)),
|
|
100
103
|
input: T.nilable(OpenAI::Beta::Agents::SessionCreateParams::Input::Variants),
|
|
101
104
|
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
105
|
+
review: OpenAI::Beta::Agents::SessionCreateParams::Review::OrSymbol,
|
|
102
106
|
spend_control: T.nilable(OpenAI::Beta::Agents::SessionCreateParams::SpendControl::OrHash),
|
|
103
107
|
vault_ids: T.nilable(T::Array[String]),
|
|
104
108
|
stream: T.noreturn,
|
|
@@ -125,6 +129,8 @@ module OpenAI
|
|
|
125
129
|
# Up to 16 string key-value pairs, with keys up to 64 and values up to 512
|
|
126
130
|
# characters. Omission or null defaults to an empty map.
|
|
127
131
|
metadata: nil,
|
|
132
|
+
# Action review mode. Omit to use none.
|
|
133
|
+
review: nil,
|
|
128
134
|
# Optional spending limit in USD cents. Omission or null creates an unlimited
|
|
129
135
|
# session.
|
|
130
136
|
spend_control: nil,
|
|
@@ -151,7 +157,7 @@ module OpenAI
|
|
|
151
157
|
)
|
|
152
158
|
end
|
|
153
159
|
|
|
154
|
-
# Updates session metadata, model, reasoning effort, or service tier. Model
|
|
160
|
+
# Updates session tools, metadata, model, reasoning effort, or service tier. Model
|
|
155
161
|
# settings apply to subsequent turns. Omitted fields are unchanged. See
|
|
156
162
|
# [managing sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage).
|
|
157
163
|
sig {
|
|
@@ -159,6 +165,7 @@ module OpenAI
|
|
|
159
165
|
session_id: String,
|
|
160
166
|
agent: OpenAI::Beta::Agents::SessionUpdateParams::Agent::OrHash,
|
|
161
167
|
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
168
|
+
review: OpenAI::Beta::Agents::SessionUpdateParams::Review::OrSymbol,
|
|
162
169
|
spend_control: T.nilable(OpenAI::Beta::Agents::SessionUpdateParams::SpendControl::OrHash),
|
|
163
170
|
request_options: OpenAI::RequestOptions::OrHash
|
|
164
171
|
)
|
|
@@ -167,12 +174,15 @@ module OpenAI
|
|
|
167
174
|
def update(
|
|
168
175
|
# The ID of the session.
|
|
169
176
|
session_id,
|
|
170
|
-
#
|
|
177
|
+
# Agent settings to update on this session. Omitted fields stay unchanged.
|
|
171
178
|
agent: nil,
|
|
172
179
|
# Replaces all metadata. Omit to leave unchanged, or pass null or {} to clear it.
|
|
173
180
|
# Up to 16 string key-value pairs, with keys up to 64 and values up to 512
|
|
174
181
|
# characters.
|
|
175
182
|
metadata: nil,
|
|
183
|
+
# Default action review for new root turns. Existing turns and their subagents
|
|
184
|
+
# keep their review mode.
|
|
185
|
+
review: nil,
|
|
176
186
|
# Omit to retain the limit; null or a null limit removes it without resetting
|
|
177
187
|
# spend.
|
|
178
188
|
spend_control: nil,
|
|
@@ -188,6 +198,7 @@ module OpenAI
|
|
|
188
198
|
after: String,
|
|
189
199
|
agent_id: String,
|
|
190
200
|
limit: Integer,
|
|
201
|
+
metadata: T::Hash[Symbol, String],
|
|
191
202
|
order: OpenAI::Beta::Agents::SessionListParams::Order::OrSymbol,
|
|
192
203
|
request_options: OpenAI::RequestOptions::OrHash
|
|
193
204
|
)
|
|
@@ -201,6 +212,11 @@ module OpenAI
|
|
|
201
212
|
agent_id: nil,
|
|
202
213
|
# The maximum number of resources to return, between 1 and 100. Defaults to 20.
|
|
203
214
|
limit: nil,
|
|
215
|
+
# Exact string matches supplied as `metadata[key]=value`. All supplied pairs must
|
|
216
|
+
# match. Up to 16 pairs, with keys from 1 to 64 characters and values up to 512
|
|
217
|
+
# characters. New sessions and metadata updates may take time to appear in
|
|
218
|
+
# filtered results.
|
|
219
|
+
metadata: nil,
|
|
204
220
|
# The order in which resources are returned. Defaults to `desc`.
|
|
205
221
|
order: nil,
|
|
206
222
|
request_options: {}
|
|
@@ -21,6 +21,8 @@ module OpenAI
|
|
|
21
21
|
sig {
|
|
22
22
|
params(
|
|
23
23
|
model: String,
|
|
24
|
+
compaction: T.nilable(OpenAI::Beta::AgentCreateParams::Compaction::OrHash),
|
|
25
|
+
experimental: OpenAI::Beta::AgentCreateParams::Experimental::OrHash,
|
|
24
26
|
instructions: T.nilable(String),
|
|
25
27
|
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
26
28
|
multi_agent: T.nilable(OpenAI::Beta::MultiAgentConfigParam::OrHash),
|
|
@@ -48,6 +50,10 @@ module OpenAI
|
|
|
48
50
|
def create(
|
|
49
51
|
# The model to use for the agent. The requested model name is preserved.
|
|
50
52
|
model:,
|
|
53
|
+
# Context compaction settings. Omission or null enables background compaction.
|
|
54
|
+
compaction: nil,
|
|
55
|
+
# Experimental agent settings. All experimental features default to disabled.
|
|
56
|
+
experimental: nil,
|
|
51
57
|
# Additional instructions appended to the agent's default base instructions. Omit
|
|
52
58
|
# or set to null to add no custom instructions.
|
|
53
59
|
instructions: nil,
|
|
@@ -88,6 +94,8 @@ module OpenAI
|
|
|
88
94
|
sig {
|
|
89
95
|
params(
|
|
90
96
|
agent_id: String,
|
|
97
|
+
compaction: T.nilable(OpenAI::Beta::AgentUpdateParams::Compaction::OrHash),
|
|
98
|
+
experimental: OpenAI::Beta::AgentUpdateParams::Experimental::OrHash,
|
|
91
99
|
instructions: T.nilable(String),
|
|
92
100
|
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
93
101
|
model: String,
|
|
@@ -116,6 +124,13 @@ module OpenAI
|
|
|
116
124
|
def update(
|
|
117
125
|
# The ID of the reusable agent.
|
|
118
126
|
agent_id,
|
|
127
|
+
# Context compaction settings. Omit to keep the current settings. A supplied
|
|
128
|
+
# object replaces the settings; null or an empty object enables background
|
|
129
|
+
# compaction.
|
|
130
|
+
compaction: nil,
|
|
131
|
+
# Experimental settings to merge by key. Omitted settings keep their current
|
|
132
|
+
# values.
|
|
133
|
+
experimental: nil,
|
|
119
134
|
# Additional instructions appended to the agent's default base instructions. Omit
|
|
120
135
|
# to leave unchanged.
|
|
121
136
|
instructions: nil,
|
|
@@ -59,6 +59,7 @@ module OpenAI
|
|
|
59
59
|
prompt: String,
|
|
60
60
|
background: T.nilable(OpenAI::ImageEditParams::Background::OrSymbol),
|
|
61
61
|
input_fidelity: T.nilable(OpenAI::ImageEditParams::InputFidelity::OrSymbol),
|
|
62
|
+
markup: OpenAI::Internal::FileInput,
|
|
62
63
|
mask: OpenAI::Internal::FileInput,
|
|
63
64
|
model: T.nilable(T.any(String, OpenAI::ImageModel::OrSymbol)),
|
|
64
65
|
n: T.nilable(Integer),
|
|
@@ -78,12 +79,12 @@ module OpenAI
|
|
|
78
79
|
def edit(
|
|
79
80
|
# The image(s) to edit. Must be a supported image file or an array of images.
|
|
80
81
|
#
|
|
81
|
-
# For the GPT image models (`gpt-image-1`, `gpt-image-1
|
|
82
|
-
# `gpt-image-2
|
|
83
|
-
# `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
|
|
84
|
-
# `gpt-image-2.5-flare-2026-09-08
|
|
85
|
-
#
|
|
86
|
-
#
|
|
82
|
+
# For the GPT image models (`gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
|
|
83
|
+
# `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
|
|
84
|
+
# `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and
|
|
85
|
+
# `gpt-image-2.5-flare-2026-09-08`), each image should be a `png`, `webp`, or
|
|
86
|
+
# `jpg` file less than 50MB. You can provide up to 16 images.
|
|
87
|
+
# `chatgpt-image-latest` follows the same input constraints as GPT image models.
|
|
87
88
|
#
|
|
88
89
|
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
89
90
|
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
@@ -104,9 +105,17 @@ module OpenAI
|
|
|
104
105
|
background: nil,
|
|
105
106
|
# Control how much effort the model will exert to match the style and features,
|
|
106
107
|
# especially facial features, of input images. Supports `high` and `low` on
|
|
107
|
-
# `gpt-image-1
|
|
108
|
-
#
|
|
108
|
+
# `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
|
|
109
|
+
# this parameter. Defaults to `low` on supported models.
|
|
109
110
|
input_fidelity: nil,
|
|
111
|
+
# A transparent PNG overlaid on the first image to guide the edit. Must match that
|
|
112
|
+
# image's dimensions after orientation and contain transparent pixels. Supports
|
|
113
|
+
# GPT Image 2.5 and 2.6. Cannot be combined with mask.
|
|
114
|
+
#
|
|
115
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
116
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
117
|
+
# content type.
|
|
118
|
+
markup: nil,
|
|
110
119
|
# An additional image whose fully transparent areas (e.g. where alpha is zero)
|
|
111
120
|
# indicate where `image` should be edited. If there are multiple images provided,
|
|
112
121
|
# the mask will be applied on the first image. Must be a valid PNG file, less than
|
|
@@ -191,6 +200,7 @@ module OpenAI
|
|
|
191
200
|
prompt: String,
|
|
192
201
|
background: T.nilable(OpenAI::ImageEditParams::Background::OrSymbol),
|
|
193
202
|
input_fidelity: T.nilable(OpenAI::ImageEditParams::InputFidelity::OrSymbol),
|
|
203
|
+
markup: OpenAI::Internal::FileInput,
|
|
194
204
|
mask: OpenAI::Internal::FileInput,
|
|
195
205
|
model: T.nilable(T.any(String, OpenAI::ImageModel::OrSymbol)),
|
|
196
206
|
n: T.nilable(Integer),
|
|
@@ -210,12 +220,12 @@ module OpenAI
|
|
|
210
220
|
def edit_stream_raw(
|
|
211
221
|
# The image(s) to edit. Must be a supported image file or an array of images.
|
|
212
222
|
#
|
|
213
|
-
# For the GPT image models (`gpt-image-1`, `gpt-image-1
|
|
214
|
-
# `gpt-image-2
|
|
215
|
-
# `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
|
|
216
|
-
# `gpt-image-2.5-flare-2026-09-08
|
|
217
|
-
#
|
|
218
|
-
#
|
|
223
|
+
# For the GPT image models (`gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
|
|
224
|
+
# `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
|
|
225
|
+
# `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, and
|
|
226
|
+
# `gpt-image-2.5-flare-2026-09-08`), each image should be a `png`, `webp`, or
|
|
227
|
+
# `jpg` file less than 50MB. You can provide up to 16 images.
|
|
228
|
+
# `chatgpt-image-latest` follows the same input constraints as GPT image models.
|
|
219
229
|
#
|
|
220
230
|
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
221
231
|
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
@@ -236,9 +246,17 @@ module OpenAI
|
|
|
236
246
|
background: nil,
|
|
237
247
|
# Control how much effort the model will exert to match the style and features,
|
|
238
248
|
# especially facial features, of input images. Supports `high` and `low` on
|
|
239
|
-
# `gpt-image-1
|
|
240
|
-
#
|
|
249
|
+
# `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
|
|
250
|
+
# this parameter. Defaults to `low` on supported models.
|
|
241
251
|
input_fidelity: nil,
|
|
252
|
+
# A transparent PNG overlaid on the first image to guide the edit. Must match that
|
|
253
|
+
# image's dimensions after orientation and contain transparent pixels. Supports
|
|
254
|
+
# GPT Image 2.5 and 2.6. Cannot be combined with mask.
|
|
255
|
+
#
|
|
256
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
257
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
258
|
+
# content type.
|
|
259
|
+
markup: nil,
|
|
242
260
|
# An additional image whose fully transparent areas (e.g. where alpha is zero)
|
|
243
261
|
# indicate where `image` should be edited. If there are multiple images provided,
|
|
244
262
|
# the mask will be applied on the first image. Must be a valid PNG file, less than
|
|
@@ -864,6 +864,7 @@ module OpenAI
|
|
|
864
864
|
T::Array[OpenAI::Responses::ResponsesClientEvent::ResponseCreate::ContextManagement::OrHash]
|
|
865
865
|
),
|
|
866
866
|
conversation: T.nilable(T.any(String, OpenAI::Responses::ResponseConversationParam::OrHash)),
|
|
867
|
+
generate: T::Boolean,
|
|
867
868
|
include: T.nilable(T::Array[OpenAI::Responses::ResponseIncludable::OrSymbol]),
|
|
868
869
|
input: OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Input::Variants,
|
|
869
870
|
instructions: T.nilable(String),
|
|
@@ -933,6 +934,7 @@ module OpenAI
|
|
|
933
934
|
background: nil,
|
|
934
935
|
context_management: nil,
|
|
935
936
|
conversation: nil,
|
|
937
|
+
generate: nil,
|
|
936
938
|
include: nil,
|
|
937
939
|
input: nil,
|
|
938
940
|
instructions: nil,
|
data/realtime.md
CHANGED
|
@@ -596,6 +596,12 @@ settings. `transport_options` therefore cannot override those fields and are
|
|
|
596
596
|
snapshotted before authentication so later caller mutation cannot alter the
|
|
597
597
|
handshake.
|
|
598
598
|
|
|
599
|
+
If your client has a custom `http_client:` or a configured
|
|
600
|
+
`OpenAI::NetHTTPClient`, supply a compatible `transport:` with the required
|
|
601
|
+
WebSocket connection settings. Otherwise, the SDK rejects the connection
|
|
602
|
+
before reading credentials. This also applies to transcription, call sideband
|
|
603
|
+
and Translation connections.
|
|
604
|
+
|
|
599
605
|
## Current scope
|
|
600
606
|
|
|
601
607
|
The examples in this guide cover local function calling, image input, and MCP
|
data/responses-websocket.md
CHANGED
|
@@ -155,6 +155,54 @@ compatible event bytes retained for collection. Choose budgets for legitimate
|
|
|
155
155
|
large output, including images and tool results. Queue overflow closes the
|
|
156
156
|
session's connection; collection overflow leaves raw events and other lanes usable.
|
|
157
157
|
|
|
158
|
+
### Bound a caller-fed preview
|
|
159
|
+
|
|
160
|
+
`OpenAI::Responses::IncrementalResponse` builds provisional output from events
|
|
161
|
+
you feed it. Use a separate instance for each lane. It does not read, close, or
|
|
162
|
+
write to the connection. Tools remain data. Its `output` may be unavailable
|
|
163
|
+
if the events do not contain enough information; its admitted terminal event
|
|
164
|
+
stays exact, including an absent output field. Call `reset` to discard only
|
|
165
|
+
the preview's state.
|
|
166
|
+
|
|
167
|
+
Session limits govern the session's queues and final-response collector.
|
|
168
|
+
They do not bound a separate `IncrementalResponse`. Choose a finite budget
|
|
169
|
+
for the encoded events that you feed to each preview and a finite lifetime.
|
|
170
|
+
Check the complete event before every `add`, including unknowns, errors, and
|
|
171
|
+
terminal events. Stop feeding when an event would exceed the budget. Never
|
|
172
|
+
report a completed preview for a terminal event that you did not admit.
|
|
173
|
+
|
|
174
|
+
The runnable [preview example](examples/responses/websocket_workflows.rb)
|
|
175
|
+
sets a decoded per-message cap, uses the session's separate limits, and applies
|
|
176
|
+
a 4 MiB cumulative preview budget with a 15-second lifetime:
|
|
177
|
+
|
|
178
|
+
```sh
|
|
179
|
+
bundle exec ruby examples/responses/websocket_workflows.rb preview
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
`preview_lane` uses the model's `deep_to_h` for known events and the raw
|
|
183
|
+
`to_h` for unknown events. It counts the UTF-8 bytes in the encoded JSON,
|
|
184
|
+
including nested and unknown fields. These are encoded event bytes, not the
|
|
185
|
+
original wire bytes or a bound on total heap memory. It also checks a
|
|
186
|
+
monotonic deadline while draining queued events; the
|
|
187
|
+
Async timeout interrupts an idle wait. Choose budgets large enough for legitimate
|
|
188
|
+
image, audio, tool, or other large output in your application.
|
|
189
|
+
|
|
190
|
+
The result has `outcome: :terminal`, `:budget_exceeded`, or `:timeout`.
|
|
191
|
+
Only `:terminal` includes `terminal_event`, the exact admitted completion,
|
|
192
|
+
failure, incomplete, or error event. Inspect that event's type and status.
|
|
193
|
+
A stop after a read can include `last_received_event`. With `:budget_exceeded`,
|
|
194
|
+
the event was not admitted to the preview. With `:timeout`, it may already
|
|
195
|
+
have been admitted; a terminal event can cross the deadline during preview
|
|
196
|
+
assembly. This field reports what was read and does not guarantee that the
|
|
197
|
+
event is safe to process again. Only `outcome: :terminal` reports a completed
|
|
198
|
+
preview.
|
|
199
|
+
|
|
200
|
+
Raw events, lane finals and other lanes keep their normal SDK contracts.
|
|
201
|
+
A preview timeout or budget stop resets the preview; it does not close the
|
|
202
|
+
lane, cancel the response, or choose a continuation for you. The outer session
|
|
203
|
+
still closes when its owning block exits. EOF, transport failures and other
|
|
204
|
+
cancellation propagate as usual.
|
|
205
|
+
|
|
158
206
|
Register lanes before sending and consume each response before creating another
|
|
159
207
|
on that lane. One Async task reads the physical connection; each lane has one
|
|
160
208
|
consumer, and all session operations use the owning Ruby thread. `lane.receive`
|
|
@@ -329,6 +377,11 @@ acknowledgment, and it does not guarantee that a response stopped executing.
|
|
|
329
377
|
entry point. A nonempty `request_options.extra_query` or nonzero
|
|
330
378
|
`request_options.max_retries` is rejected. Supported workload identity has a
|
|
331
379
|
narrow pre-handshake 401 refresh; that is not live-session recovery.
|
|
380
|
+
- If your client uses a configured HTTP transport, pass a compatible WebSocket
|
|
381
|
+
`transport:` with its own connection settings. The default WebSocket transport
|
|
382
|
+
cannot carry over HTTP connection policies. It rejects that configuration
|
|
383
|
+
before requesting credentials or opening a socket. Default HTTP clients and
|
|
384
|
+
their copies keep using the default WebSocket transport.
|
|
332
385
|
- Large events are valid. Plan memory and application backpressure for your
|
|
333
386
|
workload without treating a fixed payload size as a protocol maximum.
|
|
334
387
|
|
|
@@ -35,15 +35,7 @@ module OpenAI
|
|
|
35
35
|
OpenAI::Models::Live::fork_client_event
|
|
36
36
|
| ::Hash[Symbol | String, untyped]
|
|
37
37
|
type sideband_connection_client_event =
|
|
38
|
-
OpenAI::Models::Live::
|
|
39
|
-
| OpenAI::Models::Live::InputAudioMuteEvent
|
|
40
|
-
| OpenAI::Models::Live::InputAudioUnmuteEvent
|
|
41
|
-
| OpenAI::Models::Live::InstructionsAppendEvent
|
|
42
|
-
| OpenAI::Models::Live::ThinkingAppendEvent
|
|
43
|
-
| OpenAI::Models::Live::CommentaryAppendEvent
|
|
44
|
-
| OpenAI::Models::Live::ResponseItemCreateEvent
|
|
45
|
-
| OpenAI::Models::Live::ResponseCreateEvent
|
|
46
|
-
| OpenAI::Models::Live::SessionCloseEvent
|
|
38
|
+
OpenAI::Models::Live::sideband_client_event
|
|
47
39
|
| ::Hash[Symbol | String, untyped]
|
|
48
40
|
|
|
49
41
|
class UnknownServerEvent
|
|
@@ -32,8 +32,14 @@ module OpenAI
|
|
|
32
32
|
) -> nil
|
|
33
33
|
|
|
34
34
|
# @api private
|
|
35
|
-
def
|
|
35
|
+
def send_response_create: (
|
|
36
36
|
OpenAI::Models::Responses::connection_client_event event
|
|
37
|
+
) -> nil
|
|
38
|
+
|
|
39
|
+
# @api private
|
|
40
|
+
def encode_client_event: (
|
|
41
|
+
OpenAI::Models::Responses::connection_client_event event,
|
|
42
|
+
?response_create: bool
|
|
37
43
|
) -> ::Hash[Symbol, untyped]
|
|
38
44
|
|
|
39
45
|
# @api private
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
module OpenAI
|
|
2
2
|
module Helpers
|
|
3
3
|
module StructuredOutput
|
|
4
|
+
module RequestWithFormatUpdate
|
|
5
|
+
attr_accessor text_model: top
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
# @api private
|
|
9
|
+
def self.prepare_configuration_updates!: [K, V] (
|
|
10
|
+
::Hash[K, V] request
|
|
11
|
+
) -> ::Hash[K, V]
|
|
12
|
+
|
|
4
13
|
class BaseModel < OpenAI::Internal::Type::BaseModel
|
|
5
14
|
def self.optional: -> bot
|
|
6
15
|
def self.to_json_schema: -> Hash[Symbol, untyped]
|
|
@@ -39,6 +39,10 @@ module OpenAI
|
|
|
39
39
|
state: OpenAI::Internal::Type::Converter::coerce_state
|
|
40
40
|
) -> top
|
|
41
41
|
|
|
42
|
+
def variant_for_dump: (
|
|
43
|
+
top value
|
|
44
|
+
) -> OpenAI::Internal::Type::Converter::input?
|
|
45
|
+
|
|
42
46
|
def dump: (
|
|
43
47
|
top value,
|
|
44
48
|
state: OpenAI::Internal::Type::Converter::dump_state
|