openai 0.114.0 → 0.115.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +43 -0
- data/README.md +17 -2
- data/docs/architecture/security-model.md +11 -16
- data/examples/responses/websocket_workflows.rb +78 -3
- data/lib/openai/helpers/chat/tool_runner.rb +1 -1
- data/lib/openai/helpers/live/websocket.rb +31 -0
- data/lib/openai/helpers/realtime/connection.rb +33 -0
- data/lib/openai/helpers/realtime/connection_manager.rb +1 -0
- data/lib/openai/helpers/realtime/conversation_item_variant_resolver.rb +5 -0
- data/lib/openai/helpers/realtime/recovery.rb +5 -1
- data/lib/openai/helpers/realtime/translation.rb +5 -0
- data/lib/openai/helpers/realtime/transports/async_websocket.rb +19 -0
- data/lib/openai/helpers/responses_websocket/connection.rb +53 -15
- data/lib/openai/helpers/responses_websocket/connection_manager.rb +1 -0
- data/lib/openai/helpers/responses_websocket/connection_resources.rb +1 -1
- data/lib/openai/helpers/structured_output/response_parser.rb +1 -0
- data/lib/openai/helpers/structured_output.rb +58 -0
- data/lib/openai/helpers/websocket/connection_manager.rb +11 -0
- data/lib/openai/helpers/websocket/resource.rb +1 -0
- data/lib/openai/helpers/websocket/typed_connection.rb +1 -0
- data/lib/openai/internal/type/array_of.rb +1 -1
- data/lib/openai/internal/type/hash_of.rb +1 -1
- data/lib/openai/internal/type/request_parameters.rb +2 -1
- data/lib/openai/internal/type/union.rb +18 -6
- data/lib/openai/models/admin/organization/external_key.rb +169 -0
- data/lib/openai/models/admin/organization/external_key_create_params.rb +311 -0
- data/lib/openai/models/admin/organization/external_key_delete_params.rb +24 -0
- data/lib/openai/models/admin/organization/external_key_list_params.rb +69 -0
- data/lib/openai/models/admin/organization/external_key_retrieve_params.rb +24 -0
- data/lib/openai/models/admin/organization/external_key_validate_params.rb +24 -0
- data/lib/openai/models/admin/organization/external_key_validate_response.rb +20 -0
- data/lib/openai/models/audio/speech_model.rb +12 -0
- data/lib/openai/models/audio_model.rb +15 -0
- data/lib/openai/models/beta/agent.rb +49 -1
- data/lib/openai/models/beta/agent_create_params.rb +51 -1
- data/lib/openai/models/beta/agent_session.rb +75 -2
- data/lib/openai/models/beta/agent_update_params.rb +62 -1
- data/lib/openai/models/beta/agents/session_create_params.rb +94 -2
- data/lib/openai/models/beta/agents/session_list_params.rb +16 -1
- data/lib/openai/models/beta/agents/session_update_params.rb +50 -5
- data/lib/openai/models/beta/assistant_update_params.rb +18 -0
- data/lib/openai/models/beta/beta_response.rb +224 -1
- data/lib/openai/models/beta/beta_response_configuration_update_item.rb +64 -3
- data/lib/openai/models/beta/beta_response_configuration_update_item_param.rb +64 -4
- data/lib/openai/models/beta/beta_response_input_item.rb +2 -3
- data/lib/openai/models/beta/beta_response_item.rb +2 -2
- data/lib/openai/models/beta/beta_response_tool_search_output_item_param.rb +6 -6
- data/lib/openai/models/beta/beta_responses_client_event.rb +20 -1
- data/lib/openai/models/beta/beta_tool.rb +6 -6
- data/lib/openai/models/beta/response_compact_params.rb +6 -0
- data/lib/openai/models/beta/response_create_params.rb +6 -0
- data/lib/openai/models/chat_model.rb +6 -0
- data/lib/openai/models/conversations/conversation_item.rb +2 -2
- data/lib/openai/models/image_edit_params.rb +46 -25
- data/lib/openai/models/live/fork_server_event.rb +43 -3
- data/lib/openai/models/live/server_event.rb +43 -3
- data/lib/openai/models/live/sideband_client_event.rb +40 -1
- data/lib/openai/models/live/sideband_server_event.rb +43 -3
- data/lib/openai/models/realtime/audio_transcription.rb +15 -0
- data/lib/openai/models/realtime/conversation_item_added.rb +2 -2
- data/lib/openai/models/realtime/conversation_item_create_event.rb +2 -2
- data/lib/openai/models/realtime/conversation_item_created_event.rb +2 -2
- data/lib/openai/models/realtime/conversation_item_done.rb +2 -2
- data/lib/openai/models/realtime/realtime_response.rb +2 -2
- data/lib/openai/models/realtime/realtime_response_create_params.rb +2 -2
- data/lib/openai/models/realtime/realtime_server_event.rb +2 -2
- data/lib/openai/models/realtime/realtime_session.rb +18 -0
- data/lib/openai/models/realtime/realtime_session_create_request.rb +18 -0
- data/lib/openai/models/realtime/realtime_session_create_response.rb +18 -0
- data/lib/openai/models/realtime/response_output_item_added_event.rb +2 -2
- data/lib/openai/models/realtime/response_output_item_done_event.rb +2 -2
- data/lib/openai/models/responses/response.rb +221 -1
- data/lib/openai/models/responses/response_compact_params.rb +6 -0
- data/lib/openai/models/responses/response_configuration_update_item.rb +50 -3
- data/lib/openai/models/responses/response_configuration_update_item_param.rb +50 -4
- data/lib/openai/models/responses/response_input_item.rb +2 -3
- data/lib/openai/models/responses/response_item.rb +2 -2
- data/lib/openai/models/responses/response_tool_search_output_item_param.rb +6 -6
- data/lib/openai/models/responses/responses_client_event.rb +14 -1
- data/lib/openai/models/responses/tool.rb +6 -6
- data/lib/openai/net_http_client.rb +6 -0
- data/lib/openai/providers/vertex.rb +0 -10
- data/lib/openai/resources/admin/organization/external_keys.rb +132 -0
- data/lib/openai/resources/admin/organization.rb +4 -0
- data/lib/openai/resources/audio/speech.rb +8 -0
- data/lib/openai/resources/audio/translations.rb +8 -0
- data/lib/openai/resources/beta/agents/sessions.rb +22 -6
- data/lib/openai/resources/beta/agents.rb +17 -2
- data/lib/openai/resources/images.rb +36 -18
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +8 -0
- data/rbi/openai/helpers/live/websocket.rbi +1 -12
- data/rbi/openai/helpers/realtime/connection.rbi +5 -0
- data/rbi/openai/helpers/realtime/transports/async_websocket.rbi +5 -0
- data/rbi/openai/helpers/responses_websocket/connection.rbi +7 -2
- data/rbi/openai/helpers/structured_output.rbi +10 -0
- data/rbi/openai/internal/type/array_of.rbi +1 -1
- data/rbi/openai/internal/type/hash_of.rbi +1 -1
- data/rbi/openai/internal/type/union.rbi +5 -0
- data/rbi/openai/models/admin/organization/external_key.rbi +301 -0
- data/rbi/openai/models/admin/organization/external_key_create_params.rbi +532 -0
- data/rbi/openai/models/admin/organization/external_key_delete_params.rbi +57 -0
- data/rbi/openai/models/admin/organization/external_key_list_params.rbi +129 -0
- data/rbi/openai/models/admin/organization/external_key_retrieve_params.rbi +57 -0
- data/rbi/openai/models/admin/organization/external_key_validate_params.rbi +57 -0
- data/rbi/openai/models/admin/organization/external_key_validate_response.rbi +50 -0
- data/rbi/openai/models/beta/agent.rbi +103 -1
- data/rbi/openai/models/beta/agent_create_params.rbi +109 -0
- data/rbi/openai/models/beta/agent_session.rbi +136 -3
- data/rbi/openai/models/beta/agent_update_params.rbi +120 -0
- data/rbi/openai/models/beta/agents/session_create_params.rbi +153 -0
- data/rbi/openai/models/beta/agents/session_list_params.rbi +19 -0
- data/rbi/openai/models/beta/agents/session_update_params.rbi +94 -6
- data/rbi/openai/models/beta/beta_response.rbi +394 -0
- data/rbi/openai/models/beta/beta_response_configuration_update_item.rbi +113 -3
- data/rbi/openai/models/beta/beta_response_configuration_update_item_param.rbi +125 -4
- data/rbi/openai/models/beta/beta_response_tool_search_output_item_param.rbi +6 -6
- data/rbi/openai/models/beta/beta_responses_client_event.rbi +17 -0
- data/rbi/openai/models/beta/beta_tool.rbi +6 -6
- data/rbi/openai/models/decision_create_params.rbi +4 -1
- data/rbi/openai/models/image_edit_params.rbi +49 -24
- data/rbi/openai/models/live/fork_server_event.rbi +65 -1
- data/rbi/openai/models/live/server_event.rbi +65 -1
- data/rbi/openai/models/live/sideband_client_event.rbi +60 -0
- data/rbi/openai/models/live/sideband_server_event.rbi +65 -1
- data/rbi/openai/models/realtime/conversation_item_added.rbi +6 -3
- data/rbi/openai/models/realtime/conversation_item_create_event.rbi +6 -3
- data/rbi/openai/models/realtime/conversation_item_created_event.rbi +6 -3
- data/rbi/openai/models/realtime/conversation_item_done.rbi +6 -3
- data/rbi/openai/models/realtime/realtime_response.rbi +8 -4
- data/rbi/openai/models/realtime/realtime_response_create_params.rbi +8 -4
- data/rbi/openai/models/realtime/realtime_server_event.rbi +6 -3
- data/rbi/openai/models/realtime/response_output_item_added_event.rbi +6 -3
- data/rbi/openai/models/realtime/response_output_item_done_event.rbi +6 -3
- data/rbi/openai/models/responses/response.rbi +394 -0
- data/rbi/openai/models/responses/response_configuration_update_item.rbi +76 -3
- data/rbi/openai/models/responses/response_configuration_update_item_param.rbi +74 -4
- data/rbi/openai/models/responses/response_tool_search_output_item_param.rbi +6 -6
- data/rbi/openai/models/responses/responses_client_event.rbi +17 -0
- data/rbi/openai/models/responses/tool.rbi +6 -6
- data/rbi/openai/net_http_client.rbi +5 -0
- data/rbi/openai/resources/admin/organization/external_keys.rbi +86 -0
- data/rbi/openai/resources/admin/organization.rbi +3 -0
- data/rbi/openai/resources/audio/speech.rbi +8 -0
- data/rbi/openai/resources/audio/translations.rbi +6 -0
- data/rbi/openai/resources/beta/agents/sessions.rbi +18 -2
- data/rbi/openai/resources/beta/agents.rbi +15 -0
- data/rbi/openai/resources/images.rbi +34 -16
- data/rbi/openai/resources/responses.rbi +2 -0
- data/realtime.md +6 -0
- data/responses-websocket.md +53 -0
- data/sig/openai/helpers/live/websocket.rbs +1 -9
- data/sig/openai/helpers/realtime/connection.rbs +3 -0
- data/sig/openai/helpers/realtime/transports/async_websocket.rbs +3 -0
- data/sig/openai/helpers/responses_websocket/connection.rbs +7 -1
- data/sig/openai/helpers/structured_output.rbs +9 -0
- data/sig/openai/internal/type/union.rbs +4 -0
- data/sig/openai/models/admin/organization/external_key.rbs +186 -0
- data/sig/openai/models/admin/organization/external_key_create_params.rbs +423 -0
- data/sig/openai/models/admin/organization/external_key_delete_params.rbs +27 -0
- data/sig/openai/models/admin/organization/external_key_list_params.rbs +81 -0
- data/sig/openai/models/admin/organization/external_key_retrieve_params.rbs +27 -0
- data/sig/openai/models/admin/organization/external_key_validate_params.rbs +27 -0
- data/sig/openai/models/admin/organization/external_key_validate_response.rbs +17 -0
- data/sig/openai/models/admin/organization/external_storage_create_params.rbs +72 -2
- data/sig/openai/models/audio/speech_create_params.rbs +15 -2
- data/sig/openai/models/audio/transcription_create_params.rbs +30 -2
- data/sig/openai/models/audio/voice_create_params.rbs +47 -2
- data/sig/openai/models/beta/agent.rbs +54 -2
- data/sig/openai/models/beta/agent_create_params.rbs +54 -0
- data/sig/openai/models/beta/agent_session.rbs +82 -3
- data/sig/openai/models/beta/agent_update_params.rbs +64 -0
- data/sig/openai/models/beta/agents/session_create_params.rbs +91 -0
- data/sig/openai/models/beta/agents/session_list_params.rbs +20 -0
- data/sig/openai/models/beta/agents/session_update_params.rbs +48 -6
- data/sig/openai/models/beta/assistant_create_params.rbs +5 -2
- data/sig/openai/models/beta/beta_response.rbs +223 -0
- data/sig/openai/models/beta/beta_response_configuration_update_item.rbs +58 -2
- data/sig/openai/models/beta/beta_response_configuration_update_item_param.rbs +58 -2
- data/sig/openai/models/beta/beta_response_tool_search_output_item_param.rbs +4 -4
- data/sig/openai/models/beta/beta_responses_client_event.rbs +17 -0
- data/sig/openai/models/beta/beta_tool.rbs +4 -4
- data/sig/openai/models/beta/response_create_params.rbs +5 -2
- data/sig/openai/models/beta/responses/input_token_count_params.rbs +10 -2
- data/sig/openai/models/beta/thread_create_and_run_params.rbs +11 -5
- data/sig/openai/models/beta/thread_create_params.rbs +11 -5
- data/sig/openai/models/beta/threads/message_create_params.rbs +6 -3
- data/sig/openai/models/beta/threads/run_create_params.rbs +6 -3
- data/sig/openai/models/decision_create_params.rbs +27 -2
- data/sig/openai/models/eval_create_params.rbs +25 -4
- data/sig/openai/models/evals/run_create_params.rbs +52 -8
- data/sig/openai/models/image_edit_params.rbs +47 -16
- data/sig/openai/models/live/fork_server_event.rbs +39 -0
- data/sig/openai/models/live/server_event.rbs +39 -0
- data/sig/openai/models/live/session_accept_params.rbs +39 -2
- data/sig/openai/models/live/sideband_client_event.rbs +32 -0
- data/sig/openai/models/live/sideband_server_event.rbs +39 -0
- data/sig/openai/models/realtime/conversation_item.rbs +1 -0
- data/sig/openai/models/responses/input_token_count_params.rbs +10 -2
- data/sig/openai/models/responses/response.rbs +223 -0
- data/sig/openai/models/responses/response_configuration_update_item.rbs +45 -2
- data/sig/openai/models/responses/response_configuration_update_item_param.rbs +45 -2
- data/sig/openai/models/responses/response_create_params.rbs +5 -2
- data/sig/openai/models/responses/response_tool_search_output_item_param.rbs +4 -4
- data/sig/openai/models/responses/responses_client_event.rbs +17 -0
- data/sig/openai/models/responses/tool.rbs +4 -4
- data/sig/openai/models/video_edit_params.rbs +11 -2
- data/sig/openai/models/video_extend_params.rbs +11 -2
- data/sig/openai/net_http_client.rbs +3 -0
- data/sig/openai/resources/admin/organization/external_keys.rbs +70 -0
- data/sig/openai/resources/admin/organization/external_storage.rbs +23 -1
- data/sig/openai/resources/admin/organization.rbs +2 -0
- data/sig/openai/resources/audio/speech.rbs +2 -1
- data/sig/openai/resources/audio/transcriptions.rbs +14 -2
- data/sig/openai/resources/audio/voices.rbs +14 -1
- data/sig/openai/resources/beta/agents/sessions.rbs +4 -0
- data/sig/openai/resources/beta/agents.rbs +4 -0
- data/sig/openai/resources/beta/responses/input_tokens.rbs +2 -1
- data/sig/openai/resources/beta/responses.rbs +4 -2
- data/sig/openai/resources/decisions.rbs +7 -1
- data/sig/openai/resources/images.rbs +2 -0
- data/sig/openai/resources/responses/input_tokens.rbs +2 -1
- data/sig/openai/resources/responses.rbs +5 -2
- data/sig/openai/resources/videos.rbs +2 -2
- metadata +43 -1
|
@@ -37,6 +37,7 @@ module OpenAI
|
|
|
37
37
|
?service_tier: OpenAI::Models::Beta::BetaResponse::service_tier?,
|
|
38
38
|
?status: OpenAI::Models::Beta::beta_response_status,
|
|
39
39
|
?text: OpenAI::Beta::BetaResponseTextConfig,
|
|
40
|
+
?tool_usage: OpenAI::Beta::BetaResponse::ToolUsage,
|
|
40
41
|
?top_logprobs: Integer?,
|
|
41
42
|
?truncation: OpenAI::Models::Beta::BetaResponse::truncation?,
|
|
42
43
|
?usage: OpenAI::Beta::BetaResponseUsage,
|
|
@@ -280,6 +281,36 @@ module OpenAI
|
|
|
280
281
|
OpenAI::Beta::BetaResponseTextConfig
|
|
281
282
|
) -> OpenAI::Beta::BetaResponseTextConfig
|
|
282
283
|
|
|
284
|
+
# Usage reported by hosted tools, separate from base model `usage`. The field can
|
|
285
|
+
# be omitted when tool usage is unavailable. When present, tool families with no
|
|
286
|
+
# recorded usage have zero counts.
|
|
287
|
+
#
|
|
288
|
+
# `image_gen` sums available token counts across image generation calls. Calls
|
|
289
|
+
# with missing or incomplete usage records may be skipped. Output token details
|
|
290
|
+
# and cached input counts can be omitted. An omitted cache count means cache usage
|
|
291
|
+
# is unknown.
|
|
292
|
+
#
|
|
293
|
+
# `web_search.num_requests` counts billable searches. Discounted searches and
|
|
294
|
+
# actions such as opening a page are excluded. Use billing records to reconcile
|
|
295
|
+
# final charges.
|
|
296
|
+
attr_reader tool_usage: OpenAI::Beta::BetaResponse::ToolUsage?
|
|
297
|
+
|
|
298
|
+
# Usage reported by hosted tools, separate from base model `usage`. The field can
|
|
299
|
+
# be omitted when tool usage is unavailable. When present, tool families with no
|
|
300
|
+
# recorded usage have zero counts.
|
|
301
|
+
#
|
|
302
|
+
# `image_gen` sums available token counts across image generation calls. Calls
|
|
303
|
+
# with missing or incomplete usage records may be skipped. Output token details
|
|
304
|
+
# and cached input counts can be omitted. An omitted cache count means cache usage
|
|
305
|
+
# is unknown.
|
|
306
|
+
#
|
|
307
|
+
# `web_search.num_requests` counts billable searches. Discounted searches and
|
|
308
|
+
# actions such as opening a page are excluded. Use billing records to reconcile
|
|
309
|
+
# final charges.
|
|
310
|
+
def tool_usage=: (
|
|
311
|
+
OpenAI::Beta::BetaResponse::ToolUsage
|
|
312
|
+
) -> OpenAI::Beta::BetaResponse::ToolUsage
|
|
313
|
+
|
|
283
314
|
# An integer between 0 and 20 specifying the maximum number of most likely tokens
|
|
284
315
|
# to return at each token position, each with an associated log probability. In
|
|
285
316
|
# some cases, the number of returned tokens may be fewer than requested.
|
|
@@ -493,6 +524,19 @@ module OpenAI
|
|
|
493
524
|
#
|
|
494
525
|
# - [Text inputs and outputs](https://developers.openai.com/api/docs/guides/text)
|
|
495
526
|
# - [Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs)
|
|
527
|
+
# @param tool_usage
|
|
528
|
+
# Usage reported by hosted tools, separate from base model `usage`. The field can
|
|
529
|
+
# be omitted when tool usage is unavailable. When present, tool families with no
|
|
530
|
+
# recorded usage have zero counts.
|
|
531
|
+
#
|
|
532
|
+
# `image_gen` sums available token counts across image generation calls. Calls
|
|
533
|
+
# with missing or incomplete usage records may be skipped. Output token details
|
|
534
|
+
# and cached input counts can be omitted. An omitted cache count means cache usage
|
|
535
|
+
# is unknown.
|
|
536
|
+
#
|
|
537
|
+
# `web_search.num_requests` counts billable searches. Discounted searches and
|
|
538
|
+
# actions such as opening a page are excluded. Use billing records to reconcile
|
|
539
|
+
# final charges.
|
|
496
540
|
# @param top_logprobs
|
|
497
541
|
# An integer between 0 and 20 specifying the maximum number of most likely tokens
|
|
498
542
|
# to return at each token position, each with an associated log probability. In
|
|
@@ -548,6 +592,7 @@ module OpenAI
|
|
|
548
592
|
?service_tier: OpenAI::Models::Beta::BetaResponse::service_tier?,
|
|
549
593
|
?status: OpenAI::Models::Beta::beta_response_status,
|
|
550
594
|
?text: OpenAI::Beta::BetaResponseTextConfig,
|
|
595
|
+
?tool_usage: OpenAI::Beta::BetaResponse::ToolUsage,
|
|
551
596
|
?top_logprobs: Integer?,
|
|
552
597
|
?truncation: OpenAI::Models::Beta::BetaResponse::truncation?,
|
|
553
598
|
?usage: OpenAI::Beta::BetaResponseUsage,
|
|
@@ -588,6 +633,7 @@ module OpenAI
|
|
|
588
633
|
?service_tier: OpenAI::Models::Beta::BetaResponse::service_tier?,
|
|
589
634
|
?status: OpenAI::Models::Beta::beta_response_status,
|
|
590
635
|
?text: OpenAI::Beta::BetaResponseTextConfig,
|
|
636
|
+
?tool_usage: OpenAI::Beta::BetaResponse::ToolUsage,
|
|
591
637
|
?top_logprobs: Integer?,
|
|
592
638
|
?truncation: OpenAI::Models::Beta::BetaResponse::truncation?,
|
|
593
639
|
?usage: OpenAI::Beta::BetaResponseUsage,
|
|
@@ -1572,6 +1618,183 @@ module OpenAI
|
|
|
1572
1618
|
def self?.values: -> ::Array[OpenAI::Models::Beta::BetaResponse::service_tier]
|
|
1573
1619
|
end
|
|
1574
1620
|
|
|
1621
|
+
type tool_usage =
|
|
1622
|
+
{
|
|
1623
|
+
image_gen: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen,
|
|
1624
|
+
web_search: OpenAI::Beta::BetaResponse::ToolUsage::WebSearch
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
class ToolUsage < OpenAI::Internal::Type::BaseModel
|
|
1628
|
+
# Aggregated usage statistics for image generation tool calls.
|
|
1629
|
+
attr_accessor image_gen: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen
|
|
1630
|
+
|
|
1631
|
+
# Aggregated billable usage statistics for web search tool calls.
|
|
1632
|
+
attr_accessor web_search: OpenAI::Beta::BetaResponse::ToolUsage::WebSearch
|
|
1633
|
+
|
|
1634
|
+
# @param image_gen
|
|
1635
|
+
# Aggregated usage statistics for image generation tool calls.
|
|
1636
|
+
# @param web_search
|
|
1637
|
+
# Aggregated billable usage statistics for web search tool calls.
|
|
1638
|
+
def initialize: (
|
|
1639
|
+
image_gen: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen,
|
|
1640
|
+
web_search: OpenAI::Beta::BetaResponse::ToolUsage::WebSearch
|
|
1641
|
+
) -> void
|
|
1642
|
+
|
|
1643
|
+
def to_hash: -> {
|
|
1644
|
+
image_gen: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen,
|
|
1645
|
+
web_search: OpenAI::Beta::BetaResponse::ToolUsage::WebSearch
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
type image_gen =
|
|
1649
|
+
{
|
|
1650
|
+
input_tokens: Integer,
|
|
1651
|
+
input_tokens_details: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::InputTokensDetails,
|
|
1652
|
+
output_tokens: Integer,
|
|
1653
|
+
total_tokens: Integer,
|
|
1654
|
+
?cached_tokens: Integer,
|
|
1655
|
+
?cached_tokens_details: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::CachedTokensDetails,
|
|
1656
|
+
?output_tokens_details: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::OutputTokensDetails
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
class ImageGen < OpenAI::Internal::Type::BaseModel
|
|
1660
|
+
# The number of tokens (images and text) in the input prompt.
|
|
1661
|
+
attr_accessor input_tokens: Integer
|
|
1662
|
+
|
|
1663
|
+
# The input tokens detailed information for the image generation.
|
|
1664
|
+
attr_accessor input_tokens_details: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::InputTokensDetails
|
|
1665
|
+
|
|
1666
|
+
# The number of output tokens generated by the model.
|
|
1667
|
+
attr_accessor output_tokens: Integer
|
|
1668
|
+
|
|
1669
|
+
# The total number of tokens (images and text) used for the image generation.
|
|
1670
|
+
attr_accessor total_tokens: Integer
|
|
1671
|
+
|
|
1672
|
+
attr_reader cached_tokens: Integer?
|
|
1673
|
+
|
|
1674
|
+
def cached_tokens=: (Integer) -> Integer
|
|
1675
|
+
|
|
1676
|
+
attr_reader cached_tokens_details: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::CachedTokensDetails?
|
|
1677
|
+
|
|
1678
|
+
def cached_tokens_details=: (
|
|
1679
|
+
OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::CachedTokensDetails
|
|
1680
|
+
) -> OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::CachedTokensDetails
|
|
1681
|
+
|
|
1682
|
+
# The output token details for the image generation.
|
|
1683
|
+
attr_reader output_tokens_details: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::OutputTokensDetails?
|
|
1684
|
+
|
|
1685
|
+
# The output token details for the image generation.
|
|
1686
|
+
def output_tokens_details=: (
|
|
1687
|
+
OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::OutputTokensDetails
|
|
1688
|
+
) -> OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::OutputTokensDetails
|
|
1689
|
+
|
|
1690
|
+
# @param input_tokens
|
|
1691
|
+
# The number of tokens (images and text) in the input prompt.
|
|
1692
|
+
# @param input_tokens_details
|
|
1693
|
+
# The input tokens detailed information for the image generation.
|
|
1694
|
+
# @param output_tokens
|
|
1695
|
+
# The number of output tokens generated by the model.
|
|
1696
|
+
# @param total_tokens
|
|
1697
|
+
# The total number of tokens (images and text) used for the image generation.
|
|
1698
|
+
# @param output_tokens_details
|
|
1699
|
+
# The output token details for the image generation.
|
|
1700
|
+
def initialize: (
|
|
1701
|
+
input_tokens: Integer,
|
|
1702
|
+
input_tokens_details: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::InputTokensDetails,
|
|
1703
|
+
output_tokens: Integer,
|
|
1704
|
+
total_tokens: Integer,
|
|
1705
|
+
?cached_tokens: Integer,
|
|
1706
|
+
?cached_tokens_details: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::CachedTokensDetails,
|
|
1707
|
+
?output_tokens_details: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::OutputTokensDetails
|
|
1708
|
+
) -> void
|
|
1709
|
+
|
|
1710
|
+
def to_hash: -> {
|
|
1711
|
+
input_tokens: Integer,
|
|
1712
|
+
input_tokens_details: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::InputTokensDetails,
|
|
1713
|
+
output_tokens: Integer,
|
|
1714
|
+
total_tokens: Integer,
|
|
1715
|
+
?cached_tokens: Integer,
|
|
1716
|
+
?cached_tokens_details: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::CachedTokensDetails,
|
|
1717
|
+
?output_tokens_details: OpenAI::Beta::BetaResponse::ToolUsage::ImageGen::OutputTokensDetails
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1720
|
+
type input_tokens_details =
|
|
1721
|
+
{ image_tokens: Integer, text_tokens: Integer }
|
|
1722
|
+
|
|
1723
|
+
class InputTokensDetails < OpenAI::Internal::Type::BaseModel
|
|
1724
|
+
# The number of image tokens in the input prompt.
|
|
1725
|
+
attr_accessor image_tokens: Integer
|
|
1726
|
+
|
|
1727
|
+
# The number of text tokens in the input prompt.
|
|
1728
|
+
attr_accessor text_tokens: Integer
|
|
1729
|
+
|
|
1730
|
+
# @param image_tokens
|
|
1731
|
+
# The number of image tokens in the input prompt.
|
|
1732
|
+
# @param text_tokens
|
|
1733
|
+
# The number of text tokens in the input prompt.
|
|
1734
|
+
def initialize: (
|
|
1735
|
+
image_tokens: Integer,
|
|
1736
|
+
text_tokens: Integer
|
|
1737
|
+
) -> void
|
|
1738
|
+
|
|
1739
|
+
def to_hash: -> { image_tokens: Integer, text_tokens: Integer }
|
|
1740
|
+
end
|
|
1741
|
+
|
|
1742
|
+
type cached_tokens_details =
|
|
1743
|
+
{ cached_image_tokens: Integer, cached_text_tokens: Integer }
|
|
1744
|
+
|
|
1745
|
+
class CachedTokensDetails < OpenAI::Internal::Type::BaseModel
|
|
1746
|
+
attr_accessor cached_image_tokens: Integer
|
|
1747
|
+
|
|
1748
|
+
attr_accessor cached_text_tokens: Integer
|
|
1749
|
+
|
|
1750
|
+
def initialize: (
|
|
1751
|
+
cached_image_tokens: Integer,
|
|
1752
|
+
cached_text_tokens: Integer
|
|
1753
|
+
) -> void
|
|
1754
|
+
|
|
1755
|
+
def to_hash: -> {
|
|
1756
|
+
cached_image_tokens: Integer,
|
|
1757
|
+
cached_text_tokens: Integer
|
|
1758
|
+
}
|
|
1759
|
+
end
|
|
1760
|
+
|
|
1761
|
+
type output_tokens_details =
|
|
1762
|
+
{ image_tokens: Integer, text_tokens: Integer }
|
|
1763
|
+
|
|
1764
|
+
class OutputTokensDetails < OpenAI::Internal::Type::BaseModel
|
|
1765
|
+
# The number of image output tokens generated by the model.
|
|
1766
|
+
attr_accessor image_tokens: Integer
|
|
1767
|
+
|
|
1768
|
+
# The number of text output tokens generated by the model.
|
|
1769
|
+
attr_accessor text_tokens: Integer
|
|
1770
|
+
|
|
1771
|
+
# @param image_tokens
|
|
1772
|
+
# The number of image output tokens generated by the model.
|
|
1773
|
+
# @param text_tokens
|
|
1774
|
+
# The number of text output tokens generated by the model.
|
|
1775
|
+
def initialize: (
|
|
1776
|
+
image_tokens: Integer,
|
|
1777
|
+
text_tokens: Integer
|
|
1778
|
+
) -> void
|
|
1779
|
+
|
|
1780
|
+
def to_hash: -> { image_tokens: Integer, text_tokens: Integer }
|
|
1781
|
+
end
|
|
1782
|
+
end
|
|
1783
|
+
|
|
1784
|
+
type web_search = { num_requests: Integer }
|
|
1785
|
+
|
|
1786
|
+
class WebSearch < OpenAI::Internal::Type::BaseModel
|
|
1787
|
+
# The number of billable web search requests issued.
|
|
1788
|
+
attr_accessor num_requests: Integer
|
|
1789
|
+
|
|
1790
|
+
# @param num_requests
|
|
1791
|
+
# The number of billable web search requests issued.
|
|
1792
|
+
def initialize: (num_requests: Integer) -> void
|
|
1793
|
+
|
|
1794
|
+
def to_hash: -> { num_requests: Integer }
|
|
1795
|
+
end
|
|
1796
|
+
end
|
|
1797
|
+
|
|
1575
1798
|
type truncation = :auto | :disabled
|
|
1576
1799
|
|
|
1577
1800
|
module Truncation
|
|
@@ -8,7 +8,8 @@ module OpenAI
|
|
|
8
8
|
id: String,
|
|
9
9
|
?type: :configuration_update,
|
|
10
10
|
?agent: OpenAI::Beta::BetaResponseConfigurationUpdateItem::Agent,
|
|
11
|
-
?reasoning: OpenAI::Beta::BetaResponseConfigurationUpdateItem::Reasoning
|
|
11
|
+
?reasoning: OpenAI::Beta::BetaResponseConfigurationUpdateItem::Reasoning,
|
|
12
|
+
?text: OpenAI::Beta::BetaResponseConfigurationUpdateItem::Text
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
class BetaResponseConfigurationUpdateItem < OpenAI::Internal::Type::BaseModel
|
|
@@ -34,18 +35,29 @@ module OpenAI
|
|
|
34
35
|
OpenAI::Beta::BetaResponseConfigurationUpdateItem::Reasoning
|
|
35
36
|
) -> OpenAI::Beta::BetaResponseConfigurationUpdateItem::Reasoning
|
|
36
37
|
|
|
38
|
+
# The text output configuration for subsequent responses.
|
|
39
|
+
attr_reader text: OpenAI::Beta::BetaResponseConfigurationUpdateItem::Text?
|
|
40
|
+
|
|
41
|
+
# The text output configuration for subsequent responses.
|
|
42
|
+
def text=: (
|
|
43
|
+
OpenAI::Beta::BetaResponseConfigurationUpdateItem::Text
|
|
44
|
+
) -> OpenAI::Beta::BetaResponseConfigurationUpdateItem::Text
|
|
45
|
+
|
|
37
46
|
# @param id
|
|
38
47
|
# The unique ID of the configuration update item.
|
|
39
48
|
# @param agent
|
|
40
49
|
# The agent that produced this item.
|
|
41
50
|
# @param reasoning
|
|
42
51
|
# The reasoning configuration applied by this update.
|
|
52
|
+
# @param text
|
|
53
|
+
# The text output configuration for subsequent responses.
|
|
43
54
|
# @param type
|
|
44
55
|
# The item type. Always `configuration_update`.
|
|
45
56
|
def initialize: (
|
|
46
57
|
id: String,
|
|
47
58
|
?agent: OpenAI::Beta::BetaResponseConfigurationUpdateItem::Agent,
|
|
48
59
|
?reasoning: OpenAI::Beta::BetaResponseConfigurationUpdateItem::Reasoning,
|
|
60
|
+
?text: OpenAI::Beta::BetaResponseConfigurationUpdateItem::Text,
|
|
49
61
|
?type: :configuration_update
|
|
50
62
|
) -> void
|
|
51
63
|
|
|
@@ -53,7 +65,8 @@ module OpenAI
|
|
|
53
65
|
id: String,
|
|
54
66
|
?type: :configuration_update,
|
|
55
67
|
?agent: OpenAI::Beta::BetaResponseConfigurationUpdateItem::Agent,
|
|
56
|
-
?reasoning: OpenAI::Beta::BetaResponseConfigurationUpdateItem::Reasoning
|
|
68
|
+
?reasoning: OpenAI::Beta::BetaResponseConfigurationUpdateItem::Reasoning,
|
|
69
|
+
?text: OpenAI::Beta::BetaResponseConfigurationUpdateItem::Text
|
|
57
70
|
}
|
|
58
71
|
|
|
59
72
|
type agent = { agent_name: String }
|
|
@@ -107,6 +120,49 @@ module OpenAI
|
|
|
107
120
|
def self?.values: -> ::Array[OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Reasoning::effort]
|
|
108
121
|
end
|
|
109
122
|
end
|
|
123
|
+
|
|
124
|
+
type text =
|
|
125
|
+
{
|
|
126
|
+
format_: OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Text::format_
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
class Text < OpenAI::Internal::Type::BaseModel
|
|
130
|
+
# Use a JSON schema for structured output or text to return to plain text.
|
|
131
|
+
attr_accessor format_: OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Text::format_
|
|
132
|
+
|
|
133
|
+
# @param format_
|
|
134
|
+
# Use a JSON schema for structured output or text to return to plain text.
|
|
135
|
+
def initialize: (
|
|
136
|
+
format_: OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Text::format_
|
|
137
|
+
) -> void
|
|
138
|
+
|
|
139
|
+
def to_hash: -> {
|
|
140
|
+
format_: OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Text::format_
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
type format_ =
|
|
144
|
+
OpenAI::Beta::BetaResponseConfigurationUpdateItem::Text::Format::Text
|
|
145
|
+
| OpenAI::Beta::BetaResponseFormatTextJSONSchemaConfig
|
|
146
|
+
|
|
147
|
+
module Format
|
|
148
|
+
extend OpenAI::Internal::Type::Union
|
|
149
|
+
|
|
150
|
+
type text = { ?type: :text }
|
|
151
|
+
|
|
152
|
+
class Text < OpenAI::Internal::Type::BaseModel
|
|
153
|
+
# The type of response format being defined. Always `text`.
|
|
154
|
+
attr_accessor type: :text
|
|
155
|
+
|
|
156
|
+
# @param type
|
|
157
|
+
# The type of response format being defined. Always `text`.
|
|
158
|
+
def initialize: (?type: :text) -> void
|
|
159
|
+
|
|
160
|
+
def to_hash: -> { ?type: :text }
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
def self?.variants: -> ::Array[OpenAI::Models::Beta::BetaResponseConfigurationUpdateItem::Text::format_]
|
|
164
|
+
end
|
|
165
|
+
end
|
|
110
166
|
end
|
|
111
167
|
end
|
|
112
168
|
end
|
|
@@ -8,7 +8,8 @@ module OpenAI
|
|
|
8
8
|
?type: :configuration_update,
|
|
9
9
|
?id: String?,
|
|
10
10
|
?agent: OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Agent?,
|
|
11
|
-
?reasoning: OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Reasoning
|
|
11
|
+
?reasoning: OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Reasoning,
|
|
12
|
+
?text: OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Text
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
class BetaResponseConfigurationUpdateItemParam < OpenAI::Internal::Type::BaseModel
|
|
@@ -29,18 +30,29 @@ module OpenAI
|
|
|
29
30
|
OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Reasoning
|
|
30
31
|
) -> OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Reasoning
|
|
31
32
|
|
|
33
|
+
# The text output configuration for subsequent responses.
|
|
34
|
+
attr_reader text: OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Text?
|
|
35
|
+
|
|
36
|
+
# The text output configuration for subsequent responses.
|
|
37
|
+
def text=: (
|
|
38
|
+
OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Text
|
|
39
|
+
) -> OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Text
|
|
40
|
+
|
|
32
41
|
# @param id
|
|
33
42
|
# The unique ID of the configuration update item.
|
|
34
43
|
# @param agent
|
|
35
44
|
# The agent that produced this item.
|
|
36
45
|
# @param reasoning
|
|
37
46
|
# Updates to reasoning configuration. Only effort is supported.
|
|
47
|
+
# @param text
|
|
48
|
+
# The text output configuration for subsequent responses.
|
|
38
49
|
# @param type
|
|
39
50
|
# The item type. Always `configuration_update`.
|
|
40
51
|
def initialize: (
|
|
41
52
|
?id: String?,
|
|
42
53
|
?agent: OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Agent?,
|
|
43
54
|
?reasoning: OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Reasoning,
|
|
55
|
+
?text: OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Text,
|
|
44
56
|
?type: :configuration_update
|
|
45
57
|
) -> void
|
|
46
58
|
|
|
@@ -48,7 +60,8 @@ module OpenAI
|
|
|
48
60
|
?type: :configuration_update,
|
|
49
61
|
?id: String?,
|
|
50
62
|
?agent: OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Agent?,
|
|
51
|
-
?reasoning: OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Reasoning
|
|
63
|
+
?reasoning: OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Reasoning,
|
|
64
|
+
?text: OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Text
|
|
52
65
|
}
|
|
53
66
|
|
|
54
67
|
type agent = { agent_name: String }
|
|
@@ -102,6 +115,49 @@ module OpenAI
|
|
|
102
115
|
def self?.values: -> ::Array[OpenAI::Models::Beta::BetaResponseConfigurationUpdateItemParam::Reasoning::effort]
|
|
103
116
|
end
|
|
104
117
|
end
|
|
118
|
+
|
|
119
|
+
type text =
|
|
120
|
+
{
|
|
121
|
+
format_: OpenAI::Models::Beta::BetaResponseConfigurationUpdateItemParam::Text::format_
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
class Text < OpenAI::Internal::Type::BaseModel
|
|
125
|
+
# Use a JSON schema for structured output or text to return to plain text.
|
|
126
|
+
attr_accessor format_: OpenAI::Models::Beta::BetaResponseConfigurationUpdateItemParam::Text::format_
|
|
127
|
+
|
|
128
|
+
# @param format_
|
|
129
|
+
# Use a JSON schema for structured output or text to return to plain text.
|
|
130
|
+
def initialize: (
|
|
131
|
+
format_: OpenAI::Models::Beta::BetaResponseConfigurationUpdateItemParam::Text::format_
|
|
132
|
+
) -> void
|
|
133
|
+
|
|
134
|
+
def to_hash: -> {
|
|
135
|
+
format_: OpenAI::Models::Beta::BetaResponseConfigurationUpdateItemParam::Text::format_
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
type format_ =
|
|
139
|
+
OpenAI::Beta::BetaResponseConfigurationUpdateItemParam::Text::Format::Text
|
|
140
|
+
| OpenAI::Beta::BetaResponseFormatTextJSONSchemaConfig
|
|
141
|
+
|
|
142
|
+
module Format
|
|
143
|
+
extend OpenAI::Internal::Type::Union
|
|
144
|
+
|
|
145
|
+
type text = { ?type: :text }
|
|
146
|
+
|
|
147
|
+
class Text < OpenAI::Internal::Type::BaseModel
|
|
148
|
+
# The type of response format being defined. Always `text`.
|
|
149
|
+
attr_accessor type: :text
|
|
150
|
+
|
|
151
|
+
# @param type
|
|
152
|
+
# The type of response format being defined. Always `text`.
|
|
153
|
+
def initialize: (?type: :text) -> void
|
|
154
|
+
|
|
155
|
+
def to_hash: -> { ?type: :text }
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
def self?.variants: -> ::Array[OpenAI::Models::Beta::BetaResponseConfigurationUpdateItemParam::Text::format_]
|
|
159
|
+
end
|
|
160
|
+
end
|
|
105
161
|
end
|
|
106
162
|
end
|
|
107
163
|
end
|
|
@@ -720,8 +720,8 @@ module OpenAI
|
|
|
720
720
|
|
|
721
721
|
# Control how much effort the model will exert to match the style and features,
|
|
722
722
|
# especially facial features, of input images. Supports `high` and `low` on
|
|
723
|
-
# `gpt-image-1
|
|
724
|
-
#
|
|
723
|
+
# `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
|
|
724
|
+
# this parameter. Defaults to `low` on supported models.
|
|
725
725
|
attr_accessor input_fidelity: OpenAI::Models::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::input_fidelity?
|
|
726
726
|
|
|
727
727
|
# Optional mask for inpainting. Contains `image_url` (string, optional) and
|
|
@@ -843,8 +843,8 @@ module OpenAI
|
|
|
843
843
|
# @param input_fidelity
|
|
844
844
|
# Control how much effort the model will exert to match the style and features,
|
|
845
845
|
# especially facial features, of input images. Supports `high` and `low` on
|
|
846
|
-
# `gpt-image-1
|
|
847
|
-
#
|
|
846
|
+
# `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
|
|
847
|
+
# this parameter. Defaults to `low` on supported models.
|
|
848
848
|
# @param input_image_mask
|
|
849
849
|
# Optional mask for inpainting. Contains `image_url` (string, optional) and
|
|
850
850
|
# `file_id` (string, optional).
|
|
@@ -18,6 +18,7 @@ module OpenAI
|
|
|
18
18
|
?background: bool?,
|
|
19
19
|
?context_management: ::Array[OpenAI::Beta::BetaResponsesClientEvent::ResponseCreate::ContextManagement]?,
|
|
20
20
|
?conversation: OpenAI::Models::Beta::BetaResponsesClientEvent::ResponseCreate::conversation?,
|
|
21
|
+
?generate: bool,
|
|
21
22
|
?include: ::Array[OpenAI::Models::Beta::beta_response_includable]?,
|
|
22
23
|
?input: OpenAI::Models::Beta::BetaResponsesClientEvent::ResponseCreate::input,
|
|
23
24
|
?instructions: String?,
|
|
@@ -75,6 +76,16 @@ module OpenAI
|
|
|
75
76
|
# response completes.
|
|
76
77
|
attr_accessor conversation: OpenAI::Models::Beta::BetaResponsesClientEvent::ResponseCreate::conversation?
|
|
77
78
|
|
|
79
|
+
# Whether to generate output for this response. Defaults to true when omitted. Set
|
|
80
|
+
# to false to prepare request state without model output; the response ID can be
|
|
81
|
+
# used as previous_response_id on a later turn.
|
|
82
|
+
attr_reader generate: bool?
|
|
83
|
+
|
|
84
|
+
# Whether to generate output for this response. Defaults to true when omitted. Set
|
|
85
|
+
# to false to prepare request state without model output; the response ID can be
|
|
86
|
+
# used as previous_response_id on a later turn.
|
|
87
|
+
def generate=: (bool) -> bool
|
|
88
|
+
|
|
78
89
|
# Specify additional output data to include in the model response. Currently
|
|
79
90
|
# supported values are:
|
|
80
91
|
#
|
|
@@ -426,6 +437,10 @@ module OpenAI
|
|
|
426
437
|
# prepended to `input_items` for this response request. Input items and output
|
|
427
438
|
# items from this response are automatically added to this conversation after this
|
|
428
439
|
# response completes.
|
|
440
|
+
# @param generate
|
|
441
|
+
# Whether to generate output for this response. Defaults to true when omitted. Set
|
|
442
|
+
# to false to prepare request state without model output; the response ID can be
|
|
443
|
+
# used as previous_response_id on a later turn.
|
|
429
444
|
# @param include
|
|
430
445
|
# Specify additional output data to include in the model response. Currently
|
|
431
446
|
# supported values are:
|
|
@@ -653,6 +668,7 @@ module OpenAI
|
|
|
653
668
|
?background: bool?,
|
|
654
669
|
?context_management: ::Array[OpenAI::Beta::BetaResponsesClientEvent::ResponseCreate::ContextManagement]?,
|
|
655
670
|
?conversation: OpenAI::Models::Beta::BetaResponsesClientEvent::ResponseCreate::conversation?,
|
|
671
|
+
?generate: bool,
|
|
656
672
|
?include: ::Array[OpenAI::Models::Beta::beta_response_includable]?,
|
|
657
673
|
?input: OpenAI::Models::Beta::BetaResponsesClientEvent::ResponseCreate::input,
|
|
658
674
|
?instructions: String?,
|
|
@@ -692,6 +708,7 @@ module OpenAI
|
|
|
692
708
|
?background: bool?,
|
|
693
709
|
?context_management: ::Array[OpenAI::Beta::BetaResponsesClientEvent::ResponseCreate::ContextManagement]?,
|
|
694
710
|
?conversation: OpenAI::Models::Beta::BetaResponsesClientEvent::ResponseCreate::conversation?,
|
|
711
|
+
?generate: bool,
|
|
695
712
|
?include: ::Array[OpenAI::Models::Beta::beta_response_includable]?,
|
|
696
713
|
?input: OpenAI::Models::Beta::BetaResponsesClientEvent::ResponseCreate::input,
|
|
697
714
|
?instructions: String?,
|
|
@@ -645,8 +645,8 @@ module OpenAI
|
|
|
645
645
|
|
|
646
646
|
# Control how much effort the model will exert to match the style and features,
|
|
647
647
|
# especially facial features, of input images. Supports `high` and `low` on
|
|
648
|
-
# `gpt-image-1
|
|
649
|
-
#
|
|
648
|
+
# `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
|
|
649
|
+
# this parameter. Defaults to `low` on supported models.
|
|
650
650
|
attr_accessor input_fidelity: OpenAI::Models::Beta::BetaTool::ImageGeneration::input_fidelity?
|
|
651
651
|
|
|
652
652
|
# Optional mask for inpainting. Contains `image_url` (string, optional) and
|
|
@@ -768,8 +768,8 @@ module OpenAI
|
|
|
768
768
|
# @param input_fidelity
|
|
769
769
|
# Control how much effort the model will exert to match the style and features,
|
|
770
770
|
# especially facial features, of input images. Supports `high` and `low` on
|
|
771
|
-
# `gpt-image-1
|
|
772
|
-
#
|
|
771
|
+
# `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
|
|
772
|
+
# this parameter. Defaults to `low` on supported models.
|
|
773
773
|
# @param input_image_mask
|
|
774
774
|
# Optional mask for inpainting. Contains `image_url` (string, optional) and
|
|
775
775
|
# `file_id` (string, optional).
|
|
@@ -298,7 +298,9 @@ module OpenAI
|
|
|
298
298
|
# can call.
|
|
299
299
|
def tool_choice=: (
|
|
300
300
|
OpenAI::Models::Beta::ResponseCreateParams::tool_choice
|
|
301
|
-
|
|
301
|
+
| { type: :programmatic_tool_calling }
|
|
302
|
+
) -> (OpenAI::Models::Beta::ResponseCreateParams::tool_choice
|
|
303
|
+
| { type: :programmatic_tool_calling })
|
|
302
304
|
|
|
303
305
|
# An array of tools the model may call while generating a response. You can
|
|
304
306
|
# specify which tool to use by setting the `tool_choice` parameter.
|
|
@@ -633,7 +635,8 @@ module OpenAI
|
|
|
633
635
|
?stream_options: OpenAI::Beta::ResponseCreateParams::StreamOptions?,
|
|
634
636
|
?temperature: Float?,
|
|
635
637
|
?text: OpenAI::Beta::BetaResponseTextConfig,
|
|
636
|
-
?tool_choice: OpenAI::Models::Beta::ResponseCreateParams::tool_choice
|
|
638
|
+
?tool_choice: OpenAI::Models::Beta::ResponseCreateParams::tool_choice
|
|
639
|
+
| { type: :programmatic_tool_calling },
|
|
637
640
|
?tools: ::Array[OpenAI::Models::Beta::beta_tool],
|
|
638
641
|
?top_logprobs: Integer?,
|
|
639
642
|
?top_p: Float?,
|
|
@@ -79,7 +79,14 @@ module OpenAI
|
|
|
79
79
|
attr_accessor text: OpenAI::Beta::Responses::InputTokenCountParams::Text?
|
|
80
80
|
|
|
81
81
|
# Controls which tool the model should use, if any.
|
|
82
|
-
|
|
82
|
+
attr_reader tool_choice: OpenAI::Models::Beta::Responses::InputTokenCountParams::tool_choice?
|
|
83
|
+
|
|
84
|
+
# Controls which tool the model should use, if any.
|
|
85
|
+
def tool_choice=: (
|
|
86
|
+
(OpenAI::Models::Beta::Responses::InputTokenCountParams::tool_choice
|
|
87
|
+
| { type: :programmatic_tool_calling })?
|
|
88
|
+
) -> (OpenAI::Models::Beta::Responses::InputTokenCountParams::tool_choice
|
|
89
|
+
| { type: :programmatic_tool_calling })?
|
|
83
90
|
|
|
84
91
|
# An array of tools the model may call while generating a response. You can
|
|
85
92
|
# specify which tool to use by setting the `tool_choice` parameter.
|
|
@@ -166,7 +173,8 @@ module OpenAI
|
|
|
166
173
|
?previous_response_id: String?,
|
|
167
174
|
?reasoning: OpenAI::Beta::Responses::InputTokenCountParams::Reasoning?,
|
|
168
175
|
?text: OpenAI::Beta::Responses::InputTokenCountParams::Text?,
|
|
169
|
-
?tool_choice: OpenAI::Models::Beta::Responses::InputTokenCountParams::tool_choice
|
|
176
|
+
?tool_choice: (OpenAI::Models::Beta::Responses::InputTokenCountParams::tool_choice
|
|
177
|
+
| { type: :programmatic_tool_calling })?,
|
|
170
178
|
?tools: ::Array[OpenAI::Models::Beta::beta_tool]?,
|
|
171
179
|
?truncation: OpenAI::Models::Beta::Responses::InputTokenCountParams::truncation,
|
|
172
180
|
?betas: ::Array[OpenAI::Models::Beta::Responses::InputTokenCountParams::beta],
|
|
@@ -441,8 +441,10 @@ module OpenAI
|
|
|
441
441
|
|
|
442
442
|
# The tools to add this file to.
|
|
443
443
|
def tools=: (
|
|
444
|
-
::Array[OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment::tool
|
|
445
|
-
|
|
444
|
+
::Array[OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment::tool
|
|
445
|
+
| { type: :file_search }]
|
|
446
|
+
) -> ::Array[(OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment::tool
|
|
447
|
+
| { type: :file_search })]
|
|
446
448
|
|
|
447
449
|
# @param file_id
|
|
448
450
|
# The ID of the file to attach to the message.
|
|
@@ -450,7 +452,8 @@ module OpenAI
|
|
|
450
452
|
# The tools to add this file to.
|
|
451
453
|
def initialize: (
|
|
452
454
|
?file_id: String,
|
|
453
|
-
?tools: ::Array[OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment::tool
|
|
455
|
+
?tools: ::Array[OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::Message::Attachment::tool
|
|
456
|
+
| { type: :file_search }]
|
|
454
457
|
) -> void
|
|
455
458
|
|
|
456
459
|
def to_hash: -> {
|
|
@@ -603,7 +606,9 @@ module OpenAI
|
|
|
603
606
|
# strategy.
|
|
604
607
|
def chunking_strategy=: (
|
|
605
608
|
OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::chunking_strategy
|
|
606
|
-
|
|
609
|
+
| { type: :auto }
|
|
610
|
+
) -> (OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::chunking_strategy
|
|
611
|
+
| { type: :auto })
|
|
607
612
|
|
|
608
613
|
# A list of [file](https://developers.openai.com/api/reference/resources/files)
|
|
609
614
|
# IDs to add to the vector store. For vector stores created before Nov 2025, there
|
|
@@ -641,7 +646,8 @@ module OpenAI
|
|
|
641
646
|
# Keys are strings with a maximum length of 64 characters. Values are strings with
|
|
642
647
|
# a maximum length of 512 characters.
|
|
643
648
|
def initialize: (
|
|
644
|
-
?chunking_strategy: OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::chunking_strategy
|
|
649
|
+
?chunking_strategy: OpenAI::Models::Beta::ThreadCreateAndRunParams::Thread::ToolResources::FileSearch::VectorStore::chunking_strategy
|
|
650
|
+
| { type: :auto },
|
|
645
651
|
?file_ids: ::Array[String],
|
|
646
652
|
?metadata: OpenAI::Models::metadata?
|
|
647
653
|
) -> void
|