openai 0.117.0 → 0.119.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 +23 -0
- data/README.md +1 -1
- data/lib/openai/client.rb +1 -1
- data/lib/openai/helpers/data_residency.rb +4 -1
- data/lib/openai/models/admin/organization/projects/project_optional_service_tier.rb +24 -0
- data/lib/openai/models/admin/organization/projects/project_service_tier_settings.rb +88 -0
- data/lib/openai/models/admin/organization/projects/service_tier_setting_retrieve_params.rb +29 -0
- data/lib/openai/models/admin/organization/projects/service_tier_setting_update_params.rb +92 -0
- data/lib/openai/models/all_models.rb +1 -0
- data/lib/openai/models/beta/beta_compacted_response.rb +34 -1
- data/lib/openai/models/beta/beta_response.rb +35 -1
- data/lib/openai/models/beta/beta_response_input_item.rb +45 -1
- data/lib/openai/models/beta/beta_response_item.rb +45 -1
- data/lib/openai/models/beta/beta_response_output_item.rb +45 -1
- data/lib/openai/models/beta/beta_response_tool_search_output_item_param.rb +186 -13
- data/lib/openai/models/beta/beta_response_usage.rb +33 -1
- data/lib/openai/models/beta/beta_responses_client_event.rb +58 -10
- data/lib/openai/models/beta/beta_tool.rb +164 -13
- data/lib/openai/models/beta/response_compact_params.rb +47 -4
- data/lib/openai/models/beta/response_create_params.rb +54 -10
- data/lib/openai/models/beta/session_turn_error.rb +3 -0
- data/lib/openai/models/chat/completion_create_params.rb +3 -3
- data/lib/openai/models/conversations/conversation_item.rb +45 -1
- data/lib/openai/models/image_edit_params.rb +72 -16
- data/lib/openai/models/image_generate_params.rb +160 -8
- data/lib/openai/models/image_model.rb +2 -0
- data/lib/openai/models/images_response.rb +55 -4
- data/lib/openai/models/realtime/realtime_audio_config_input.rb +14 -1
- data/lib/openai/models/realtime/realtime_session_create_response.rb +14 -1
- data/lib/openai/models/realtime/realtime_transcription_session_audio_input.rb +14 -1
- data/lib/openai/models/realtime/realtime_transcription_session_create_response.rb +14 -1
- data/lib/openai/models/realtime/realtime_translation_session.rb +14 -1
- data/lib/openai/models/realtime/realtime_translation_session_create_request.rb +14 -1
- data/lib/openai/models/realtime/realtime_translation_session_update_request.rb +14 -1
- data/lib/openai/models/responses/compacted_response.rb +37 -1
- data/lib/openai/models/responses/response.rb +35 -1
- data/lib/openai/models/responses/response_compact_params.rb +53 -4
- data/lib/openai/models/responses/response_create_params.rb +57 -10
- data/lib/openai/models/responses/response_input_item.rb +45 -1
- data/lib/openai/models/responses/response_item.rb +45 -1
- data/lib/openai/models/responses/response_output_item.rb +45 -1
- data/lib/openai/models/responses/response_tool_search_output_item_param.rb +186 -13
- data/lib/openai/models/responses/response_usage.rb +33 -1
- data/lib/openai/models/responses/responses_client_event.rb +58 -10
- data/lib/openai/models/responses/tool.rb +164 -13
- data/lib/openai/models/responses_model.rb +1 -0
- data/lib/openai/resources/admin/organization/projects/service_tier_settings.rb +77 -0
- data/lib/openai/resources/admin/organization/projects.rb +6 -0
- data/lib/openai/resources/admin/organization.rb +6 -6
- data/lib/openai/resources/beta/responses.rb +18 -9
- data/lib/openai/resources/chat/completions.rb +2 -2
- data/lib/openai/resources/images.rb +102 -18
- data/lib/openai/resources/responses.rb +15 -6
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +5 -0
- data/rbi/openai/models/admin/organization/projects/project_optional_service_tier.rbi +45 -0
- data/rbi/openai/models/admin/organization/projects/project_service_tier_settings.rbi +143 -0
- data/rbi/openai/models/admin/organization/projects/service_tier_setting_retrieve_params.rbi +63 -0
- data/rbi/openai/models/admin/organization/projects/service_tier_setting_update_params.rbi +183 -0
- data/rbi/openai/models/all_models.rbi +1 -0
- data/rbi/openai/models/beta/beta_compacted_response.rbi +67 -1
- data/rbi/openai/models/beta/beta_response.rbi +63 -0
- data/rbi/openai/models/beta/beta_response_input_item.rbi +82 -1
- data/rbi/openai/models/beta/beta_response_item.rbi +82 -1
- data/rbi/openai/models/beta/beta_response_output_item.rbi +82 -1
- data/rbi/openai/models/beta/beta_response_tool_search_output_item_param.rbi +338 -13
- data/rbi/openai/models/beta/beta_response_usage.rbi +66 -3
- data/rbi/openai/models/beta/beta_responses_client_event.rbi +118 -9
- data/rbi/openai/models/beta/beta_tool.rbi +245 -13
- data/rbi/openai/models/beta/response_compact_params.rbi +84 -3
- data/rbi/openai/models/beta/response_create_params.rbi +91 -9
- data/rbi/openai/models/beta/session_turn_error.rbi +3 -0
- data/rbi/openai/models/chat/completion_create_params.rbi +3 -3
- data/rbi/openai/models/conversations/conversation_item.rbi +84 -1
- data/rbi/openai/models/image_edit_params.rbi +76 -14
- data/rbi/openai/models/image_generate_params.rbi +218 -6
- data/rbi/openai/models/image_model.rbi +2 -0
- data/rbi/openai/models/images_response.rbi +90 -3
- data/rbi/openai/models/realtime/realtime_audio_config_input.rbi +17 -1
- data/rbi/openai/models/realtime/realtime_session_create_response.rbi +17 -1
- data/rbi/openai/models/realtime/realtime_transcription_session_audio_input.rbi +17 -1
- data/rbi/openai/models/realtime/realtime_transcription_session_create_response.rbi +17 -1
- data/rbi/openai/models/realtime/realtime_translation_session.rbi +19 -3
- data/rbi/openai/models/realtime/realtime_translation_session_create_request.rbi +19 -3
- data/rbi/openai/models/realtime/realtime_translation_session_update_request.rbi +19 -3
- data/rbi/openai/models/responses/compacted_response.rbi +67 -1
- data/rbi/openai/models/responses/response.rbi +63 -0
- data/rbi/openai/models/responses/response_compact_params.rbi +91 -3
- data/rbi/openai/models/responses/response_create_params.rbi +97 -9
- data/rbi/openai/models/responses/response_input_item.rbi +82 -1
- data/rbi/openai/models/responses/response_item.rbi +82 -1
- data/rbi/openai/models/responses/response_output_item.rbi +82 -1
- data/rbi/openai/models/responses/response_tool_search_output_item_param.rbi +340 -13
- data/rbi/openai/models/responses/response_usage.rbi +66 -3
- data/rbi/openai/models/responses/responses_client_event.rbi +118 -9
- data/rbi/openai/models/responses/tool.rbi +248 -13
- data/rbi/openai/models/responses_model.rbi +1 -0
- data/rbi/openai/resources/admin/organization/projects/service_tier_settings.rbi +67 -0
- data/rbi/openai/resources/admin/organization/projects.rbi +3 -0
- data/rbi/openai/resources/admin/organization.rbi +3 -3
- data/rbi/openai/resources/beta/responses.rbi +15 -6
- data/rbi/openai/resources/chat/completions.rbi +2 -2
- data/rbi/openai/resources/images.rbi +98 -14
- data/rbi/openai/resources/responses.rbi +14 -3
- data/sig/openai/models/admin/organization/projects/project_optional_service_tier.rbs +23 -0
- data/sig/openai/models/admin/organization/projects/project_service_tier_settings.rbs +72 -0
- data/sig/openai/models/admin/organization/projects/service_tier_setting_retrieve_params.rbs +32 -0
- data/sig/openai/models/admin/organization/projects/service_tier_setting_update_params.rbs +91 -0
- data/sig/openai/models/all_models.rbs +2 -0
- data/sig/openai/models/beta/beta_compacted_response.rbs +42 -2
- data/sig/openai/models/beta/beta_response.rbs +42 -1
- data/sig/openai/models/beta/beta_response_input_item.rbs +51 -3
- data/sig/openai/models/beta/beta_response_item.rbs +51 -3
- data/sig/openai/models/beta/beta_response_output_item.rbs +51 -3
- data/sig/openai/models/beta/beta_response_tool_search_output_item_param.rbs +188 -15
- data/sig/openai/models/beta/beta_response_usage.rbs +40 -3
- data/sig/openai/models/beta/beta_responses_client_event.rbs +67 -10
- data/sig/openai/models/beta/beta_tool.rbs +188 -15
- data/sig/openai/models/beta/response_compact_params.rbs +58 -2
- data/sig/openai/models/beta/response_create_params.rbs +67 -10
- data/sig/openai/models/beta/session_turn_error.rbs +4 -0
- data/sig/openai/models/chat/completion_create_params.rbs +3 -3
- data/sig/openai/models/conversations/conversation_item.rbs +51 -3
- data/sig/openai/models/image_edit_params.rbs +63 -12
- data/sig/openai/models/image_generate_params.rbs +150 -5
- data/sig/openai/models/image_model.rbs +4 -0
- data/sig/openai/models/images_response.rbs +59 -4
- data/sig/openai/models/realtime/realtime_audio_config_input.rbs +20 -1
- data/sig/openai/models/realtime/realtime_session_create_response.rbs +20 -1
- data/sig/openai/models/realtime/realtime_transcription_session_audio_input.rbs +20 -1
- data/sig/openai/models/realtime/realtime_transcription_session_create_response.rbs +20 -1
- data/sig/openai/models/realtime/realtime_translation_session.rbs +22 -3
- data/sig/openai/models/realtime/realtime_translation_session_create_request.rbs +22 -3
- data/sig/openai/models/realtime/realtime_translation_session_update_request.rbs +22 -3
- data/sig/openai/models/responses/compacted_response.rbs +42 -2
- data/sig/openai/models/responses/response.rbs +42 -1
- data/sig/openai/models/responses/response_compact_params.rbs +60 -2
- data/sig/openai/models/responses/response_create_params.rbs +67 -10
- data/sig/openai/models/responses/response_input_item.rbs +51 -3
- data/sig/openai/models/responses/response_item.rbs +51 -3
- data/sig/openai/models/responses/response_output_item.rbs +51 -3
- data/sig/openai/models/responses/response_tool_search_output_item_param.rbs +188 -15
- data/sig/openai/models/responses/response_usage.rbs +40 -3
- data/sig/openai/models/responses/responses_client_event.rbs +67 -10
- data/sig/openai/models/responses/tool.rbs +188 -15
- data/sig/openai/models/responses_model.rbs +2 -0
- data/sig/openai/resources/admin/organization/projects/service_tier_settings.rbs +25 -0
- data/sig/openai/resources/admin/organization/projects.rbs +2 -0
- data/sig/openai/resources/admin/organization.rbs +2 -2
- data/sig/openai/resources/beta/responses.rbs +3 -0
- data/sig/openai/resources/images.rbs +14 -0
- data/sig/openai/resources/responses.rbs +4 -0
- metadata +16 -1
|
@@ -354,7 +354,12 @@ module OpenAI
|
|
|
354
354
|
# @return [String, Symbol, OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::Size, nil]
|
|
355
355
|
optional :size, union: -> { OpenAI::Responses::ResponseItem::ImageGenerationCall::Size }, nil?: true
|
|
356
356
|
|
|
357
|
-
# @!
|
|
357
|
+
# @!attribute svg_usage
|
|
358
|
+
#
|
|
359
|
+
# @return [OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::SvgUsage, nil]
|
|
360
|
+
optional :svg_usage, -> { OpenAI::Responses::ResponseItem::ImageGenerationCall::SvgUsage }
|
|
361
|
+
|
|
362
|
+
# @!method initialize(id:, result:, status:, action: nil, background: nil, error: nil, output_format: nil, quality: nil, revised_prompt: nil, size: nil, svg_usage: nil, type: :image_generation_call)
|
|
358
363
|
# An image generation request made by the model.
|
|
359
364
|
#
|
|
360
365
|
# @param id [String]
|
|
@@ -388,6 +393,8 @@ module OpenAI
|
|
|
388
393
|
# @param size [String, Symbol, OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::Size, nil]
|
|
389
394
|
# The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
|
|
390
395
|
#
|
|
396
|
+
# @param svg_usage [OpenAI::Models::Responses::ResponseItem::ImageGenerationCall::SvgUsage]
|
|
397
|
+
#
|
|
391
398
|
# @param type [Symbol, :image_generation_call]
|
|
392
399
|
# The type of the image generation call. Always `image_generation_call`.
|
|
393
400
|
|
|
@@ -540,6 +547,8 @@ module OpenAI
|
|
|
540
547
|
PNG = :png
|
|
541
548
|
WEBP = :webp
|
|
542
549
|
JPEG = :jpeg
|
|
550
|
+
GIF = :gif
|
|
551
|
+
SVG = :svg
|
|
543
552
|
|
|
544
553
|
# @!method self.values
|
|
545
554
|
# @return [Array<Symbol>]
|
|
@@ -592,6 +601,41 @@ module OpenAI
|
|
|
592
601
|
|
|
593
602
|
# @!endgroup
|
|
594
603
|
end
|
|
604
|
+
|
|
605
|
+
# @see OpenAI::Models::Responses::ResponseItem::ImageGenerationCall#svg_usage
|
|
606
|
+
class SvgUsage < OpenAI::Internal::Type::BaseModel
|
|
607
|
+
# @!attribute input_tokens
|
|
608
|
+
#
|
|
609
|
+
# @return [Integer]
|
|
610
|
+
required :input_tokens, Integer
|
|
611
|
+
|
|
612
|
+
# @!attribute model
|
|
613
|
+
#
|
|
614
|
+
# @return [String]
|
|
615
|
+
required :model, String
|
|
616
|
+
|
|
617
|
+
# @!attribute output_tokens
|
|
618
|
+
#
|
|
619
|
+
# @return [Integer]
|
|
620
|
+
required :output_tokens, Integer
|
|
621
|
+
|
|
622
|
+
# @!attribute reasoning_tokens
|
|
623
|
+
#
|
|
624
|
+
# @return [Integer]
|
|
625
|
+
required :reasoning_tokens, Integer
|
|
626
|
+
|
|
627
|
+
# @!attribute total_tokens
|
|
628
|
+
#
|
|
629
|
+
# @return [Integer]
|
|
630
|
+
required :total_tokens, Integer
|
|
631
|
+
|
|
632
|
+
# @!method initialize(input_tokens:, model:, output_tokens:, reasoning_tokens:, total_tokens:)
|
|
633
|
+
# @param input_tokens [Integer]
|
|
634
|
+
# @param model [String]
|
|
635
|
+
# @param output_tokens [Integer]
|
|
636
|
+
# @param reasoning_tokens [Integer]
|
|
637
|
+
# @param total_tokens [Integer]
|
|
638
|
+
end
|
|
595
639
|
end
|
|
596
640
|
|
|
597
641
|
class LocalShellCall < OpenAI::Internal::Type::BaseModel
|
|
@@ -350,7 +350,12 @@ module OpenAI
|
|
|
350
350
|
nil?: true
|
|
351
351
|
)
|
|
352
352
|
|
|
353
|
-
# @!
|
|
353
|
+
# @!attribute svg_usage
|
|
354
|
+
#
|
|
355
|
+
# @return [OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::SvgUsage, nil]
|
|
356
|
+
optional :svg_usage, -> { OpenAI::Responses::ResponseOutputItem::ImageGenerationCall::SvgUsage }
|
|
357
|
+
|
|
358
|
+
# @!method initialize(id:, result:, status:, action: nil, background: nil, error: nil, output_format: nil, quality: nil, revised_prompt: nil, size: nil, svg_usage: nil, type: :image_generation_call)
|
|
354
359
|
# An image generation request made by the model.
|
|
355
360
|
#
|
|
356
361
|
# @param id [String]
|
|
@@ -384,6 +389,8 @@ module OpenAI
|
|
|
384
389
|
# @param size [String, Symbol, OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::Size, nil]
|
|
385
390
|
# The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
|
|
386
391
|
#
|
|
392
|
+
# @param svg_usage [OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall::SvgUsage]
|
|
393
|
+
#
|
|
387
394
|
# @param type [Symbol, :image_generation_call]
|
|
388
395
|
# The type of the image generation call. Always `image_generation_call`.
|
|
389
396
|
|
|
@@ -536,6 +543,8 @@ module OpenAI
|
|
|
536
543
|
PNG = :png
|
|
537
544
|
WEBP = :webp
|
|
538
545
|
JPEG = :jpeg
|
|
546
|
+
GIF = :gif
|
|
547
|
+
SVG = :svg
|
|
539
548
|
|
|
540
549
|
# @!method self.values
|
|
541
550
|
# @return [Array<Symbol>]
|
|
@@ -596,6 +605,41 @@ module OpenAI
|
|
|
596
605
|
|
|
597
606
|
# @!endgroup
|
|
598
607
|
end
|
|
608
|
+
|
|
609
|
+
# @see OpenAI::Models::Responses::ResponseOutputItem::ImageGenerationCall#svg_usage
|
|
610
|
+
class SvgUsage < OpenAI::Internal::Type::BaseModel
|
|
611
|
+
# @!attribute input_tokens
|
|
612
|
+
#
|
|
613
|
+
# @return [Integer]
|
|
614
|
+
required :input_tokens, Integer
|
|
615
|
+
|
|
616
|
+
# @!attribute model
|
|
617
|
+
#
|
|
618
|
+
# @return [String]
|
|
619
|
+
required :model, String
|
|
620
|
+
|
|
621
|
+
# @!attribute output_tokens
|
|
622
|
+
#
|
|
623
|
+
# @return [Integer]
|
|
624
|
+
required :output_tokens, Integer
|
|
625
|
+
|
|
626
|
+
# @!attribute reasoning_tokens
|
|
627
|
+
#
|
|
628
|
+
# @return [Integer]
|
|
629
|
+
required :reasoning_tokens, Integer
|
|
630
|
+
|
|
631
|
+
# @!attribute total_tokens
|
|
632
|
+
#
|
|
633
|
+
# @return [Integer]
|
|
634
|
+
required :total_tokens, Integer
|
|
635
|
+
|
|
636
|
+
# @!method initialize(input_tokens:, model:, output_tokens:, reasoning_tokens:, total_tokens:)
|
|
637
|
+
# @param input_tokens [Integer]
|
|
638
|
+
# @param model [String]
|
|
639
|
+
# @param output_tokens [Integer]
|
|
640
|
+
# @param reasoning_tokens [Integer]
|
|
641
|
+
# @param total_tokens [Integer]
|
|
642
|
+
end
|
|
599
643
|
end
|
|
600
644
|
|
|
601
645
|
class LocalShellCall < OpenAI::Internal::Type::BaseModel
|
|
@@ -752,6 +752,32 @@ module OpenAI
|
|
|
752
752
|
enum: -> { OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Background }
|
|
753
753
|
)
|
|
754
754
|
|
|
755
|
+
# @!attribute complexity
|
|
756
|
+
# Computation spent planning the image, independently of rendering quality.
|
|
757
|
+
# Overrides the outer response's `reasoning.effort` for image generation. When
|
|
758
|
+
# omitted, inherits a supported outer reasoning effort or uses the image model's
|
|
759
|
+
# configured default. For SVG output, controls the reference image, not the SVG
|
|
760
|
+
# author's reasoning.
|
|
761
|
+
#
|
|
762
|
+
# @return [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Complexity, nil]
|
|
763
|
+
optional(
|
|
764
|
+
:complexity,
|
|
765
|
+
enum: -> { OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Complexity }
|
|
766
|
+
)
|
|
767
|
+
|
|
768
|
+
# @!attribute frame_count
|
|
769
|
+
# Number of GIF frames. Requires `output_format` to be `gif`. Default: 9.
|
|
770
|
+
#
|
|
771
|
+
# @return [Integer, nil]
|
|
772
|
+
optional :frame_count, Integer
|
|
773
|
+
|
|
774
|
+
# @!attribute frame_duration_ms
|
|
775
|
+
# Duration of each GIF frame in milliseconds, rounded to 10 ms. Requires
|
|
776
|
+
# `output_format` to be `gif`. Default: 200.
|
|
777
|
+
#
|
|
778
|
+
# @return [Integer, nil]
|
|
779
|
+
optional :frame_duration_ms, Integer
|
|
780
|
+
|
|
755
781
|
# @!attribute input_fidelity
|
|
756
782
|
# Control how much effort the model will exert to match the style and features,
|
|
757
783
|
# especially facial features, of input images. Supports `high` and `low` on
|
|
@@ -781,8 +807,8 @@ module OpenAI
|
|
|
781
807
|
# The image generation model to use. One of `gpt-image-1-mini`, `gpt-image-1.5`,
|
|
782
808
|
# `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
|
|
783
809
|
# `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
|
|
784
|
-
# `gpt-image-2.5-flare-2026-09-08`,
|
|
785
|
-
# `gpt-image-2`.
|
|
810
|
+
# `gpt-image-2.5-flare-2026-09-08`, `gpt-image-2.6-sunburst`,
|
|
811
|
+
# `gpt-image-2.6-flare`, or `chatgpt-image-latest`. Default: `gpt-image-2`.
|
|
786
812
|
#
|
|
787
813
|
# `gpt-image-1` was shut down on October 23, 2026. Use `gpt-image-2.5-sunburst` or
|
|
788
814
|
# `gpt-image-2.5-flare` instead.
|
|
@@ -809,8 +835,12 @@ module OpenAI
|
|
|
809
835
|
optional :output_compression, Integer
|
|
810
836
|
|
|
811
837
|
# @!attribute output_format
|
|
812
|
-
# The output format of the generated image. One of `png`, `webp`,
|
|
813
|
-
# Default: `png`.
|
|
838
|
+
# The output format of the generated image. One of `png`, `webp`, `jpeg`, `gif`,
|
|
839
|
+
# or `svg`. Default: `png`. GIF and SVG output require a model that supports the
|
|
840
|
+
# selected format. GIF output does not support partial image streaming
|
|
841
|
+
# (`partial_images` greater than `0`), `input_image_mask`, or custom
|
|
842
|
+
# `output_compression`. Responses lifecycle events can still be streamed for GIF
|
|
843
|
+
# output.
|
|
814
844
|
#
|
|
815
845
|
# @return [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::OutputFormat, nil]
|
|
816
846
|
optional(
|
|
@@ -855,7 +885,16 @@ module OpenAI
|
|
|
855
885
|
union: -> { OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Size }
|
|
856
886
|
)
|
|
857
887
|
|
|
858
|
-
# @!
|
|
888
|
+
# @!attribute svg
|
|
889
|
+
# SVG author model settings. Requires `output_format` to be `svg`. When SVG model
|
|
890
|
+
# selection is enabled, omitting this object uses the outer response model.
|
|
891
|
+
# Otherwise, the default SVG author is used and explicit model overrides are
|
|
892
|
+
# unavailable.
|
|
893
|
+
#
|
|
894
|
+
# @return [OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Svg, nil]
|
|
895
|
+
optional :svg, -> { OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Svg }
|
|
896
|
+
|
|
897
|
+
# @!method initialize(action: nil, background: nil, complexity: nil, frame_count: nil, frame_duration_ms: nil, input_fidelity: nil, input_image_mask: nil, model: nil, moderation: nil, output_compression: nil, output_format: nil, partial_images: nil, quality: nil, size: nil, svg: nil, type: :image_generation)
|
|
859
898
|
# A tool that generates images using the GPT image models.
|
|
860
899
|
#
|
|
861
900
|
# @param action [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Action]
|
|
@@ -872,6 +911,20 @@ module OpenAI
|
|
|
872
911
|
# `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`,
|
|
873
912
|
# set the output format to `png` or `webp`.
|
|
874
913
|
#
|
|
914
|
+
# @param complexity [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Complexity]
|
|
915
|
+
# Computation spent planning the image, independently of rendering quality.
|
|
916
|
+
# Overrides the outer response's `reasoning.effort` for image generation. When
|
|
917
|
+
# omitted, inherits a supported outer reasoning effort or uses the image model's
|
|
918
|
+
# configured default. For SVG output, controls the reference image, not the SVG
|
|
919
|
+
# author's reasoning.
|
|
920
|
+
#
|
|
921
|
+
# @param frame_count [Integer]
|
|
922
|
+
# Number of GIF frames. Requires `output_format` to be `gif`. Default: 9.
|
|
923
|
+
#
|
|
924
|
+
# @param frame_duration_ms [Integer]
|
|
925
|
+
# Duration of each GIF frame in milliseconds, rounded to 10 ms. Requires
|
|
926
|
+
# `output_format` to be `gif`. Default: 200.
|
|
927
|
+
#
|
|
875
928
|
# @param input_fidelity [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::InputFidelity, nil]
|
|
876
929
|
# Control how much effort the model will exert to match the style and features,
|
|
877
930
|
# especially facial features, of input images. Supports `high` and `low` on
|
|
@@ -886,8 +939,8 @@ module OpenAI
|
|
|
886
939
|
# The image generation model to use. One of `gpt-image-1-mini`, `gpt-image-1.5`,
|
|
887
940
|
# `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
|
|
888
941
|
# `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
|
|
889
|
-
# `gpt-image-2.5-flare-2026-09-08`,
|
|
890
|
-
# `gpt-image-2`.
|
|
942
|
+
# `gpt-image-2.5-flare-2026-09-08`, `gpt-image-2.6-sunburst`,
|
|
943
|
+
# `gpt-image-2.6-flare`, or `chatgpt-image-latest`. Default: `gpt-image-2`.
|
|
891
944
|
#
|
|
892
945
|
# `gpt-image-1` was shut down on October 23, 2026. Use `gpt-image-2.5-sunburst` or
|
|
893
946
|
# `gpt-image-2.5-flare` instead.
|
|
@@ -899,8 +952,12 @@ module OpenAI
|
|
|
899
952
|
# Compression level for the output image. Default: 100.
|
|
900
953
|
#
|
|
901
954
|
# @param output_format [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::OutputFormat]
|
|
902
|
-
# The output format of the generated image. One of `png`, `webp`,
|
|
903
|
-
# Default: `png`.
|
|
955
|
+
# The output format of the generated image. One of `png`, `webp`, `jpeg`, `gif`,
|
|
956
|
+
# or `svg`. Default: `png`. GIF and SVG output require a model that supports the
|
|
957
|
+
# selected format. GIF output does not support partial image streaming
|
|
958
|
+
# (`partial_images` greater than `0`), `input_image_mask`, or custom
|
|
959
|
+
# `output_compression`. Responses lifecycle events can still be streamed for GIF
|
|
960
|
+
# output.
|
|
904
961
|
#
|
|
905
962
|
# @param partial_images [Integer]
|
|
906
963
|
# Number of partial images to generate in streaming mode, from 0 (default value)
|
|
@@ -924,6 +981,12 @@ module OpenAI
|
|
|
924
981
|
# `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
|
|
925
982
|
# `auto` is supported for models that allow automatic sizing.
|
|
926
983
|
#
|
|
984
|
+
# @param svg [OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Svg]
|
|
985
|
+
# SVG author model settings. Requires `output_format` to be `svg`. When SVG model
|
|
986
|
+
# selection is enabled, omitting this object uses the outer response model.
|
|
987
|
+
# Otherwise, the default SVG author is used and explicit model overrides are
|
|
988
|
+
# unavailable.
|
|
989
|
+
#
|
|
927
990
|
# @param type [Symbol, :image_generation]
|
|
928
991
|
# The type of the image generation tool. Always `image_generation`.
|
|
929
992
|
|
|
@@ -963,6 +1026,24 @@ module OpenAI
|
|
|
963
1026
|
# @return [Array<Symbol>]
|
|
964
1027
|
end
|
|
965
1028
|
|
|
1029
|
+
# Computation spent planning the image, independently of rendering quality.
|
|
1030
|
+
# Overrides the outer response's `reasoning.effort` for image generation. When
|
|
1031
|
+
# omitted, inherits a supported outer reasoning effort or uses the image model's
|
|
1032
|
+
# configured default. For SVG output, controls the reference image, not the SVG
|
|
1033
|
+
# author's reasoning.
|
|
1034
|
+
#
|
|
1035
|
+
# @see OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration#complexity
|
|
1036
|
+
module Complexity
|
|
1037
|
+
extend OpenAI::Internal::Type::Enum
|
|
1038
|
+
|
|
1039
|
+
LOW = :low
|
|
1040
|
+
MEDIUM = :medium
|
|
1041
|
+
HIGH = :high
|
|
1042
|
+
|
|
1043
|
+
# @!method self.values
|
|
1044
|
+
# @return [Array<Symbol>]
|
|
1045
|
+
end
|
|
1046
|
+
|
|
966
1047
|
# Control how much effort the model will exert to match the style and features,
|
|
967
1048
|
# especially facial features, of input images. Supports `high` and `low` on
|
|
968
1049
|
# `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For `gpt-image-2`, omit
|
|
@@ -1007,8 +1088,8 @@ module OpenAI
|
|
|
1007
1088
|
# The image generation model to use. One of `gpt-image-1-mini`, `gpt-image-1.5`,
|
|
1008
1089
|
# `gpt-image-2`, `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
|
|
1009
1090
|
# `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
|
|
1010
|
-
# `gpt-image-2.5-flare-2026-09-08`,
|
|
1011
|
-
# `gpt-image-2`.
|
|
1091
|
+
# `gpt-image-2.5-flare-2026-09-08`, `gpt-image-2.6-sunburst`,
|
|
1092
|
+
# `gpt-image-2.6-flare`, or `chatgpt-image-latest`. Default: `gpt-image-2`.
|
|
1012
1093
|
#
|
|
1013
1094
|
# `gpt-image-1` was shut down on October 23, 2026. Use `gpt-image-2.5-sunburst` or
|
|
1014
1095
|
# `gpt-image-2.5-flare` instead.
|
|
@@ -1067,6 +1148,18 @@ module OpenAI
|
|
|
1067
1148
|
}
|
|
1068
1149
|
)
|
|
1069
1150
|
|
|
1151
|
+
variant(
|
|
1152
|
+
const: -> {
|
|
1153
|
+
OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::GPT_IMAGE_2_6_SUNBURST
|
|
1154
|
+
}
|
|
1155
|
+
)
|
|
1156
|
+
|
|
1157
|
+
variant(
|
|
1158
|
+
const: -> {
|
|
1159
|
+
OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::GPT_IMAGE_2_6_FLARE
|
|
1160
|
+
}
|
|
1161
|
+
)
|
|
1162
|
+
|
|
1070
1163
|
variant(
|
|
1071
1164
|
const: -> {
|
|
1072
1165
|
OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::GPT_IMAGE_1_5
|
|
@@ -1103,6 +1196,8 @@ module OpenAI
|
|
|
1103
1196
|
GPT_IMAGE_2_5_SUNBURST_2026_09_08 = :"gpt-image-2.5-sunburst-2026-09-08"
|
|
1104
1197
|
GPT_IMAGE_2_5_FLARE = :"gpt-image-2.5-flare"
|
|
1105
1198
|
GPT_IMAGE_2_5_FLARE_2026_09_08 = :"gpt-image-2.5-flare-2026-09-08"
|
|
1199
|
+
GPT_IMAGE_2_6_SUNBURST = :"gpt-image-2.6-sunburst"
|
|
1200
|
+
GPT_IMAGE_2_6_FLARE = :"gpt-image-2.6-flare"
|
|
1106
1201
|
GPT_IMAGE_1_5 = :"gpt-image-1.5"
|
|
1107
1202
|
CHATGPT_IMAGE_LATEST = :"chatgpt-image-latest"
|
|
1108
1203
|
|
|
@@ -1122,8 +1217,12 @@ module OpenAI
|
|
|
1122
1217
|
# @return [Array<Symbol>]
|
|
1123
1218
|
end
|
|
1124
1219
|
|
|
1125
|
-
# The output format of the generated image. One of `png`, `webp`,
|
|
1126
|
-
# Default: `png`.
|
|
1220
|
+
# The output format of the generated image. One of `png`, `webp`, `jpeg`, `gif`,
|
|
1221
|
+
# or `svg`. Default: `png`. GIF and SVG output require a model that supports the
|
|
1222
|
+
# selected format. GIF output does not support partial image streaming
|
|
1223
|
+
# (`partial_images` greater than `0`), `input_image_mask`, or custom
|
|
1224
|
+
# `output_compression`. Responses lifecycle events can still be streamed for GIF
|
|
1225
|
+
# output.
|
|
1127
1226
|
#
|
|
1128
1227
|
# @see OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration#output_format
|
|
1129
1228
|
module OutputFormat
|
|
@@ -1132,6 +1231,8 @@ module OpenAI
|
|
|
1132
1231
|
PNG = :png
|
|
1133
1232
|
WEBP = :webp
|
|
1134
1233
|
JPEG = :jpeg
|
|
1234
|
+
GIF = :gif
|
|
1235
|
+
SVG = :svg
|
|
1135
1236
|
|
|
1136
1237
|
# @!method self.values
|
|
1137
1238
|
# @return [Array<Symbol>]
|
|
@@ -1219,6 +1320,78 @@ module OpenAI
|
|
|
1219
1320
|
|
|
1220
1321
|
# @!endgroup
|
|
1221
1322
|
end
|
|
1323
|
+
|
|
1324
|
+
# @see OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration#svg
|
|
1325
|
+
class Svg < OpenAI::Internal::Type::BaseModel
|
|
1326
|
+
# @!attribute model
|
|
1327
|
+
#
|
|
1328
|
+
# @return [String, nil]
|
|
1329
|
+
optional :model, String
|
|
1330
|
+
|
|
1331
|
+
# @!attribute reasoning
|
|
1332
|
+
# Reasoning effort for SVG authoring. When omitted, uses the author model's
|
|
1333
|
+
# default in both Images and Responses.
|
|
1334
|
+
#
|
|
1335
|
+
# @return [OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Svg::Reasoning, nil]
|
|
1336
|
+
optional(
|
|
1337
|
+
:reasoning,
|
|
1338
|
+
-> {
|
|
1339
|
+
OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Svg::Reasoning
|
|
1340
|
+
},
|
|
1341
|
+
nil?: true
|
|
1342
|
+
)
|
|
1343
|
+
|
|
1344
|
+
# @!method initialize(model: nil, reasoning: nil)
|
|
1345
|
+
# SVG author model settings. Requires `output_format` to be `svg`. When SVG model
|
|
1346
|
+
# selection is enabled, omitting this object uses the outer response model.
|
|
1347
|
+
# Otherwise, the default SVG author is used and explicit model overrides are
|
|
1348
|
+
# unavailable.
|
|
1349
|
+
#
|
|
1350
|
+
# @param model [String]
|
|
1351
|
+
#
|
|
1352
|
+
# @param reasoning [OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Svg::Reasoning, nil]
|
|
1353
|
+
# Reasoning effort for SVG authoring. When omitted, uses the author model's
|
|
1354
|
+
# default in both Images and Responses.
|
|
1355
|
+
|
|
1356
|
+
# @see OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Svg#reasoning
|
|
1357
|
+
class Reasoning < OpenAI::Internal::Type::BaseModel
|
|
1358
|
+
# @!attribute effort
|
|
1359
|
+
# Controls how much effort the model should spend on reasoning for this request.
|
|
1360
|
+
#
|
|
1361
|
+
# @return [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Svg::Reasoning::Effort, nil]
|
|
1362
|
+
optional(
|
|
1363
|
+
:effort,
|
|
1364
|
+
enum: -> {
|
|
1365
|
+
OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Svg::Reasoning::Effort
|
|
1366
|
+
}
|
|
1367
|
+
)
|
|
1368
|
+
|
|
1369
|
+
# @!method initialize(effort: nil)
|
|
1370
|
+
# Reasoning effort for SVG authoring. When omitted, uses the author model's
|
|
1371
|
+
# default in both Images and Responses.
|
|
1372
|
+
#
|
|
1373
|
+
# @param effort [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Svg::Reasoning::Effort]
|
|
1374
|
+
# Controls how much effort the model should spend on reasoning for this request.
|
|
1375
|
+
|
|
1376
|
+
# Controls how much effort the model should spend on reasoning for this request.
|
|
1377
|
+
#
|
|
1378
|
+
# @see OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Svg::Reasoning#effort
|
|
1379
|
+
module Effort
|
|
1380
|
+
extend OpenAI::Internal::Type::Enum
|
|
1381
|
+
|
|
1382
|
+
NONE = :none
|
|
1383
|
+
MINIMAL = :minimal
|
|
1384
|
+
LOW = :low
|
|
1385
|
+
MEDIUM = :medium
|
|
1386
|
+
HIGH = :high
|
|
1387
|
+
XHIGH = :xhigh
|
|
1388
|
+
MAX = :max
|
|
1389
|
+
|
|
1390
|
+
# @!method self.values
|
|
1391
|
+
# @return [Array<Symbol>]
|
|
1392
|
+
end
|
|
1393
|
+
end
|
|
1394
|
+
end
|
|
1222
1395
|
end
|
|
1223
1396
|
|
|
1224
1397
|
class LocalShell < OpenAI::Internal::Type::BaseModel
|
|
@@ -68,7 +68,15 @@ module OpenAI
|
|
|
68
68
|
# @return [Integer]
|
|
69
69
|
required :cached_tokens, Integer
|
|
70
70
|
|
|
71
|
-
# @!
|
|
71
|
+
# @!attribute cache_write_tokens_details
|
|
72
|
+
#
|
|
73
|
+
# @return [OpenAI::Models::Responses::ResponseUsage::InputTokensDetails::CacheWriteTokensDetails, nil]
|
|
74
|
+
optional(
|
|
75
|
+
:cache_write_tokens_details,
|
|
76
|
+
-> { OpenAI::Responses::ResponseUsage::InputTokensDetails::CacheWriteTokensDetails }
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
# @!method initialize(cache_write_tokens:, cached_tokens:, cache_write_tokens_details: nil)
|
|
72
80
|
# A detailed breakdown of the input tokens.
|
|
73
81
|
#
|
|
74
82
|
# @param cache_write_tokens [Integer]
|
|
@@ -77,6 +85,30 @@ module OpenAI
|
|
|
77
85
|
# @param cached_tokens [Integer]
|
|
78
86
|
# The number of tokens that were retrieved from the cache.
|
|
79
87
|
# [More on prompt caching](https://developers.openai.com/api/docs/guides/prompt-caching).
|
|
88
|
+
#
|
|
89
|
+
# @param cache_write_tokens_details [OpenAI::Models::Responses::ResponseUsage::InputTokensDetails::CacheWriteTokensDetails]
|
|
90
|
+
|
|
91
|
+
# @see OpenAI::Models::Responses::ResponseUsage::InputTokensDetails#cache_write_tokens_details
|
|
92
|
+
class CacheWriteTokensDetails < OpenAI::Internal::Type::BaseModel
|
|
93
|
+
# @!attribute ttl_12h_tokens
|
|
94
|
+
# The number of input tokens written with 12-hour retention.
|
|
95
|
+
#
|
|
96
|
+
# @return [Integer]
|
|
97
|
+
required :ttl_12h_tokens, Integer
|
|
98
|
+
|
|
99
|
+
# @!attribute ttl_30m_tokens
|
|
100
|
+
# The number of input tokens written with 30-minute retention.
|
|
101
|
+
#
|
|
102
|
+
# @return [Integer]
|
|
103
|
+
required :ttl_30m_tokens, Integer
|
|
104
|
+
|
|
105
|
+
# @!method initialize(ttl_12h_tokens:, ttl_30m_tokens:)
|
|
106
|
+
# @param ttl_12h_tokens [Integer]
|
|
107
|
+
# The number of input tokens written with 12-hour retention.
|
|
108
|
+
#
|
|
109
|
+
# @param ttl_30m_tokens [Integer]
|
|
110
|
+
# The number of input tokens written with 30-minute retention.
|
|
111
|
+
end
|
|
80
112
|
end
|
|
81
113
|
|
|
82
114
|
# @see OpenAI::Models::Responses::ResponseUsage#output_tokens_details
|
|
@@ -104,6 +104,12 @@ module OpenAI
|
|
|
104
104
|
# @return [Boolean, nil]
|
|
105
105
|
optional :generate, OpenAI::Internal::Type::Boolean
|
|
106
106
|
|
|
107
|
+
# @!attribute image
|
|
108
|
+
# Request level image options.
|
|
109
|
+
#
|
|
110
|
+
# @return [OpenAI::Models::Responses::ResponsesClientEvent::ResponseCreate::Image, nil]
|
|
111
|
+
optional :image, -> { OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Image }
|
|
112
|
+
|
|
107
113
|
# @!attribute include
|
|
108
114
|
# Specify additional output data to include in the model response. Currently
|
|
109
115
|
# supported values are:
|
|
@@ -240,7 +246,7 @@ module OpenAI
|
|
|
240
246
|
# request can write up to four breakpoints. For cache matching, OpenAI considers
|
|
241
247
|
# up to the latest 80 breakpoints in the conversation, without a content-block
|
|
242
248
|
# lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
|
|
243
|
-
# `ttl` defaults to `30m
|
|
249
|
+
# `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
|
|
244
250
|
# [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
|
|
245
251
|
# for current details.
|
|
246
252
|
#
|
|
@@ -471,7 +477,7 @@ module OpenAI
|
|
|
471
477
|
# @return [String, nil]
|
|
472
478
|
optional :user, String
|
|
473
479
|
|
|
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")
|
|
480
|
+
# @!method initialize(access_programs: nil, background: nil, context_management: nil, conversation: nil, generate: nil, image: 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")
|
|
475
481
|
# Client event for creating a response over a persistent WebSocket connection.
|
|
476
482
|
# This payload uses the same top-level fields as `POST /v1/responses`, plus
|
|
477
483
|
# WebSocket-only envelope metadata.
|
|
@@ -503,6 +509,9 @@ module OpenAI
|
|
|
503
509
|
# to false to prepare request state without model output; the response ID can be
|
|
504
510
|
# used as previous_response_id on a later turn.
|
|
505
511
|
#
|
|
512
|
+
# @param image [OpenAI::Models::Responses::ResponsesClientEvent::ResponseCreate::Image]
|
|
513
|
+
# Request level image options.
|
|
514
|
+
#
|
|
506
515
|
# @param include [Array<Symbol, OpenAI::Models::Responses::ResponseIncludable>, nil]
|
|
507
516
|
# Specify additional output data to include in the model response. Currently
|
|
508
517
|
# supported values are:
|
|
@@ -595,7 +604,7 @@ module OpenAI
|
|
|
595
604
|
# request can write up to four breakpoints. For cache matching, OpenAI considers
|
|
596
605
|
# up to the latest 80 breakpoints in the conversation, without a content-block
|
|
597
606
|
# lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
|
|
598
|
-
# `ttl` defaults to `30m
|
|
607
|
+
# `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
|
|
599
608
|
# [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
|
|
600
609
|
# for current details.
|
|
601
610
|
#
|
|
@@ -852,6 +861,44 @@ module OpenAI
|
|
|
852
861
|
# @return [Array(String, OpenAI::Models::Responses::ResponseConversationParam)]
|
|
853
862
|
end
|
|
854
863
|
|
|
864
|
+
# @see OpenAI::Models::Responses::ResponsesClientEvent::ResponseCreate#image
|
|
865
|
+
class Image < OpenAI::Internal::Type::BaseModel
|
|
866
|
+
# @!attribute context_compression
|
|
867
|
+
# Controls image context optimization. Defaults to `auto`, which uses the model,
|
|
868
|
+
# transport, and input to select a policy. Use `enabled` to require compression
|
|
869
|
+
# support or `disabled` to turn it off.
|
|
870
|
+
#
|
|
871
|
+
# @return [Symbol, OpenAI::Models::Responses::ResponsesClientEvent::ResponseCreate::Image::ContextCompression, nil]
|
|
872
|
+
optional(
|
|
873
|
+
:context_compression,
|
|
874
|
+
enum: -> { OpenAI::Responses::ResponsesClientEvent::ResponseCreate::Image::ContextCompression }
|
|
875
|
+
)
|
|
876
|
+
|
|
877
|
+
# @!method initialize(context_compression: nil)
|
|
878
|
+
# Request level image options.
|
|
879
|
+
#
|
|
880
|
+
# @param context_compression [Symbol, OpenAI::Models::Responses::ResponsesClientEvent::ResponseCreate::Image::ContextCompression]
|
|
881
|
+
# Controls image context optimization. Defaults to `auto`, which uses the model,
|
|
882
|
+
# transport, and input to select a policy. Use `enabled` to require compression
|
|
883
|
+
# support or `disabled` to turn it off.
|
|
884
|
+
|
|
885
|
+
# Controls image context optimization. Defaults to `auto`, which uses the model,
|
|
886
|
+
# transport, and input to select a policy. Use `enabled` to require compression
|
|
887
|
+
# support or `disabled` to turn it off.
|
|
888
|
+
#
|
|
889
|
+
# @see OpenAI::Models::Responses::ResponsesClientEvent::ResponseCreate::Image#context_compression
|
|
890
|
+
module ContextCompression
|
|
891
|
+
extend OpenAI::Internal::Type::Enum
|
|
892
|
+
|
|
893
|
+
AUTO = :auto
|
|
894
|
+
ENABLED = :enabled
|
|
895
|
+
DISABLED = :disabled
|
|
896
|
+
|
|
897
|
+
# @!method self.values
|
|
898
|
+
# @return [Array<Symbol>]
|
|
899
|
+
end
|
|
900
|
+
end
|
|
901
|
+
|
|
855
902
|
# Text, image, or file inputs to the model, used to generate a response.
|
|
856
903
|
#
|
|
857
904
|
# Learn more:
|
|
@@ -1032,8 +1079,8 @@ module OpenAI
|
|
|
1032
1079
|
|
|
1033
1080
|
# @!attribute ttl
|
|
1034
1081
|
# The minimum lifetime applied to every implicit and explicit cache breakpoint
|
|
1035
|
-
# written by the request.
|
|
1036
|
-
#
|
|
1082
|
+
# written by the request. Supported values are `30m` (the default) and `12h`. The
|
|
1083
|
+
# backend may retain cache entries for longer.
|
|
1037
1084
|
#
|
|
1038
1085
|
# @return [Symbol, OpenAI::Models::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions::Ttl, nil]
|
|
1039
1086
|
optional(
|
|
@@ -1048,7 +1095,7 @@ module OpenAI
|
|
|
1048
1095
|
# request can write up to four breakpoints. For cache matching, OpenAI considers
|
|
1049
1096
|
# up to the latest 80 breakpoints in the conversation, without a content-block
|
|
1050
1097
|
# lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
|
|
1051
|
-
# `ttl` defaults to `30m
|
|
1098
|
+
# `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
|
|
1052
1099
|
# [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
|
|
1053
1100
|
# for current details.
|
|
1054
1101
|
#
|
|
@@ -1070,8 +1117,8 @@ module OpenAI
|
|
|
1070
1117
|
#
|
|
1071
1118
|
# @param ttl [Symbol, OpenAI::Models::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions::Ttl]
|
|
1072
1119
|
# The minimum lifetime applied to every implicit and explicit cache breakpoint
|
|
1073
|
-
# written by the request.
|
|
1074
|
-
#
|
|
1120
|
+
# written by the request. Supported values are `30m` (the default) and `12h`. The
|
|
1121
|
+
# backend may retain cache entries for longer.
|
|
1075
1122
|
|
|
1076
1123
|
# Controls whether OpenAI automatically creates an implicit cache breakpoint.
|
|
1077
1124
|
# Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint
|
|
@@ -1092,14 +1139,15 @@ module OpenAI
|
|
|
1092
1139
|
end
|
|
1093
1140
|
|
|
1094
1141
|
# The minimum lifetime applied to every implicit and explicit cache breakpoint
|
|
1095
|
-
# written by the request.
|
|
1096
|
-
#
|
|
1142
|
+
# written by the request. Supported values are `30m` (the default) and `12h`. The
|
|
1143
|
+
# backend may retain cache entries for longer.
|
|
1097
1144
|
#
|
|
1098
1145
|
# @see OpenAI::Models::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions#ttl
|
|
1099
1146
|
module Ttl
|
|
1100
1147
|
extend OpenAI::Internal::Type::Enum
|
|
1101
1148
|
|
|
1102
1149
|
TTL_30M = :"30m"
|
|
1150
|
+
TTL_12H = :"12h"
|
|
1103
1151
|
|
|
1104
1152
|
# @!method self.values
|
|
1105
1153
|
# @return [Array<Symbol>]
|