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
|
@@ -319,6 +319,23 @@ module OpenAI
|
|
|
319
319
|
# @return [OpenAI::Models::Responses::ResponseTextConfig, nil]
|
|
320
320
|
optional :text, -> { OpenAI::Responses::ResponseTextConfig }
|
|
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::Responses::Response::ToolUsage, nil]
|
|
337
|
+
optional :tool_usage, -> { OpenAI::Responses::Response::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::Responses::Response::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
|
|
@@ -1288,6 +1319,195 @@ module OpenAI
|
|
|
1288
1319
|
# @return [Array<Symbol>]
|
|
1289
1320
|
end
|
|
1290
1321
|
|
|
1322
|
+
# @see OpenAI::Models::Responses::Response#tool_usage
|
|
1323
|
+
class ToolUsage < OpenAI::Internal::Type::BaseModel
|
|
1324
|
+
# @!attribute image_gen
|
|
1325
|
+
# Aggregated usage statistics for image generation tool calls.
|
|
1326
|
+
#
|
|
1327
|
+
# @return [OpenAI::Models::Responses::Response::ToolUsage::ImageGen]
|
|
1328
|
+
required :image_gen, -> { OpenAI::Responses::Response::ToolUsage::ImageGen }
|
|
1329
|
+
|
|
1330
|
+
# @!attribute web_search
|
|
1331
|
+
# Aggregated billable usage statistics for web search tool calls.
|
|
1332
|
+
#
|
|
1333
|
+
# @return [OpenAI::Models::Responses::Response::ToolUsage::WebSearch]
|
|
1334
|
+
required :web_search, -> { OpenAI::Responses::Response::ToolUsage::WebSearch }
|
|
1335
|
+
|
|
1336
|
+
# @!method initialize(image_gen:, web_search:)
|
|
1337
|
+
# Usage reported by hosted tools, separate from base model `usage`. The field can
|
|
1338
|
+
# be omitted when tool usage is unavailable. When present, tool families with no
|
|
1339
|
+
# recorded usage have zero counts.
|
|
1340
|
+
#
|
|
1341
|
+
# `image_gen` sums available token counts across image generation calls. Calls
|
|
1342
|
+
# with missing or incomplete usage records may be skipped. Output token details
|
|
1343
|
+
# and cached input counts can be omitted. An omitted cache count means cache usage
|
|
1344
|
+
# is unknown.
|
|
1345
|
+
#
|
|
1346
|
+
# `web_search.num_requests` counts billable searches. Discounted searches and
|
|
1347
|
+
# actions such as opening a page are excluded. Use billing records to reconcile
|
|
1348
|
+
# final charges.
|
|
1349
|
+
#
|
|
1350
|
+
# @param image_gen [OpenAI::Models::Responses::Response::ToolUsage::ImageGen]
|
|
1351
|
+
# Aggregated usage statistics for image generation tool calls.
|
|
1352
|
+
#
|
|
1353
|
+
# @param web_search [OpenAI::Models::Responses::Response::ToolUsage::WebSearch]
|
|
1354
|
+
# Aggregated billable usage statistics for web search tool calls.
|
|
1355
|
+
|
|
1356
|
+
# @see OpenAI::Models::Responses::Response::ToolUsage#image_gen
|
|
1357
|
+
class ImageGen < OpenAI::Internal::Type::BaseModel
|
|
1358
|
+
# @!attribute input_tokens
|
|
1359
|
+
# The number of tokens (images and text) in the input prompt.
|
|
1360
|
+
#
|
|
1361
|
+
# @return [Integer]
|
|
1362
|
+
required :input_tokens, Integer
|
|
1363
|
+
|
|
1364
|
+
# @!attribute input_tokens_details
|
|
1365
|
+
# The input tokens detailed information for the image generation.
|
|
1366
|
+
#
|
|
1367
|
+
# @return [OpenAI::Models::Responses::Response::ToolUsage::ImageGen::InputTokensDetails]
|
|
1368
|
+
required(
|
|
1369
|
+
:input_tokens_details,
|
|
1370
|
+
-> { OpenAI::Responses::Response::ToolUsage::ImageGen::InputTokensDetails }
|
|
1371
|
+
)
|
|
1372
|
+
|
|
1373
|
+
# @!attribute output_tokens
|
|
1374
|
+
# The number of output tokens generated by the model.
|
|
1375
|
+
#
|
|
1376
|
+
# @return [Integer]
|
|
1377
|
+
required :output_tokens, Integer
|
|
1378
|
+
|
|
1379
|
+
# @!attribute total_tokens
|
|
1380
|
+
# The total number of tokens (images and text) used for the image generation.
|
|
1381
|
+
#
|
|
1382
|
+
# @return [Integer]
|
|
1383
|
+
required :total_tokens, Integer
|
|
1384
|
+
|
|
1385
|
+
# @!attribute cached_tokens
|
|
1386
|
+
#
|
|
1387
|
+
# @return [Integer, nil]
|
|
1388
|
+
optional :cached_tokens, Integer
|
|
1389
|
+
|
|
1390
|
+
# @!attribute cached_tokens_details
|
|
1391
|
+
#
|
|
1392
|
+
# @return [OpenAI::Models::Responses::Response::ToolUsage::ImageGen::CachedTokensDetails, nil]
|
|
1393
|
+
optional(
|
|
1394
|
+
:cached_tokens_details,
|
|
1395
|
+
-> { OpenAI::Responses::Response::ToolUsage::ImageGen::CachedTokensDetails }
|
|
1396
|
+
)
|
|
1397
|
+
|
|
1398
|
+
# @!attribute output_tokens_details
|
|
1399
|
+
# The output token details for the image generation.
|
|
1400
|
+
#
|
|
1401
|
+
# @return [OpenAI::Models::Responses::Response::ToolUsage::ImageGen::OutputTokensDetails, nil]
|
|
1402
|
+
optional(
|
|
1403
|
+
:output_tokens_details,
|
|
1404
|
+
-> { OpenAI::Responses::Response::ToolUsage::ImageGen::OutputTokensDetails }
|
|
1405
|
+
)
|
|
1406
|
+
|
|
1407
|
+
# @!method initialize(input_tokens:, input_tokens_details:, output_tokens:, total_tokens:, cached_tokens: nil, cached_tokens_details: nil, output_tokens_details: nil)
|
|
1408
|
+
# Aggregated usage statistics for image generation tool calls.
|
|
1409
|
+
#
|
|
1410
|
+
# @param input_tokens [Integer]
|
|
1411
|
+
# The number of tokens (images and text) in the input prompt.
|
|
1412
|
+
#
|
|
1413
|
+
# @param input_tokens_details [OpenAI::Models::Responses::Response::ToolUsage::ImageGen::InputTokensDetails]
|
|
1414
|
+
# The input tokens detailed information for the image generation.
|
|
1415
|
+
#
|
|
1416
|
+
# @param output_tokens [Integer]
|
|
1417
|
+
# The number of output tokens generated by the model.
|
|
1418
|
+
#
|
|
1419
|
+
# @param total_tokens [Integer]
|
|
1420
|
+
# The total number of tokens (images and text) used for the image generation.
|
|
1421
|
+
#
|
|
1422
|
+
# @param cached_tokens [Integer]
|
|
1423
|
+
#
|
|
1424
|
+
# @param cached_tokens_details [OpenAI::Models::Responses::Response::ToolUsage::ImageGen::CachedTokensDetails]
|
|
1425
|
+
#
|
|
1426
|
+
# @param output_tokens_details [OpenAI::Models::Responses::Response::ToolUsage::ImageGen::OutputTokensDetails]
|
|
1427
|
+
# The output token details for the image generation.
|
|
1428
|
+
|
|
1429
|
+
# @see OpenAI::Models::Responses::Response::ToolUsage::ImageGen#input_tokens_details
|
|
1430
|
+
class InputTokensDetails < OpenAI::Internal::Type::BaseModel
|
|
1431
|
+
# @!attribute image_tokens
|
|
1432
|
+
# The number of image tokens in the input prompt.
|
|
1433
|
+
#
|
|
1434
|
+
# @return [Integer]
|
|
1435
|
+
required :image_tokens, Integer
|
|
1436
|
+
|
|
1437
|
+
# @!attribute text_tokens
|
|
1438
|
+
# The number of text tokens in the input prompt.
|
|
1439
|
+
#
|
|
1440
|
+
# @return [Integer]
|
|
1441
|
+
required :text_tokens, Integer
|
|
1442
|
+
|
|
1443
|
+
# @!method initialize(image_tokens:, text_tokens:)
|
|
1444
|
+
# The input tokens detailed information for the image generation.
|
|
1445
|
+
#
|
|
1446
|
+
# @param image_tokens [Integer]
|
|
1447
|
+
# The number of image tokens in the input prompt.
|
|
1448
|
+
#
|
|
1449
|
+
# @param text_tokens [Integer]
|
|
1450
|
+
# The number of text tokens in the input prompt.
|
|
1451
|
+
end
|
|
1452
|
+
|
|
1453
|
+
# @see OpenAI::Models::Responses::Response::ToolUsage::ImageGen#cached_tokens_details
|
|
1454
|
+
class CachedTokensDetails < OpenAI::Internal::Type::BaseModel
|
|
1455
|
+
# @!attribute cached_image_tokens
|
|
1456
|
+
#
|
|
1457
|
+
# @return [Integer]
|
|
1458
|
+
required :cached_image_tokens, Integer
|
|
1459
|
+
|
|
1460
|
+
# @!attribute cached_text_tokens
|
|
1461
|
+
#
|
|
1462
|
+
# @return [Integer]
|
|
1463
|
+
required :cached_text_tokens, Integer
|
|
1464
|
+
|
|
1465
|
+
# @!method initialize(cached_image_tokens:, cached_text_tokens:)
|
|
1466
|
+
# @param cached_image_tokens [Integer]
|
|
1467
|
+
# @param cached_text_tokens [Integer]
|
|
1468
|
+
end
|
|
1469
|
+
|
|
1470
|
+
# @see OpenAI::Models::Responses::Response::ToolUsage::ImageGen#output_tokens_details
|
|
1471
|
+
class OutputTokensDetails < OpenAI::Internal::Type::BaseModel
|
|
1472
|
+
# @!attribute image_tokens
|
|
1473
|
+
# The number of image output tokens generated by the model.
|
|
1474
|
+
#
|
|
1475
|
+
# @return [Integer]
|
|
1476
|
+
required :image_tokens, Integer
|
|
1477
|
+
|
|
1478
|
+
# @!attribute text_tokens
|
|
1479
|
+
# The number of text output tokens generated by the model.
|
|
1480
|
+
#
|
|
1481
|
+
# @return [Integer]
|
|
1482
|
+
required :text_tokens, Integer
|
|
1483
|
+
|
|
1484
|
+
# @!method initialize(image_tokens:, text_tokens:)
|
|
1485
|
+
# The output token details for the image generation.
|
|
1486
|
+
#
|
|
1487
|
+
# @param image_tokens [Integer]
|
|
1488
|
+
# The number of image output tokens generated by the model.
|
|
1489
|
+
#
|
|
1490
|
+
# @param text_tokens [Integer]
|
|
1491
|
+
# The number of text output tokens generated by the model.
|
|
1492
|
+
end
|
|
1493
|
+
end
|
|
1494
|
+
|
|
1495
|
+
# @see OpenAI::Models::Responses::Response::ToolUsage#web_search
|
|
1496
|
+
class WebSearch < OpenAI::Internal::Type::BaseModel
|
|
1497
|
+
# @!attribute num_requests
|
|
1498
|
+
# The number of billable web search requests issued.
|
|
1499
|
+
#
|
|
1500
|
+
# @return [Integer]
|
|
1501
|
+
required :num_requests, Integer
|
|
1502
|
+
|
|
1503
|
+
# @!method initialize(num_requests:)
|
|
1504
|
+
# Aggregated billable usage statistics for web search tool calls.
|
|
1505
|
+
#
|
|
1506
|
+
# @param num_requests [Integer]
|
|
1507
|
+
# The number of billable web search requests issued.
|
|
1508
|
+
end
|
|
1509
|
+
end
|
|
1510
|
+
|
|
1291
1511
|
# The truncation strategy to use for the model response.
|
|
1292
1512
|
#
|
|
1293
1513
|
# - `auto`: If the input to this Response exceeds the model's context window size,
|
|
@@ -433,6 +433,9 @@ module OpenAI
|
|
|
433
433
|
# replacements.
|
|
434
434
|
GPT_5_4_NANO = :"gpt-5.4-nano"
|
|
435
435
|
GPT_5_4_MINI_2026_03_17 = :"gpt-5.4-mini-2026-03-17"
|
|
436
|
+
# @deprecated Announced shutdown date: 2027-04-01. See
|
|
437
|
+
# https://developers.openai.com/api/docs/deprecations for details and recommended
|
|
438
|
+
# replacements.
|
|
436
439
|
GPT_5_4_NANO_2026_03_17 = :"gpt-5.4-nano-2026-03-17"
|
|
437
440
|
# @deprecated Announced shutdown date: 2026-08-10. See
|
|
438
441
|
# https://developers.openai.com/api/docs/deprecations for details and recommended
|
|
@@ -450,6 +453,9 @@ module OpenAI
|
|
|
450
453
|
# https://developers.openai.com/api/docs/deprecations for details and recommended
|
|
451
454
|
# replacements.
|
|
452
455
|
GPT_5_1 = :"gpt-5.1"
|
|
456
|
+
# @deprecated Announced shutdown date: 2027-04-01. See
|
|
457
|
+
# https://developers.openai.com/api/docs/deprecations for details and recommended
|
|
458
|
+
# replacements.
|
|
453
459
|
GPT_5_1_2025_11_13 = :"gpt-5.1-2025-11-13"
|
|
454
460
|
# @deprecated Announced shutdown date: 2026-07-23. See
|
|
455
461
|
# https://developers.openai.com/api/docs/deprecations for details and recommended
|
|
@@ -22,9 +22,15 @@ module OpenAI
|
|
|
22
22
|
# @return [OpenAI::Models::Responses::ResponseConfigurationUpdateItem::Reasoning, nil]
|
|
23
23
|
optional :reasoning, -> { OpenAI::Responses::ResponseConfigurationUpdateItem::Reasoning }
|
|
24
24
|
|
|
25
|
-
# @!
|
|
26
|
-
#
|
|
27
|
-
#
|
|
25
|
+
# @!attribute text
|
|
26
|
+
# The text output configuration for subsequent responses.
|
|
27
|
+
#
|
|
28
|
+
# @return [OpenAI::Models::Responses::ResponseConfigurationUpdateItem::Text, nil]
|
|
29
|
+
optional :text, -> { OpenAI::Responses::ResponseConfigurationUpdateItem::Text }
|
|
30
|
+
|
|
31
|
+
# @!method initialize(id:, reasoning: nil, text: nil, type: :configuration_update)
|
|
32
|
+
# A configuration update for subsequent responses. Each setting stays in effect
|
|
33
|
+
# until a later update replaces that setting.
|
|
28
34
|
#
|
|
29
35
|
# @param id [String]
|
|
30
36
|
# The unique ID of the configuration update item.
|
|
@@ -32,6 +38,9 @@ module OpenAI
|
|
|
32
38
|
# @param reasoning [OpenAI::Models::Responses::ResponseConfigurationUpdateItem::Reasoning]
|
|
33
39
|
# The reasoning configuration applied by this update.
|
|
34
40
|
#
|
|
41
|
+
# @param text [OpenAI::Models::Responses::ResponseConfigurationUpdateItem::Text]
|
|
42
|
+
# The text output configuration for subsequent responses.
|
|
43
|
+
#
|
|
35
44
|
# @param type [Symbol, :configuration_update]
|
|
36
45
|
# The item type. Always `configuration_update`.
|
|
37
46
|
|
|
@@ -51,6 +60,44 @@ module OpenAI
|
|
|
51
60
|
# The reasoning effort used for subsequent responses until another configuration
|
|
52
61
|
# update replaces it.
|
|
53
62
|
end
|
|
63
|
+
|
|
64
|
+
# @see OpenAI::Models::Responses::ResponseConfigurationUpdateItem#text
|
|
65
|
+
class Text < OpenAI::Internal::Type::BaseModel
|
|
66
|
+
# @!attribute format_
|
|
67
|
+
# Use a JSON schema for structured output or text to return to plain text.
|
|
68
|
+
#
|
|
69
|
+
# @return [OpenAI::Models::ResponseFormatText, OpenAI::Models::Responses::ResponseFormatTextJSONSchemaConfig]
|
|
70
|
+
required(
|
|
71
|
+
:format_,
|
|
72
|
+
union: -> { OpenAI::Responses::ResponseConfigurationUpdateItem::Text::Format },
|
|
73
|
+
api_name: :format
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
# @!method initialize(format_:)
|
|
77
|
+
# The text output configuration for subsequent responses.
|
|
78
|
+
#
|
|
79
|
+
# @param format_ [OpenAI::Models::ResponseFormatText, OpenAI::Models::Responses::ResponseFormatTextJSONSchemaConfig]
|
|
80
|
+
# Use a JSON schema for structured output or text to return to plain text.
|
|
81
|
+
|
|
82
|
+
# Use a JSON schema for structured output or text to return to plain text.
|
|
83
|
+
#
|
|
84
|
+
# @see OpenAI::Models::Responses::ResponseConfigurationUpdateItem::Text#format_
|
|
85
|
+
module Format
|
|
86
|
+
extend OpenAI::Internal::Type::Union
|
|
87
|
+
|
|
88
|
+
discriminator :type
|
|
89
|
+
|
|
90
|
+
# Default response format. Used to generate text responses.
|
|
91
|
+
variant :text, -> { OpenAI::ResponseFormatText }
|
|
92
|
+
|
|
93
|
+
# JSON Schema response format. Used to generate structured JSON responses.
|
|
94
|
+
# Learn more about [Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs).
|
|
95
|
+
variant :json_schema, -> { OpenAI::Responses::ResponseFormatTextJSONSchemaConfig }
|
|
96
|
+
|
|
97
|
+
# @!method self.variants
|
|
98
|
+
# @return [Array(OpenAI::Models::ResponseFormatText, OpenAI::Models::Responses::ResponseFormatTextJSONSchemaConfig)]
|
|
99
|
+
end
|
|
100
|
+
end
|
|
54
101
|
end
|
|
55
102
|
end
|
|
56
103
|
end
|
|
@@ -22,10 +22,15 @@ module OpenAI
|
|
|
22
22
|
# @return [OpenAI::Models::Responses::ResponseConfigurationUpdateItemParam::Reasoning, nil]
|
|
23
23
|
optional :reasoning, -> { OpenAI::Responses::ResponseConfigurationUpdateItemParam::Reasoning }
|
|
24
24
|
|
|
25
|
-
# @!
|
|
26
|
-
#
|
|
27
|
-
#
|
|
28
|
-
#
|
|
25
|
+
# @!attribute text
|
|
26
|
+
# The text output configuration for subsequent responses.
|
|
27
|
+
#
|
|
28
|
+
# @return [OpenAI::Models::Responses::ResponseConfigurationUpdateItemParam::Text, nil]
|
|
29
|
+
optional :text, -> { OpenAI::Responses::ResponseConfigurationUpdateItemParam::Text }
|
|
30
|
+
|
|
31
|
+
# @!method initialize(id: nil, reasoning: nil, text: nil, type: :configuration_update)
|
|
32
|
+
# An update to the conversation's response configuration. Supply reasoning, text,
|
|
33
|
+
# or both. Each setting stays in effect until a later update replaces it.
|
|
29
34
|
#
|
|
30
35
|
# @param id [String, nil]
|
|
31
36
|
# The unique ID of the configuration update item.
|
|
@@ -33,6 +38,9 @@ module OpenAI
|
|
|
33
38
|
# @param reasoning [OpenAI::Models::Responses::ResponseConfigurationUpdateItemParam::Reasoning]
|
|
34
39
|
# Updates to reasoning configuration. Only effort is supported.
|
|
35
40
|
#
|
|
41
|
+
# @param text [OpenAI::Models::Responses::ResponseConfigurationUpdateItemParam::Text]
|
|
42
|
+
# The text output configuration for subsequent responses.
|
|
43
|
+
#
|
|
36
44
|
# @param type [Symbol, :configuration_update]
|
|
37
45
|
# The item type. Always `configuration_update`.
|
|
38
46
|
|
|
@@ -52,6 +60,44 @@ module OpenAI
|
|
|
52
60
|
# The reasoning effort to use for subsequent responses until another configuration
|
|
53
61
|
# update replaces it.
|
|
54
62
|
end
|
|
63
|
+
|
|
64
|
+
# @see OpenAI::Models::Responses::ResponseConfigurationUpdateItemParam#text
|
|
65
|
+
class Text < OpenAI::Internal::Type::BaseModel
|
|
66
|
+
# @!attribute format_
|
|
67
|
+
# Use a JSON schema for structured output or text to return to plain text.
|
|
68
|
+
#
|
|
69
|
+
# @return [OpenAI::Models::ResponseFormatText, OpenAI::Models::Responses::ResponseFormatTextJSONSchemaConfig]
|
|
70
|
+
required(
|
|
71
|
+
:format_,
|
|
72
|
+
union: -> { OpenAI::Responses::ResponseConfigurationUpdateItemParam::Text::Format },
|
|
73
|
+
api_name: :format
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
# @!method initialize(format_:)
|
|
77
|
+
# The text output configuration for subsequent responses.
|
|
78
|
+
#
|
|
79
|
+
# @param format_ [OpenAI::Models::ResponseFormatText, OpenAI::Models::Responses::ResponseFormatTextJSONSchemaConfig]
|
|
80
|
+
# Use a JSON schema for structured output or text to return to plain text.
|
|
81
|
+
|
|
82
|
+
# Use a JSON schema for structured output or text to return to plain text.
|
|
83
|
+
#
|
|
84
|
+
# @see OpenAI::Models::Responses::ResponseConfigurationUpdateItemParam::Text#format_
|
|
85
|
+
module Format
|
|
86
|
+
extend OpenAI::Internal::Type::Union
|
|
87
|
+
|
|
88
|
+
discriminator :type
|
|
89
|
+
|
|
90
|
+
# Default response format. Used to generate text responses.
|
|
91
|
+
variant :text, -> { OpenAI::ResponseFormatText }
|
|
92
|
+
|
|
93
|
+
# JSON Schema response format. Used to generate structured JSON responses.
|
|
94
|
+
# Learn more about [Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs).
|
|
95
|
+
variant :json_schema, -> { OpenAI::Responses::ResponseFormatTextJSONSchemaConfig }
|
|
96
|
+
|
|
97
|
+
# @!method self.variants
|
|
98
|
+
# @return [Array(OpenAI::Models::ResponseFormatText, OpenAI::Models::Responses::ResponseFormatTextJSONSchemaConfig)]
|
|
99
|
+
end
|
|
100
|
+
end
|
|
55
101
|
end
|
|
56
102
|
end
|
|
57
103
|
end
|
|
@@ -56,9 +56,8 @@ module OpenAI
|
|
|
56
56
|
|
|
57
57
|
variant :additional_tools, -> { OpenAI::Responses::ResponseInputItem::AdditionalTools }
|
|
58
58
|
|
|
59
|
-
# An update to the conversation's response configuration.
|
|
60
|
-
#
|
|
61
|
-
# configuration update.
|
|
59
|
+
# An update to the conversation's response configuration. Supply reasoning,
|
|
60
|
+
# text, or both. Each setting stays in effect until a later update replaces it.
|
|
62
61
|
variant :configuration_update, -> { OpenAI::Responses::ResponseConfigurationUpdateItemParam }
|
|
63
62
|
|
|
64
63
|
# A description of the chain of thought used by a reasoning model while generating
|
|
@@ -40,8 +40,8 @@ module OpenAI
|
|
|
40
40
|
|
|
41
41
|
variant :additional_tools, -> { OpenAI::Responses::ResponseItem::AdditionalTools }
|
|
42
42
|
|
|
43
|
-
# A configuration update
|
|
44
|
-
#
|
|
43
|
+
# A configuration update for subsequent responses. Each setting stays in effect
|
|
44
|
+
# until a later update replaces that setting.
|
|
45
45
|
variant :configuration_update, -> { OpenAI::Responses::ResponseConfigurationUpdateItem }
|
|
46
46
|
|
|
47
47
|
# A description of the chain of thought used by a reasoning model while generating
|
|
@@ -755,8 +755,8 @@ module OpenAI
|
|
|
755
755
|
# @!attribute input_fidelity
|
|
756
756
|
# Control how much effort the model will exert to match the style and features,
|
|
757
757
|
# especially facial features, of input images. Supports `high` and `low` on
|
|
758
|
-
# `gpt-image-1
|
|
759
|
-
#
|
|
758
|
+
# `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
|
|
759
|
+
# this parameter. Defaults to `low` on supported models.
|
|
760
760
|
#
|
|
761
761
|
# @return [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::InputFidelity, nil]
|
|
762
762
|
optional(
|
|
@@ -875,8 +875,8 @@ module OpenAI
|
|
|
875
875
|
# @param input_fidelity [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::InputFidelity, nil]
|
|
876
876
|
# Control how much effort the model will exert to match the style and features,
|
|
877
877
|
# especially facial features, of input images. Supports `high` and `low` on
|
|
878
|
-
# `gpt-image-1
|
|
879
|
-
#
|
|
878
|
+
# `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
|
|
879
|
+
# this parameter. Defaults to `low` on supported models.
|
|
880
880
|
#
|
|
881
881
|
# @param input_image_mask [OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::InputImageMask]
|
|
882
882
|
# Optional mask for inpainting. Contains `image_url` (string, optional) and
|
|
@@ -965,8 +965,8 @@ module OpenAI
|
|
|
965
965
|
|
|
966
966
|
# Control how much effort the model will exert to match the style and features,
|
|
967
967
|
# especially facial features, of input images. Supports `high` and `low` on
|
|
968
|
-
# `gpt-image-1
|
|
969
|
-
#
|
|
968
|
+
# `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
|
|
969
|
+
# this parameter. Defaults to `low` on supported models.
|
|
970
970
|
#
|
|
971
971
|
# @see OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration#input_fidelity
|
|
972
972
|
module InputFidelity
|
|
@@ -96,6 +96,14 @@ module OpenAI
|
|
|
96
96
|
nil?: true
|
|
97
97
|
)
|
|
98
98
|
|
|
99
|
+
# @!attribute generate
|
|
100
|
+
# Whether to generate output for this response. Defaults to true when omitted. Set
|
|
101
|
+
# to false to prepare request state without model output; the response ID can be
|
|
102
|
+
# used as previous_response_id on a later turn.
|
|
103
|
+
#
|
|
104
|
+
# @return [Boolean, nil]
|
|
105
|
+
optional :generate, OpenAI::Internal::Type::Boolean
|
|
106
|
+
|
|
99
107
|
# @!attribute include
|
|
100
108
|
# Specify additional output data to include in the model response. Currently
|
|
101
109
|
# supported values are:
|
|
@@ -463,7 +471,7 @@ module OpenAI
|
|
|
463
471
|
# @return [String, nil]
|
|
464
472
|
optional :user, String
|
|
465
473
|
|
|
466
|
-
# @!method initialize(access_programs: nil, background: nil, context_management: nil, conversation: nil, include: nil, input: nil, instructions: nil, max_output_tokens: nil, max_tool_calls: nil, metadata: nil, model: nil, moderation: nil, parallel_tool_calls: nil, previous_response_id: nil, prompt: nil, prompt_cache_key: nil, prompt_cache_options: nil, prompt_cache_retention: nil, reasoning: nil, safety_identifier: nil, service_tier: nil, store: nil, stream: nil, stream_id: nil, stream_options: nil, temperature: nil, text: nil, tool_choice: nil, tools: nil, top_logprobs: nil, top_p: nil, truncation: nil, user: nil, type: :"response.create")
|
|
474
|
+
# @!method initialize(access_programs: nil, background: nil, context_management: nil, conversation: nil, generate: nil, include: nil, input: nil, instructions: nil, max_output_tokens: nil, max_tool_calls: nil, metadata: nil, model: nil, moderation: nil, parallel_tool_calls: nil, previous_response_id: nil, prompt: nil, prompt_cache_key: nil, prompt_cache_options: nil, prompt_cache_retention: nil, reasoning: nil, safety_identifier: nil, service_tier: nil, store: nil, stream: nil, stream_id: nil, stream_options: nil, temperature: nil, text: nil, tool_choice: nil, tools: nil, top_logprobs: nil, top_p: nil, truncation: nil, user: nil, type: :"response.create")
|
|
467
475
|
# Client event for creating a response over a persistent WebSocket connection.
|
|
468
476
|
# This payload uses the same top-level fields as `POST /v1/responses`, plus
|
|
469
477
|
# WebSocket-only envelope metadata.
|
|
@@ -490,6 +498,11 @@ module OpenAI
|
|
|
490
498
|
# items from this response are automatically added to this conversation after this
|
|
491
499
|
# response completes.
|
|
492
500
|
#
|
|
501
|
+
# @param generate [Boolean]
|
|
502
|
+
# Whether to generate output for this response. Defaults to true when omitted. Set
|
|
503
|
+
# to false to prepare request state without model output; the response ID can be
|
|
504
|
+
# used as previous_response_id on a later turn.
|
|
505
|
+
#
|
|
493
506
|
# @param include [Array<Symbol, OpenAI::Models::Responses::ResponseIncludable>, nil]
|
|
494
507
|
# Specify additional output data to include in the model response. Currently
|
|
495
508
|
# supported values are:
|
|
@@ -636,8 +636,8 @@ module OpenAI
|
|
|
636
636
|
# @!attribute input_fidelity
|
|
637
637
|
# Control how much effort the model will exert to match the style and features,
|
|
638
638
|
# especially facial features, of input images. Supports `high` and `low` on
|
|
639
|
-
# `gpt-image-1
|
|
640
|
-
#
|
|
639
|
+
# `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
|
|
640
|
+
# this parameter. Defaults to `low` on supported models.
|
|
641
641
|
#
|
|
642
642
|
# @return [Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::InputFidelity, nil]
|
|
643
643
|
optional(
|
|
@@ -738,8 +738,8 @@ module OpenAI
|
|
|
738
738
|
# @param input_fidelity [Symbol, OpenAI::Models::Responses::Tool::ImageGeneration::InputFidelity, nil]
|
|
739
739
|
# Control how much effort the model will exert to match the style and features,
|
|
740
740
|
# especially facial features, of input images. Supports `high` and `low` on
|
|
741
|
-
# `gpt-image-1
|
|
742
|
-
#
|
|
741
|
+
# `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
|
|
742
|
+
# this parameter. Defaults to `low` on supported models.
|
|
743
743
|
#
|
|
744
744
|
# @param input_image_mask [OpenAI::Models::Responses::Tool::ImageGeneration::InputImageMask]
|
|
745
745
|
# Optional mask for inpainting. Contains `image_url` (string, optional) and
|
|
@@ -828,8 +828,8 @@ module OpenAI
|
|
|
828
828
|
|
|
829
829
|
# Control how much effort the model will exert to match the style and features,
|
|
830
830
|
# especially facial features, of input images. Supports `high` and `low` on
|
|
831
|
-
# `gpt-image-1
|
|
832
|
-
#
|
|
831
|
+
# `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
|
|
832
|
+
# this parameter. Defaults to `low` on supported models.
|
|
833
833
|
#
|
|
834
834
|
# @see OpenAI::Models::Responses::Tool::ImageGeneration#input_fidelity
|
|
835
835
|
module InputFidelity
|
|
@@ -355,5 +355,11 @@ module OpenAI
|
|
|
355
355
|
@connection_configurator = connection_configurator
|
|
356
356
|
@pools = {}
|
|
357
357
|
end
|
|
358
|
+
|
|
359
|
+
# Whether this HTTP client has the same connection policy as the SDK default.
|
|
360
|
+
# @api private
|
|
361
|
+
def default_configuration?
|
|
362
|
+
@size == DEFAULT_MAX_CONNECTIONS && @connection_configurator.nil?
|
|
363
|
+
end
|
|
358
364
|
end
|
|
359
365
|
end
|
|
@@ -116,15 +116,6 @@ module OpenAI
|
|
|
116
116
|
if headers.key?("api-key")
|
|
117
117
|
raise OpenAI::Errors::Error, "Vertex authentication cannot be combined with a custom api-key header."
|
|
118
118
|
end
|
|
119
|
-
# The outer Google API version differs for stored Responses.
|
|
120
|
-
# Do not change other gateway layouts.
|
|
121
|
-
prefix = "#{base.path.delete_suffix("/")}/responses/"
|
|
122
|
-
if [:get, :delete].include?(request[:method]) &&
|
|
123
|
-
url.path.start_with?(prefix) &&
|
|
124
|
-
base.path.start_with?("/v1/projects/")
|
|
125
|
-
url = url.dup
|
|
126
|
-
url.path = url.path.sub(%r{\A/v1/}, "/v1beta1/")
|
|
127
|
-
end
|
|
128
119
|
|
|
129
120
|
headers.delete("openai-organization")
|
|
130
121
|
headers.delete("openai-project")
|
|
@@ -163,7 +154,6 @@ module OpenAI
|
|
|
163
154
|
context[:token] = token if context
|
|
164
155
|
|
|
165
156
|
request.merge(
|
|
166
|
-
url: url,
|
|
167
157
|
timeout: remaining,
|
|
168
158
|
headers: headers.merge("authorization" => "Bearer #{token}"),
|
|
169
159
|
provider_auth: AUTH_MARKER,
|