Class: OpenAI::Models::Responses::Tool::ImageGeneration
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- OpenAI::Models::Responses::Tool::ImageGeneration
- Defined in:
- lib/openai/models/responses/tool.rb,
sig/openai/models/responses/tool.rbs
Defined Under Namespace
Modules: Action, Background, InputFidelity, Model, Moderation, OutputFormat, Quality, Size Classes: InputImageMask
Instance Attribute Summary collapse
-
#action ⇒ Symbol, ...
Whether to generate a new image or edit an existing image.
-
#background ⇒ Symbol, ...
Allows to set transparency for the background of the generated image(s).
-
#input_fidelity ⇒ Symbol, ...
Control how much effort the model will exert to match the style and features, especially facial features, of input images.
-
#input_image_mask ⇒ OpenAI::Models::Responses::Tool::ImageGeneration::InputImageMask?
Optional mask for inpainting.
-
#model ⇒ String, ...
The image generation model to use.
-
#moderation ⇒ Symbol, ...
Moderation level for the generated image.
-
#output_compression ⇒ Integer?
Compression level for the output image.
-
#output_format ⇒ Symbol, ...
The output format of the generated image.
-
#partial_images ⇒ Integer?
Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
#quality ⇒ Symbol, ...
The quality of the generated image.
-
#size ⇒ String, ...
The size of the generated images.
-
#type ⇒ Symbol, :image_generation
The type of the image generation tool.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(file_id: nil, image_url: nil) ⇒ Object
constructor
Some parameter documentations has been truncated, see InputImageMask for more details.
- #to_hash ⇒ {
Methods inherited from Internal::Type::BaseModel
==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml
Methods included from Internal::Type::Converter
#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info
Methods included from Internal::Util::SorbetRuntimeSupport
#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type
Constructor Details
#initialize(file_id: nil, image_url: nil) ⇒ Object
Some parameter documentations has been truncated, see InputImageMask for more details.
Optional mask for inpainting. Contains image_url (string, optional) and
file_id (string, optional).
|
|
# File 'lib/openai/models/responses/tool.rb', line 653
|
Instance Attribute Details
#action ⇒ Symbol, ...
Whether to generate a new image or edit an existing image. Default: auto.
559 |
# File 'lib/openai/models/responses/tool.rb', line 559 optional :action, enum: -> { OpenAI::Responses::Tool::ImageGeneration::Action } |
#background ⇒ Symbol, ...
Allows to set transparency for the background of the generated image(s). This
parameter is only supported for GPT image models that support transparent
backgrounds. Must be one of transparent, opaque, or auto (default value).
When auto is used, the model will automatically determine the best background
for the image.
gpt-image-2 and gpt-image-2-2026-04-21 do not support transparent
backgrounds. Requests with background set to transparent will return an
error for these models; use opaque or auto instead.
If transparent, the output format needs to support transparency, so it should
be set to either png (default value) or webp.
576 |
# File 'lib/openai/models/responses/tool.rb', line 576 optional :background, enum: -> { OpenAI::Responses::Tool::ImageGeneration::Background } |
#input_fidelity ⇒ Symbol, ...
Control how much effort the model will exert to match the style and features,
especially facial features, of input images. This parameter is only supported
for gpt-image-1 and gpt-image-1.5 and later models, unsupported for
gpt-image-1-mini. Supports high and low. Defaults to low.
585 586 587 588 589 |
# File 'lib/openai/models/responses/tool.rb', line 585 optional :input_fidelity, enum: -> { OpenAI::Responses::Tool::ImageGeneration::InputFidelity }, nil?: true |
#input_image_mask ⇒ OpenAI::Models::Responses::Tool::ImageGeneration::InputImageMask?
Optional mask for inpainting. Contains image_url (string, optional) and
file_id (string, optional).
596 |
# File 'lib/openai/models/responses/tool.rb', line 596 optional :input_image_mask, -> { OpenAI::Responses::Tool::ImageGeneration::InputImageMask } |
#model ⇒ String, ...
The image generation model to use. Default: gpt-image-1.
602 |
# File 'lib/openai/models/responses/tool.rb', line 602 optional :model, union: -> { OpenAI::Responses::Tool::ImageGeneration::Model } |
#moderation ⇒ Symbol, ...
Moderation level for the generated image. Default: auto.
608 |
# File 'lib/openai/models/responses/tool.rb', line 608 optional :moderation, enum: -> { OpenAI::Responses::Tool::ImageGeneration::Moderation } |
#output_compression ⇒ Integer?
Compression level for the output image. Default: 100.
614 |
# File 'lib/openai/models/responses/tool.rb', line 614 optional :output_compression, Integer |
#output_format ⇒ Symbol, ...
The output format of the generated image. One of png, webp, or jpeg.
Default: png.
621 |
# File 'lib/openai/models/responses/tool.rb', line 621 optional :output_format, enum: -> { OpenAI::Responses::Tool::ImageGeneration::OutputFormat } |
#partial_images ⇒ Integer?
Number of partial images to generate in streaming mode, from 0 (default value) to 3.
628 |
# File 'lib/openai/models/responses/tool.rb', line 628 optional :partial_images, Integer |
#quality ⇒ Symbol, ...
The quality of the generated image. One of low, medium, high, or auto.
Default: auto.
635 |
# File 'lib/openai/models/responses/tool.rb', line 635 optional :quality, enum: -> { OpenAI::Responses::Tool::ImageGeneration::Quality } |
#size ⇒ String, ...
The size of the generated images. For gpt-image-2 and
gpt-image-2-2026-04-21, arbitrary resolutions are supported as WIDTHxHEIGHT
strings, for example 1536x864. Width and height must both be divisible by 16
and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above
2560x1440 are experimental, and the maximum supported resolution is
3840x2160. The requested size must also satisfy the model's current pixel and
edge limits. The standard sizes 1024x1024, 1536x1024, and 1024x1536 are
supported by the GPT image models; auto is supported for models that allow
automatic sizing. For dall-e-2, use one of 256x256, 512x512, or
1024x1024. For dall-e-3, use one of 1024x1024, 1792x1024, or
1024x1792.
651 |
# File 'lib/openai/models/responses/tool.rb', line 651 optional :size, union: -> { OpenAI::Responses::Tool::ImageGeneration::Size } |
#type ⇒ Symbol, :image_generation
The type of the image generation tool. Always image_generation.
553 |
# File 'lib/openai/models/responses/tool.rb', line 553 required :type, const: :image_generation |
Class Method Details
.values ⇒ Array<Symbol>
|
|
# File 'lib/openai/models/responses/tool.rb', line 693
|
Instance Method Details
#to_hash ⇒ {
479 |
# File 'sig/openai/models/responses/tool.rbs', line 479
def to_hash: -> {
|