openai 0.114.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 +36 -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 +25 -1
|
@@ -47,6 +47,12 @@ module OpenAI
|
|
|
47
47
|
# @return [Hash{Symbol=>String}, nil]
|
|
48
48
|
optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true
|
|
49
49
|
|
|
50
|
+
# @!attribute review
|
|
51
|
+
# Action review mode. Omit to use none.
|
|
52
|
+
#
|
|
53
|
+
# @return [Symbol, OpenAI::Models::Beta::Agents::SessionCreateParams::Review, nil]
|
|
54
|
+
optional :review, enum: -> { OpenAI::Beta::Agents::SessionCreateParams::Review }
|
|
55
|
+
|
|
50
56
|
# @!attribute spend_control
|
|
51
57
|
# Optional spending limit in USD cents. Omission or null creates an unlimited
|
|
52
58
|
# session.
|
|
@@ -66,7 +72,7 @@ module OpenAI
|
|
|
66
72
|
# @return [Array<String>, nil]
|
|
67
73
|
optional :vault_ids, OpenAI::Internal::Type::ArrayOf[String], nil?: true
|
|
68
74
|
|
|
69
|
-
# @!method initialize(environment:, agent: nil, agent_id: nil, input: nil, metadata: nil, spend_control: nil, vault_ids: nil, request_options: {})
|
|
75
|
+
# @!method initialize(environment:, agent: nil, agent_id: nil, input: nil, metadata: nil, review: nil, spend_control: nil, vault_ids: nil, request_options: {})
|
|
70
76
|
# @param environment [OpenAI::Models::Beta::EnvironmentParam::None, OpenAI::Models::Beta::EnvironmentParam::OpenAIHosted, OpenAI::Models::Beta::EnvironmentParam::SelfHosted]
|
|
71
77
|
# An inline execution environment or a reference to an environment template.
|
|
72
78
|
#
|
|
@@ -88,6 +94,9 @@ module OpenAI
|
|
|
88
94
|
# Up to 16 string key-value pairs, with keys up to 64 and values up to 512
|
|
89
95
|
# characters. Omission or null defaults to an empty map.
|
|
90
96
|
#
|
|
97
|
+
# @param review [Symbol, OpenAI::Models::Beta::Agents::SessionCreateParams::Review]
|
|
98
|
+
# Action review mode. Omit to use none.
|
|
99
|
+
#
|
|
91
100
|
# @param spend_control [OpenAI::Models::Beta::Agents::SessionCreateParams::SpendControl, nil]
|
|
92
101
|
# Optional spending limit in USD cents. Omission or null creates an unlimited
|
|
93
102
|
# session.
|
|
@@ -98,6 +107,27 @@ module OpenAI
|
|
|
98
107
|
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
|
|
99
108
|
|
|
100
109
|
class Agent < OpenAI::Internal::Type::BaseModel
|
|
110
|
+
# @!attribute compaction
|
|
111
|
+
# Context compaction settings. Omit to keep the current settings. A supplied
|
|
112
|
+
# object replaces the settings; null or an empty object enables background
|
|
113
|
+
# compaction.
|
|
114
|
+
#
|
|
115
|
+
# @return [OpenAI::Models::Beta::Agents::SessionCreateParams::Agent::Compaction, nil]
|
|
116
|
+
optional(
|
|
117
|
+
:compaction,
|
|
118
|
+
-> {
|
|
119
|
+
OpenAI::Beta::Agents::SessionCreateParams::Agent::Compaction
|
|
120
|
+
},
|
|
121
|
+
nil?: true
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
# @!attribute experimental
|
|
125
|
+
# Experimental settings to merge by key. Omitted settings keep their current
|
|
126
|
+
# values.
|
|
127
|
+
#
|
|
128
|
+
# @return [OpenAI::Models::Beta::Agents::SessionCreateParams::Agent::Experimental, nil]
|
|
129
|
+
optional :experimental, -> { OpenAI::Beta::Agents::SessionCreateParams::Agent::Experimental }
|
|
130
|
+
|
|
101
131
|
# @!attribute instructions
|
|
102
132
|
# Additional instructions appended to the agent's default base instructions. Omit
|
|
103
133
|
# to leave unchanged.
|
|
@@ -154,10 +184,19 @@ module OpenAI
|
|
|
154
184
|
nil?: true
|
|
155
185
|
)
|
|
156
186
|
|
|
157
|
-
# @!method initialize(instructions: nil, model: nil, multi_agent: nil, reasoning: nil, service_tier: nil, text: nil, tools: nil)
|
|
187
|
+
# @!method initialize(compaction: nil, experimental: nil, instructions: nil, model: nil, multi_agent: nil, reasoning: nil, service_tier: nil, text: nil, tools: nil)
|
|
158
188
|
# Agent configuration. With `agent_id`, supplied fields override the saved agent
|
|
159
189
|
# for this session. Without `agent_id`, `model` is required.
|
|
160
190
|
#
|
|
191
|
+
# @param compaction [OpenAI::Models::Beta::Agents::SessionCreateParams::Agent::Compaction, nil]
|
|
192
|
+
# Context compaction settings. Omit to keep the current settings. A supplied
|
|
193
|
+
# object replaces the settings; null or an empty object enables background
|
|
194
|
+
# compaction.
|
|
195
|
+
#
|
|
196
|
+
# @param experimental [OpenAI::Models::Beta::Agents::SessionCreateParams::Agent::Experimental]
|
|
197
|
+
# Experimental settings to merge by key. Omitted settings keep their current
|
|
198
|
+
# values.
|
|
199
|
+
#
|
|
161
200
|
# @param instructions [String, nil]
|
|
162
201
|
# Additional instructions appended to the agent's default base instructions. Omit
|
|
163
202
|
# to leave unchanged.
|
|
@@ -183,6 +222,45 @@ module OpenAI
|
|
|
183
222
|
# resolved tool list must fit within 3 MiB (3,145,728 bytes) of compact UTF-8
|
|
184
223
|
# JSON.
|
|
185
224
|
|
|
225
|
+
# @see OpenAI::Models::Beta::Agents::SessionCreateParams::Agent#compaction
|
|
226
|
+
class Compaction < OpenAI::Internal::Type::BaseModel
|
|
227
|
+
# @!attribute async
|
|
228
|
+
# Whether to compact context in the background. Omission or null defaults to true.
|
|
229
|
+
# Set to false to use blocking compaction. Background compaction may increase
|
|
230
|
+
# token usage.
|
|
231
|
+
#
|
|
232
|
+
# @return [Boolean, nil]
|
|
233
|
+
optional :async, OpenAI::Internal::Type::Boolean, nil?: true
|
|
234
|
+
|
|
235
|
+
# @!method initialize(async: nil)
|
|
236
|
+
# Context compaction settings. Omit to keep the current settings. A supplied
|
|
237
|
+
# object replaces the settings; null or an empty object enables background
|
|
238
|
+
# compaction.
|
|
239
|
+
#
|
|
240
|
+
# @param async [Boolean, nil]
|
|
241
|
+
# Whether to compact context in the background. Omission or null defaults to true.
|
|
242
|
+
# Set to false to use blocking compaction. Background compaction may increase
|
|
243
|
+
# token usage.
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
# @see OpenAI::Models::Beta::Agents::SessionCreateParams::Agent#experimental
|
|
247
|
+
class Experimental < OpenAI::Internal::Type::BaseModel
|
|
248
|
+
# @!attribute time_awareness
|
|
249
|
+
# Whether to give the model periodic current-time reminders. Omit to keep the
|
|
250
|
+
# current setting.
|
|
251
|
+
#
|
|
252
|
+
# @return [Boolean, nil]
|
|
253
|
+
optional :time_awareness, OpenAI::Internal::Type::Boolean
|
|
254
|
+
|
|
255
|
+
# @!method initialize(time_awareness: nil)
|
|
256
|
+
# Experimental settings to merge by key. Omitted settings keep their current
|
|
257
|
+
# values.
|
|
258
|
+
#
|
|
259
|
+
# @param time_awareness [Boolean]
|
|
260
|
+
# Whether to give the model periodic current-time reminders. Omit to keep the
|
|
261
|
+
# current setting.
|
|
262
|
+
end
|
|
263
|
+
|
|
186
264
|
# The service tier used for model requests.
|
|
187
265
|
#
|
|
188
266
|
# @see OpenAI::Models::Beta::Agents::SessionCreateParams::Agent#service_tier
|
|
@@ -232,6 +310,20 @@ module OpenAI
|
|
|
232
310
|
]
|
|
233
311
|
end
|
|
234
312
|
|
|
313
|
+
# Action review mode. Omit to use none.
|
|
314
|
+
module Review
|
|
315
|
+
extend OpenAI::Internal::Type::Enum
|
|
316
|
+
|
|
317
|
+
# Keep the existing execution behavior without automatic action review.
|
|
318
|
+
NONE = :none
|
|
319
|
+
|
|
320
|
+
# Review eligible actions automatically. Deny manual approval fallbacks.
|
|
321
|
+
AUTO_REVIEW = :auto_review
|
|
322
|
+
|
|
323
|
+
# @!method self.values
|
|
324
|
+
# @return [Array<Symbol>]
|
|
325
|
+
end
|
|
326
|
+
|
|
235
327
|
class SpendControl < OpenAI::Internal::Type::BaseModel
|
|
236
328
|
# @!attribute limit
|
|
237
329
|
# Positive USD cents, or null to remove the limit.
|
|
@@ -28,13 +28,22 @@ module OpenAI
|
|
|
28
28
|
# @return [Integer, nil]
|
|
29
29
|
optional :limit, Integer
|
|
30
30
|
|
|
31
|
+
# @!attribute metadata
|
|
32
|
+
# Exact string matches supplied as `metadata[key]=value`. All supplied pairs must
|
|
33
|
+
# match. Up to 16 pairs, with keys from 1 to 64 characters and values up to 512
|
|
34
|
+
# characters. New sessions and metadata updates may take time to appear in
|
|
35
|
+
# filtered results.
|
|
36
|
+
#
|
|
37
|
+
# @return [Hash{Symbol=>String}, nil]
|
|
38
|
+
optional :metadata, OpenAI::Internal::Type::HashOf[String]
|
|
39
|
+
|
|
31
40
|
# @!attribute order
|
|
32
41
|
# The order in which resources are returned. Defaults to `desc`.
|
|
33
42
|
#
|
|
34
43
|
# @return [Symbol, OpenAI::Models::Beta::Agents::SessionListParams::Order, nil]
|
|
35
44
|
optional :order, enum: -> { OpenAI::Beta::Agents::SessionListParams::Order }
|
|
36
45
|
|
|
37
|
-
# @!method initialize(after: nil, agent_id: nil, limit: nil, order: nil, request_options: {})
|
|
46
|
+
# @!method initialize(after: nil, agent_id: nil, limit: nil, metadata: nil, order: nil, request_options: {})
|
|
38
47
|
# @param after [String]
|
|
39
48
|
# Return resources after this resource ID in the selected order.
|
|
40
49
|
#
|
|
@@ -45,6 +54,12 @@ module OpenAI
|
|
|
45
54
|
# @param limit [Integer]
|
|
46
55
|
# The maximum number of resources to return, between 1 and 100. Defaults to 20.
|
|
47
56
|
#
|
|
57
|
+
# @param metadata [Hash{Symbol=>String}]
|
|
58
|
+
# Exact string matches supplied as `metadata[key]=value`. All supplied pairs must
|
|
59
|
+
# match. Up to 16 pairs, with keys from 1 to 64 characters and values up to 512
|
|
60
|
+
# characters. New sessions and metadata updates may take time to appear in
|
|
61
|
+
# filtered results.
|
|
62
|
+
#
|
|
48
63
|
# @param order [Symbol, OpenAI::Models::Beta::Agents::SessionListParams::Order]
|
|
49
64
|
# The order in which resources are returned. Defaults to `desc`.
|
|
50
65
|
#
|
|
@@ -15,7 +15,7 @@ module OpenAI
|
|
|
15
15
|
required :session_id, String
|
|
16
16
|
|
|
17
17
|
# @!attribute agent
|
|
18
|
-
#
|
|
18
|
+
# Agent settings to update on this session. Omitted fields stay unchanged.
|
|
19
19
|
#
|
|
20
20
|
# @return [OpenAI::Models::Beta::Agents::SessionUpdateParams::Agent, nil]
|
|
21
21
|
optional :agent, -> { OpenAI::Beta::Agents::SessionUpdateParams::Agent }
|
|
@@ -28,6 +28,13 @@ module OpenAI
|
|
|
28
28
|
# @return [Hash{Symbol=>String}, nil]
|
|
29
29
|
optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true
|
|
30
30
|
|
|
31
|
+
# @!attribute review
|
|
32
|
+
# Default action review for new root turns. Existing turns and their subagents
|
|
33
|
+
# keep their review mode.
|
|
34
|
+
#
|
|
35
|
+
# @return [Symbol, OpenAI::Models::Beta::Agents::SessionUpdateParams::Review, nil]
|
|
36
|
+
optional :review, enum: -> { OpenAI::Beta::Agents::SessionUpdateParams::Review }
|
|
37
|
+
|
|
31
38
|
# @!attribute spend_control
|
|
32
39
|
# Omit to retain the limit; null or a null limit removes it without resetting
|
|
33
40
|
# spend.
|
|
@@ -41,17 +48,21 @@ module OpenAI
|
|
|
41
48
|
nil?: true
|
|
42
49
|
)
|
|
43
50
|
|
|
44
|
-
# @!method initialize(session_id:, agent: nil, metadata: nil, spend_control: nil, request_options: {})
|
|
51
|
+
# @!method initialize(session_id:, agent: nil, metadata: nil, review: nil, spend_control: nil, request_options: {})
|
|
45
52
|
# @param session_id [String]
|
|
46
53
|
#
|
|
47
54
|
# @param agent [OpenAI::Models::Beta::Agents::SessionUpdateParams::Agent]
|
|
48
|
-
#
|
|
55
|
+
# Agent settings to update on this session. Omitted fields stay unchanged.
|
|
49
56
|
#
|
|
50
57
|
# @param metadata [Hash{Symbol=>String}, nil]
|
|
51
58
|
# Replaces all metadata. Omit to leave unchanged, or pass null or {} to clear it.
|
|
52
59
|
# Up to 16 string key-value pairs, with keys up to 64 and values up to 512
|
|
53
60
|
# characters.
|
|
54
61
|
#
|
|
62
|
+
# @param review [Symbol, OpenAI::Models::Beta::Agents::SessionUpdateParams::Review]
|
|
63
|
+
# Default action review for new root turns. Existing turns and their subagents
|
|
64
|
+
# keep their review mode.
|
|
65
|
+
#
|
|
55
66
|
# @param spend_control [OpenAI::Models::Beta::Agents::SessionUpdateParams::SpendControl, nil]
|
|
56
67
|
# Omit to retain the limit; null or a null limit removes it without resetting
|
|
57
68
|
# spend.
|
|
@@ -81,8 +92,22 @@ module OpenAI
|
|
|
81
92
|
nil?: true
|
|
82
93
|
)
|
|
83
94
|
|
|
84
|
-
# @!
|
|
85
|
-
#
|
|
95
|
+
# @!attribute tools
|
|
96
|
+
# Replaces the session tools. Functions and MCP servers change on the next model
|
|
97
|
+
# call. Built-in tools change by the next turn. Omit to keep the current tools, or
|
|
98
|
+
# pass null or an empty array to clear them.
|
|
99
|
+
#
|
|
100
|
+
# @return [Array<OpenAI::Models::Beta::AgentToolParam::Function, OpenAI::Models::Beta::AgentToolParam::ToolSearch, OpenAI::Models::Beta::AgentToolParam::ProgrammaticToolCalling, OpenAI::Models::Beta::AgentToolParam::Mcp, OpenAI::Models::Beta::AgentToolParam::WebSearch, OpenAI::Models::Beta::AgentToolParam::ComputerUse, OpenAI::Models::Beta::AgentToolParam::Automations>, nil]
|
|
101
|
+
optional(
|
|
102
|
+
:tools,
|
|
103
|
+
-> {
|
|
104
|
+
OpenAI::Internal::Type::ArrayOf[union: OpenAI::Beta::AgentToolParam]
|
|
105
|
+
},
|
|
106
|
+
nil?: true
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
# @!method initialize(model: nil, reasoning: nil, service_tier: nil, tools: nil)
|
|
110
|
+
# Agent settings to update on this session. Omitted fields stay unchanged.
|
|
86
111
|
#
|
|
87
112
|
# @param model [String]
|
|
88
113
|
# The model for subsequent turns. Omit to keep the current model.
|
|
@@ -92,6 +117,11 @@ module OpenAI
|
|
|
92
117
|
#
|
|
93
118
|
# @param service_tier [Symbol, OpenAI::Models::Beta::Agents::SessionUpdateParams::Agent::ServiceTier, nil]
|
|
94
119
|
# Omit to keep the current tier. Null resets it to auto.
|
|
120
|
+
#
|
|
121
|
+
# @param tools [Array<OpenAI::Models::Beta::AgentToolParam::Function, OpenAI::Models::Beta::AgentToolParam::ToolSearch, OpenAI::Models::Beta::AgentToolParam::ProgrammaticToolCalling, OpenAI::Models::Beta::AgentToolParam::Mcp, OpenAI::Models::Beta::AgentToolParam::WebSearch, OpenAI::Models::Beta::AgentToolParam::ComputerUse, OpenAI::Models::Beta::AgentToolParam::Automations>, nil]
|
|
122
|
+
# Replaces the session tools. Functions and MCP servers change on the next model
|
|
123
|
+
# call. Built-in tools change by the next turn. Omit to keep the current tools, or
|
|
124
|
+
# pass null or an empty array to clear them.
|
|
95
125
|
|
|
96
126
|
# @see OpenAI::Models::Beta::Agents::SessionUpdateParams::Agent#reasoning
|
|
97
127
|
class Reasoning < OpenAI::Internal::Type::BaseModel
|
|
@@ -159,6 +189,21 @@ module OpenAI
|
|
|
159
189
|
end
|
|
160
190
|
end
|
|
161
191
|
|
|
192
|
+
# Default action review for new root turns. Existing turns and their subagents
|
|
193
|
+
# keep their review mode.
|
|
194
|
+
module Review
|
|
195
|
+
extend OpenAI::Internal::Type::Enum
|
|
196
|
+
|
|
197
|
+
# Keep the existing execution behavior without automatic action review.
|
|
198
|
+
NONE = :none
|
|
199
|
+
|
|
200
|
+
# Review eligible actions automatically. Deny manual approval fallbacks.
|
|
201
|
+
AUTO_REVIEW = :auto_review
|
|
202
|
+
|
|
203
|
+
# @!method self.values
|
|
204
|
+
# @return [Array<Symbol>]
|
|
205
|
+
end
|
|
206
|
+
|
|
162
207
|
class SpendControl < OpenAI::Internal::Type::BaseModel
|
|
163
208
|
# @!attribute limit
|
|
164
209
|
# Positive USD cents, or null to remove the limit.
|
|
@@ -310,11 +310,29 @@ module OpenAI
|
|
|
310
310
|
|
|
311
311
|
# @!group
|
|
312
312
|
|
|
313
|
+
# @deprecated Announced shutdown date: 2026-12-11. See
|
|
314
|
+
# https://developers.openai.com/api/docs/deprecations for details and recommended
|
|
315
|
+
# replacements.
|
|
313
316
|
GPT_5 = :"gpt-5"
|
|
317
|
+
# @deprecated Announced shutdown date: 2026-12-11. See
|
|
318
|
+
# https://developers.openai.com/api/docs/deprecations for details and recommended
|
|
319
|
+
# replacements.
|
|
314
320
|
GPT_5_MINI = :"gpt-5-mini"
|
|
321
|
+
# @deprecated Announced shutdown date: 2026-12-11. See
|
|
322
|
+
# https://developers.openai.com/api/docs/deprecations for details and recommended
|
|
323
|
+
# replacements.
|
|
315
324
|
GPT_5_NANO = :"gpt-5-nano"
|
|
325
|
+
# @deprecated Announced shutdown date: 2026-12-11. See
|
|
326
|
+
# https://developers.openai.com/api/docs/deprecations for details and recommended
|
|
327
|
+
# replacements.
|
|
316
328
|
GPT_5_2025_08_07 = :"gpt-5-2025-08-07"
|
|
329
|
+
# @deprecated Announced shutdown date: 2026-12-11. See
|
|
330
|
+
# https://developers.openai.com/api/docs/deprecations for details and recommended
|
|
331
|
+
# replacements.
|
|
317
332
|
GPT_5_MINI_2025_08_07 = :"gpt-5-mini-2025-08-07"
|
|
333
|
+
# @deprecated Announced shutdown date: 2026-12-11. See
|
|
334
|
+
# https://developers.openai.com/api/docs/deprecations for details and recommended
|
|
335
|
+
# replacements.
|
|
318
336
|
GPT_5_NANO_2025_08_07 = :"gpt-5-nano-2025-08-07"
|
|
319
337
|
# @deprecated Announced shutdown date: 2027-01-14. See
|
|
320
338
|
# https://developers.openai.com/api/docs/deprecations for details and recommended
|
|
@@ -319,6 +319,23 @@ module OpenAI
|
|
|
319
319
|
# @return [OpenAI::Models::Beta::BetaResponseTextConfig, nil]
|
|
320
320
|
optional :text, -> { OpenAI::Beta::BetaResponseTextConfig }
|
|
321
321
|
|
|
322
|
+
# @!attribute tool_usage
|
|
323
|
+
# Usage reported by hosted tools, separate from base model `usage`. The field can
|
|
324
|
+
# be omitted when tool usage is unavailable. When present, tool families with no
|
|
325
|
+
# recorded usage have zero counts.
|
|
326
|
+
#
|
|
327
|
+
# `image_gen` sums available token counts across image generation calls. Calls
|
|
328
|
+
# with missing or incomplete usage records may be skipped. Output token details
|
|
329
|
+
# and cached input counts can be omitted. An omitted cache count means cache usage
|
|
330
|
+
# is unknown.
|
|
331
|
+
#
|
|
332
|
+
# `web_search.num_requests` counts billable searches. Discounted searches and
|
|
333
|
+
# actions such as opening a page are excluded. Use billing records to reconcile
|
|
334
|
+
# final charges.
|
|
335
|
+
#
|
|
336
|
+
# @return [OpenAI::Models::Beta::BetaResponse::ToolUsage, nil]
|
|
337
|
+
optional :tool_usage, -> { OpenAI::Beta::BetaResponse::ToolUsage }
|
|
338
|
+
|
|
322
339
|
# @!attribute top_logprobs
|
|
323
340
|
# An integer between 0 and 20 specifying the maximum number of most likely tokens
|
|
324
341
|
# to return at each token position, each with an associated log probability. In
|
|
@@ -358,7 +375,7 @@ module OpenAI
|
|
|
358
375
|
# @return [String, nil]
|
|
359
376
|
optional :user, String
|
|
360
377
|
|
|
361
|
-
# @!method initialize(id:, access_programs:, created_at:, error:, incomplete_details:, instructions:, metadata:, model:, output:, parallel_tool_calls:, temperature:, tool_choice:, tools:, top_p:, background: nil, completed_at: nil, conversation: nil, max_output_tokens: nil, max_tool_calls: nil, moderation: nil, previous_response_id: nil, prompt: nil, prompt_cache_diagnostics: nil, prompt_cache_key: nil, prompt_cache_options: nil, prompt_cache_retention: nil, reasoning: nil, safety_identifier: nil, service_tier: nil, status: nil, text: nil, top_logprobs: nil, truncation: nil, usage: nil, user: nil, object: :response)
|
|
378
|
+
# @!method initialize(id:, access_programs:, created_at:, error:, incomplete_details:, instructions:, metadata:, model:, output:, parallel_tool_calls:, temperature:, tool_choice:, tools:, top_p:, background: nil, completed_at: nil, conversation: nil, max_output_tokens: nil, max_tool_calls: nil, moderation: nil, previous_response_id: nil, prompt: nil, prompt_cache_diagnostics: nil, prompt_cache_key: nil, prompt_cache_options: nil, prompt_cache_retention: nil, reasoning: nil, safety_identifier: nil, service_tier: nil, status: nil, text: nil, tool_usage: nil, top_logprobs: nil, truncation: nil, usage: nil, user: nil, object: :response)
|
|
362
379
|
# @param id [String]
|
|
363
380
|
# Unique identifier for this Response.
|
|
364
381
|
#
|
|
@@ -566,6 +583,20 @@ module OpenAI
|
|
|
566
583
|
# - [Text inputs and outputs](https://developers.openai.com/api/docs/guides/text)
|
|
567
584
|
# - [Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs)
|
|
568
585
|
#
|
|
586
|
+
# @param tool_usage [OpenAI::Models::Beta::BetaResponse::ToolUsage]
|
|
587
|
+
# Usage reported by hosted tools, separate from base model `usage`. The field can
|
|
588
|
+
# be omitted when tool usage is unavailable. When present, tool families with no
|
|
589
|
+
# recorded usage have zero counts.
|
|
590
|
+
#
|
|
591
|
+
# `image_gen` sums available token counts across image generation calls. Calls
|
|
592
|
+
# with missing or incomplete usage records may be skipped. Output token details
|
|
593
|
+
# and cached input counts can be omitted. An omitted cache count means cache usage
|
|
594
|
+
# is unknown.
|
|
595
|
+
#
|
|
596
|
+
# `web_search.num_requests` counts billable searches. Discounted searches and
|
|
597
|
+
# actions such as opening a page are excluded. Use billing records to reconcile
|
|
598
|
+
# final charges.
|
|
599
|
+
#
|
|
569
600
|
# @param top_logprobs [Integer, nil]
|
|
570
601
|
# An integer between 0 and 20 specifying the maximum number of most likely tokens
|
|
571
602
|
# to return at each token position, each with an associated log probability. In
|
|
@@ -942,6 +973,9 @@ module OpenAI
|
|
|
942
973
|
# replacements.
|
|
943
974
|
GPT_5_4_NANO = :"gpt-5.4-nano"
|
|
944
975
|
GPT_5_4_MINI_2026_03_17 = :"gpt-5.4-mini-2026-03-17"
|
|
976
|
+
# @deprecated Announced shutdown date: 2027-04-01. See
|
|
977
|
+
# https://developers.openai.com/api/docs/deprecations for details and recommended
|
|
978
|
+
# replacements.
|
|
945
979
|
GPT_5_4_NANO_2026_03_17 = :"gpt-5.4-nano-2026-03-17"
|
|
946
980
|
# @deprecated Announced shutdown date: 2026-08-10. See
|
|
947
981
|
# https://developers.openai.com/api/docs/deprecations for details and recommended
|
|
@@ -959,6 +993,9 @@ module OpenAI
|
|
|
959
993
|
# https://developers.openai.com/api/docs/deprecations for details and recommended
|
|
960
994
|
# replacements.
|
|
961
995
|
GPT_5_1 = :"gpt-5.1"
|
|
996
|
+
# @deprecated Announced shutdown date: 2027-04-01. See
|
|
997
|
+
# https://developers.openai.com/api/docs/deprecations for details and recommended
|
|
998
|
+
# replacements.
|
|
962
999
|
GPT_5_1_2025_11_13 = :"gpt-5.1-2025-11-13"
|
|
963
1000
|
# @deprecated Announced shutdown date: 2026-07-23. See
|
|
964
1001
|
# https://developers.openai.com/api/docs/deprecations for details and recommended
|
|
@@ -2108,6 +2145,192 @@ module OpenAI
|
|
|
2108
2145
|
# @return [Array<Symbol>]
|
|
2109
2146
|
end
|
|
2110
2147
|
|
|
2148
|
+
# @see OpenAI::Models::Beta::BetaResponse#tool_usage
|
|
2149
|
+
class ToolUsage < OpenAI::Internal::Type::BaseModel
|
|
2150
|
+
# @!attribute image_gen
|
|
2151
|
+
# Aggregated usage statistics for image generation tool calls.
|
|
2152
|
+
#
|
|
2153
|
+
# @return [OpenAI::Models::Beta::BetaResponse::ToolUsage::ImageGen]
|
|
2154
|
+
required :image_gen, -> { OpenAI::Beta::BetaResponse::ToolUsage::ImageGen }
|
|
2155
|
+
|
|
2156
|
+
# @!attribute web_search
|
|
2157
|
+
# Aggregated billable usage statistics for web search tool calls.
|
|
2158
|
+
#
|
|
2159
|
+
# @return [OpenAI::Models::Beta::BetaResponse::ToolUsage::WebSearch]
|
|
2160
|
+
required :web_search, -> { OpenAI::Beta::BetaResponse::ToolUsage::WebSearch }
|
|
2161
|
+
|
|
2162
|
+
# @!method initialize(image_gen:, web_search:)
|
|
2163
|
+
# Usage reported by hosted tools, separate from base model `usage`. The field can
|
|
2164
|
+
# be omitted when tool usage is unavailable. When present, tool families with no
|
|
2165
|
+
# recorded usage have zero counts.
|
|
2166
|
+
#
|
|
2167
|
+
# `image_gen` sums available token counts across image generation calls. Calls
|
|
2168
|
+
# with missing or incomplete usage records may be skipped. Output token details
|
|
2169
|
+
# and cached input counts can be omitted. An omitted cache count means cache usage
|
|
2170
|
+
# is unknown.
|
|
2171
|
+
#
|
|
2172
|
+
# `web_search.num_requests` counts billable searches. Discounted searches and
|
|
2173
|
+
# actions such as opening a page are excluded. Use billing records to reconcile
|
|
2174
|
+
# final charges.
|
|
2175
|
+
#
|
|
2176
|
+
# @param image_gen [OpenAI::Models::Beta::BetaResponse::ToolUsage::ImageGen]
|
|
2177
|
+
# Aggregated usage statistics for image generation tool calls.
|
|
2178
|
+
#
|
|
2179
|
+
# @param web_search [OpenAI::Models::Beta::BetaResponse::ToolUsage::WebSearch]
|
|
2180
|
+
# Aggregated billable usage statistics for web search tool calls.
|
|
2181
|
+
|
|
2182
|
+
# @see OpenAI::Models::Beta::BetaResponse::ToolUsage#image_gen
|
|
2183
|
+
class ImageGen < OpenAI::Internal::Type::BaseModel
|
|
2184
|
+
# @!attribute input_tokens
|
|
2185
|
+
# The number of tokens (images and text) in the input prompt.
|
|
2186
|
+
#
|
|
2187
|
+
# @return [Integer]
|
|
2188
|
+
required :input_tokens, Integer
|
|
2189
|
+
|
|
2190
|
+
# @!attribute input_tokens_details
|
|
2191
|
+
# The input tokens detailed information for the image generation.
|
|
2192
|
+
#
|
|
2193
|
+
# @return [OpenAI::Models::Beta::BetaResponse::ToolUsage::ImageGen::InputTokensDetails]
|
|
2194
|
+
required :input_tokens_details, -> { OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::InputTokensDetails }
|
|
2195
|
+
|
|
2196
|
+
# @!attribute output_tokens
|
|
2197
|
+
# The number of output tokens generated by the model.
|
|
2198
|
+
#
|
|
2199
|
+
# @return [Integer]
|
|
2200
|
+
required :output_tokens, Integer
|
|
2201
|
+
|
|
2202
|
+
# @!attribute total_tokens
|
|
2203
|
+
# The total number of tokens (images and text) used for the image generation.
|
|
2204
|
+
#
|
|
2205
|
+
# @return [Integer]
|
|
2206
|
+
required :total_tokens, Integer
|
|
2207
|
+
|
|
2208
|
+
# @!attribute cached_tokens
|
|
2209
|
+
#
|
|
2210
|
+
# @return [Integer, nil]
|
|
2211
|
+
optional :cached_tokens, Integer
|
|
2212
|
+
|
|
2213
|
+
# @!attribute cached_tokens_details
|
|
2214
|
+
#
|
|
2215
|
+
# @return [OpenAI::Models::Beta::BetaResponse::ToolUsage::ImageGen::CachedTokensDetails, nil]
|
|
2216
|
+
optional(
|
|
2217
|
+
:cached_tokens_details,
|
|
2218
|
+
-> { OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::CachedTokensDetails }
|
|
2219
|
+
)
|
|
2220
|
+
|
|
2221
|
+
# @!attribute output_tokens_details
|
|
2222
|
+
# The output token details for the image generation.
|
|
2223
|
+
#
|
|
2224
|
+
# @return [OpenAI::Models::Beta::BetaResponse::ToolUsage::ImageGen::OutputTokensDetails, nil]
|
|
2225
|
+
optional(
|
|
2226
|
+
:output_tokens_details,
|
|
2227
|
+
-> { OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::OutputTokensDetails }
|
|
2228
|
+
)
|
|
2229
|
+
|
|
2230
|
+
# @!method initialize(input_tokens:, input_tokens_details:, output_tokens:, total_tokens:, cached_tokens: nil, cached_tokens_details: nil, output_tokens_details: nil)
|
|
2231
|
+
# Aggregated usage statistics for image generation tool calls.
|
|
2232
|
+
#
|
|
2233
|
+
# @param input_tokens [Integer]
|
|
2234
|
+
# The number of tokens (images and text) in the input prompt.
|
|
2235
|
+
#
|
|
2236
|
+
# @param input_tokens_details [OpenAI::Models::Beta::BetaResponse::ToolUsage::ImageGen::InputTokensDetails]
|
|
2237
|
+
# The input tokens detailed information for the image generation.
|
|
2238
|
+
#
|
|
2239
|
+
# @param output_tokens [Integer]
|
|
2240
|
+
# The number of output tokens generated by the model.
|
|
2241
|
+
#
|
|
2242
|
+
# @param total_tokens [Integer]
|
|
2243
|
+
# The total number of tokens (images and text) used for the image generation.
|
|
2244
|
+
#
|
|
2245
|
+
# @param cached_tokens [Integer]
|
|
2246
|
+
#
|
|
2247
|
+
# @param cached_tokens_details [OpenAI::Models::Beta::BetaResponse::ToolUsage::ImageGen::CachedTokensDetails]
|
|
2248
|
+
#
|
|
2249
|
+
# @param output_tokens_details [OpenAI::Models::Beta::BetaResponse::ToolUsage::ImageGen::OutputTokensDetails]
|
|
2250
|
+
# The output token details for the image generation.
|
|
2251
|
+
|
|
2252
|
+
# @see OpenAI::Models::Beta::BetaResponse::ToolUsage::ImageGen#input_tokens_details
|
|
2253
|
+
class InputTokensDetails < OpenAI::Internal::Type::BaseModel
|
|
2254
|
+
# @!attribute image_tokens
|
|
2255
|
+
# The number of image tokens in the input prompt.
|
|
2256
|
+
#
|
|
2257
|
+
# @return [Integer]
|
|
2258
|
+
required :image_tokens, Integer
|
|
2259
|
+
|
|
2260
|
+
# @!attribute text_tokens
|
|
2261
|
+
# The number of text tokens in the input prompt.
|
|
2262
|
+
#
|
|
2263
|
+
# @return [Integer]
|
|
2264
|
+
required :text_tokens, Integer
|
|
2265
|
+
|
|
2266
|
+
# @!method initialize(image_tokens:, text_tokens:)
|
|
2267
|
+
# The input tokens detailed information for the image generation.
|
|
2268
|
+
#
|
|
2269
|
+
# @param image_tokens [Integer]
|
|
2270
|
+
# The number of image tokens in the input prompt.
|
|
2271
|
+
#
|
|
2272
|
+
# @param text_tokens [Integer]
|
|
2273
|
+
# The number of text tokens in the input prompt.
|
|
2274
|
+
end
|
|
2275
|
+
|
|
2276
|
+
# @see OpenAI::Models::Beta::BetaResponse::ToolUsage::ImageGen#cached_tokens_details
|
|
2277
|
+
class CachedTokensDetails < OpenAI::Internal::Type::BaseModel
|
|
2278
|
+
# @!attribute cached_image_tokens
|
|
2279
|
+
#
|
|
2280
|
+
# @return [Integer]
|
|
2281
|
+
required :cached_image_tokens, Integer
|
|
2282
|
+
|
|
2283
|
+
# @!attribute cached_text_tokens
|
|
2284
|
+
#
|
|
2285
|
+
# @return [Integer]
|
|
2286
|
+
required :cached_text_tokens, Integer
|
|
2287
|
+
|
|
2288
|
+
# @!method initialize(cached_image_tokens:, cached_text_tokens:)
|
|
2289
|
+
# @param cached_image_tokens [Integer]
|
|
2290
|
+
# @param cached_text_tokens [Integer]
|
|
2291
|
+
end
|
|
2292
|
+
|
|
2293
|
+
# @see OpenAI::Models::Beta::BetaResponse::ToolUsage::ImageGen#output_tokens_details
|
|
2294
|
+
class OutputTokensDetails < OpenAI::Internal::Type::BaseModel
|
|
2295
|
+
# @!attribute image_tokens
|
|
2296
|
+
# The number of image output tokens generated by the model.
|
|
2297
|
+
#
|
|
2298
|
+
# @return [Integer]
|
|
2299
|
+
required :image_tokens, Integer
|
|
2300
|
+
|
|
2301
|
+
# @!attribute text_tokens
|
|
2302
|
+
# The number of text output tokens generated by the model.
|
|
2303
|
+
#
|
|
2304
|
+
# @return [Integer]
|
|
2305
|
+
required :text_tokens, Integer
|
|
2306
|
+
|
|
2307
|
+
# @!method initialize(image_tokens:, text_tokens:)
|
|
2308
|
+
# The output token details for the image generation.
|
|
2309
|
+
#
|
|
2310
|
+
# @param image_tokens [Integer]
|
|
2311
|
+
# The number of image output tokens generated by the model.
|
|
2312
|
+
#
|
|
2313
|
+
# @param text_tokens [Integer]
|
|
2314
|
+
# The number of text output tokens generated by the model.
|
|
2315
|
+
end
|
|
2316
|
+
end
|
|
2317
|
+
|
|
2318
|
+
# @see OpenAI::Models::Beta::BetaResponse::ToolUsage#web_search
|
|
2319
|
+
class WebSearch < OpenAI::Internal::Type::BaseModel
|
|
2320
|
+
# @!attribute num_requests
|
|
2321
|
+
# The number of billable web search requests issued.
|
|
2322
|
+
#
|
|
2323
|
+
# @return [Integer]
|
|
2324
|
+
required :num_requests, Integer
|
|
2325
|
+
|
|
2326
|
+
# @!method initialize(num_requests:)
|
|
2327
|
+
# Aggregated billable usage statistics for web search tool calls.
|
|
2328
|
+
#
|
|
2329
|
+
# @param num_requests [Integer]
|
|
2330
|
+
# The number of billable web search requests issued.
|
|
2331
|
+
end
|
|
2332
|
+
end
|
|
2333
|
+
|
|
2111
2334
|
# The truncation strategy to use for the model response.
|
|
2112
2335
|
#
|
|
2113
2336
|
# - `auto`: If the input to this Response exceeds the model's context window size,
|
|
@@ -28,9 +28,15 @@ module OpenAI
|
|
|
28
28
|
# @return [OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Reasoning, nil]
|
|
29
29
|
optional :reasoning, -> { OpenAI::Beta::BetaResponseConfigurationUpdateItem::Reasoning }
|
|
30
30
|
|
|
31
|
-
# @!
|
|
32
|
-
#
|
|
33
|
-
#
|
|
31
|
+
# @!attribute text
|
|
32
|
+
# The text output configuration for subsequent responses.
|
|
33
|
+
#
|
|
34
|
+
# @return [OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Text, nil]
|
|
35
|
+
optional :text, -> { OpenAI::Beta::BetaResponseConfigurationUpdateItem::Text }
|
|
36
|
+
|
|
37
|
+
# @!method initialize(id:, agent: nil, reasoning: nil, text: nil, type: :configuration_update)
|
|
38
|
+
# A configuration update for subsequent responses. Each setting stays in effect
|
|
39
|
+
# until a later update replaces that setting.
|
|
34
40
|
#
|
|
35
41
|
# @param id [String]
|
|
36
42
|
# The unique ID of the configuration update item.
|
|
@@ -41,6 +47,9 @@ module OpenAI
|
|
|
41
47
|
# @param reasoning [OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Reasoning]
|
|
42
48
|
# The reasoning configuration applied by this update.
|
|
43
49
|
#
|
|
50
|
+
# @param text [OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Text]
|
|
51
|
+
# The text output configuration for subsequent responses.
|
|
52
|
+
#
|
|
44
53
|
# @param type [Symbol, :configuration_update]
|
|
45
54
|
# The item type. Always `configuration_update`.
|
|
46
55
|
|
|
@@ -98,6 +107,58 @@ module OpenAI
|
|
|
98
107
|
# @return [Array<Symbol>]
|
|
99
108
|
end
|
|
100
109
|
end
|
|
110
|
+
|
|
111
|
+
# @see OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem#text
|
|
112
|
+
class Text < OpenAI::Internal::Type::BaseModel
|
|
113
|
+
# @!attribute format_
|
|
114
|
+
# Use a JSON schema for structured output or text to return to plain text.
|
|
115
|
+
#
|
|
116
|
+
# @return [OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Text::Format::Text, OpenAI::Models::Beta::BetaResponseFormatTextJSONSchemaConfig]
|
|
117
|
+
required(
|
|
118
|
+
:format_,
|
|
119
|
+
union: -> { OpenAI::Beta::BetaResponseConfigurationUpdateItem::Text::Format },
|
|
120
|
+
api_name: :format
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
# @!method initialize(format_:)
|
|
124
|
+
# The text output configuration for subsequent responses.
|
|
125
|
+
#
|
|
126
|
+
# @param format_ [OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Text::Format::Text, OpenAI::Models::Beta::BetaResponseFormatTextJSONSchemaConfig]
|
|
127
|
+
# Use a JSON schema for structured output or text to return to plain text.
|
|
128
|
+
|
|
129
|
+
# Use a JSON schema for structured output or text to return to plain text.
|
|
130
|
+
#
|
|
131
|
+
# @see OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Text#format_
|
|
132
|
+
module Format
|
|
133
|
+
extend OpenAI::Internal::Type::Union
|
|
134
|
+
|
|
135
|
+
discriminator :type
|
|
136
|
+
|
|
137
|
+
# Default response format. Used to generate text responses.
|
|
138
|
+
variant :text, -> { OpenAI::Beta::BetaResponseConfigurationUpdateItem::Text::Format::Text }
|
|
139
|
+
|
|
140
|
+
# JSON Schema response format. Used to generate structured JSON responses.
|
|
141
|
+
# Learn more about [Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs).
|
|
142
|
+
variant :json_schema, -> { OpenAI::Beta::BetaResponseFormatTextJSONSchemaConfig }
|
|
143
|
+
|
|
144
|
+
class Text < OpenAI::Internal::Type::BaseModel
|
|
145
|
+
# @!attribute type
|
|
146
|
+
# The type of response format being defined. Always `text`.
|
|
147
|
+
#
|
|
148
|
+
# @return [Symbol, :text]
|
|
149
|
+
required :type, const: :text
|
|
150
|
+
|
|
151
|
+
# @!method initialize(type: :text)
|
|
152
|
+
# Default response format. Used to generate text responses.
|
|
153
|
+
#
|
|
154
|
+
# @param type [Symbol, :text]
|
|
155
|
+
# The type of response format being defined. Always `text`.
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# @!method self.variants
|
|
159
|
+
# @return [Array(OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Text::Format::Text, OpenAI::Models::Beta::BetaResponseFormatTextJSONSchemaConfig)]
|
|
160
|
+
end
|
|
161
|
+
end
|
|
101
162
|
end
|
|
102
163
|
end
|
|
103
164
|
|