Class: OpenAI::Models::Responses::Tool::ImageGeneration

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/responses/tool.rb

Defined Under Namespace

Modules: Background, Model, Moderation, OutputFormat, Quality, Size Classes: InputImageMask

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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, 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).

Parameters:

  • file_id (String) (defaults to: nil)

    File ID for the mask image.

  • image_url (String) (defaults to: nil)

    Base64-encoded mask image.



# File 'lib/openai/models/responses/tool.rb', line 353

Instance Attribute Details

#backgroundSymbol, ...

Background type for the generated image. One of ‘transparent`, `opaque`, or `auto`. Default: `auto`.



298
# File 'lib/openai/models/responses/tool.rb', line 298

optional :background, enum: -> { OpenAI::Responses::Tool::ImageGeneration::Background }

#input_image_maskOpenAI::Models::Responses::Tool::ImageGeneration::InputImageMask?

Optional mask for inpainting. Contains ‘image_url` (string, optional) and `file_id` (string, optional).



305
# File 'lib/openai/models/responses/tool.rb', line 305

optional :input_image_mask, -> { OpenAI::Responses::Tool::ImageGeneration::InputImageMask }

#modelSymbol, ...

The image generation model to use. Default: ‘gpt-image-1`.



311
# File 'lib/openai/models/responses/tool.rb', line 311

optional :model, enum: -> { OpenAI::Responses::Tool::ImageGeneration::Model }

#moderationSymbol, ...

Moderation level for the generated image. Default: ‘auto`.



317
# File 'lib/openai/models/responses/tool.rb', line 317

optional :moderation, enum: -> { OpenAI::Responses::Tool::ImageGeneration::Moderation }

#output_compressionInteger?

Compression level for the output image. Default: 100.

Returns:

  • (Integer, nil)


323
# File 'lib/openai/models/responses/tool.rb', line 323

optional :output_compression, Integer

#output_formatSymbol, ...

The output format of the generated image. One of ‘png`, `webp`, or `jpeg`. Default: `png`.



330
# File 'lib/openai/models/responses/tool.rb', line 330

optional :output_format, enum: -> { OpenAI::Responses::Tool::ImageGeneration::OutputFormat }

#partial_imagesInteger?

Number of partial images to generate in streaming mode, from 0 (default value) to 3.

Returns:

  • (Integer, nil)


337
# File 'lib/openai/models/responses/tool.rb', line 337

optional :partial_images, Integer

#qualitySymbol, ...

The quality of the generated image. One of ‘low`, `medium`, `high`, or `auto`. Default: `auto`.



344
# File 'lib/openai/models/responses/tool.rb', line 344

optional :quality, enum: -> { OpenAI::Responses::Tool::ImageGeneration::Quality }

#sizeSymbol, ...

The size of the generated image. One of ‘1024x1024`, `1024x1536`, `1536x1024`, or `auto`. Default: `auto`.



351
# File 'lib/openai/models/responses/tool.rb', line 351

optional :size, enum: -> { OpenAI::Responses::Tool::ImageGeneration::Size }

#typeSymbol, :image_generation

The type of the image generation tool. Always ‘image_generation`.

Returns:

  • (Symbol, :image_generation)


291
# File 'lib/openai/models/responses/tool.rb', line 291

required :type, const: :image_generation

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/responses/tool.rb', line 390