Class: OpenAI::Models::BetaTool::Beta::BetaTool::ImageGeneration
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- OpenAI::Models::BetaTool::Beta::BetaTool::ImageGeneration
- Defined in:
- sig/openai/models/beta/beta_tool.rbs
Defined Under Namespace
Modules: Action, Background, InputFidelity, Model, Moderation, OutputFormat, Quality, Size Classes: InputImageMask
Instance Attribute Summary collapse
-
#action ⇒ OpenAI::Models::Beta::BetaTool::ImageGeneration::action?
readonly
Whether to generate a new image or edit an existing image.
-
#background ⇒ OpenAI::Models::Beta::BetaTool::ImageGeneration::background?
readonly
Allows to set transparency for the background of the generated image(s).
-
#input_fidelity ⇒ OpenAI::Models::Beta::BetaTool::ImageGeneration::input_fidelity?
Controls fidelity to the original input image(s).
-
#input_image_mask ⇒ OpenAI::Beta::BetaTool::ImageGeneration::InputImageMask?
readonly
Optional mask for inpainting.
-
#model ⇒ OpenAI::Models::Beta::BetaTool::ImageGeneration::model?
readonly
The image generation model to use.
-
#moderation ⇒ OpenAI::Models::Beta::BetaTool::ImageGeneration::moderation?
readonly
Moderation level for the generated image.
-
#output_compression ⇒ Integer?
readonly
Compression level for the output image.
-
#output_format ⇒ OpenAI::Models::Beta::BetaTool::ImageGeneration::output_format?
readonly
The output format of the generated image.
-
#partial_images ⇒ Integer?
readonly
Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
#quality ⇒ OpenAI::Models::Beta::BetaTool::ImageGeneration::quality?
readonly
The quality of the generated image.
-
#size ⇒ OpenAI::Models::Beta::BetaTool::ImageGeneration::size?
readonly
The size of the generated images.
-
#type ⇒ :image_generation
The type of the image generation tool.
Attributes inherited from Internal::Type::BaseModel
Instance Method Summary collapse
-
#action ⇒ Object
readonly
Whether to generate a new image or edit an existing image.
-
#background ⇒ Object
readonly
Allows to set transparency for the background of the generated image(s).
- #initialize ⇒ Object constructor
-
#input_image_mask ⇒ Object
readonly
Optional mask for inpainting.
-
#model ⇒ Object
readonly
The image generation model to use.
-
#moderation ⇒ Object
readonly
Moderation level for the generated image.
-
#output_compression ⇒ Integer
readonly
Compression level for the output image.
-
#output_format ⇒ Object
readonly
The output format of the generated image.
-
#partial_images ⇒ Integer
readonly
Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
#quality ⇒ Object
readonly
The quality of the generated image.
-
#size ⇒ Object
readonly
The size of the generated images.
- #to_hash ⇒ {
Methods inherited from Internal::Type::BaseModel
==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, 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, coerce_with_error, 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 ⇒ Object
808 |
# File 'sig/openai/models/beta/beta_tool.rbs', line 808
def initialize: (
|
Instance Attribute Details
#action ⇒ OpenAI::Models::Beta::BetaTool::ImageGeneration::action? (readonly)
Whether to generate a new image or edit an existing image. Default: auto.
615 616 617 |
# File 'sig/openai/models/beta/beta_tool.rbs', line 615 def action @action end |
#background ⇒ OpenAI::Models::Beta::BetaTool::ImageGeneration::background? (readonly)
Allows to set transparency for the background of the generated image(s). 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.5-sunburst and gpt-image-2.5-flare, including their 2026-09-08
snapshots, support opaque and transparent backgrounds. Transparent
backgrounds are available for supported GPT Image models. For gpt-image-2 and
gpt-image-2-2026-04-21, this support is in preview. When using transparent,
set the output format to png or webp.
631 632 633 |
# File 'sig/openai/models/beta/beta_tool.rbs', line 631 def background @background end |
#input_fidelity ⇒ OpenAI::Models::Beta::BetaTool::ImageGeneration::input_fidelity?
Controls fidelity to the original input image(s). This parameter is supported
for GPT image models that support input fidelity. gpt-image-2 and
gpt-image-2-2026-04-21 ignore this parameter.
649 650 651 |
# File 'sig/openai/models/beta/beta_tool.rbs', line 649 def input_fidelity @input_fidelity end |
#input_image_mask ⇒ OpenAI::Beta::BetaTool::ImageGeneration::InputImageMask? (readonly)
Optional mask for inpainting. Contains image_url (string, optional) and
file_id (string, optional).
653 654 655 |
# File 'sig/openai/models/beta/beta_tool.rbs', line 653 def input_image_mask @input_image_mask end |
#model ⇒ OpenAI::Models::Beta::BetaTool::ImageGeneration::model? (readonly)
The image generation model to use. One of gpt-image-1, gpt-image-1-mini,
gpt-image-1.5, gpt-image-2, gpt-image-2-2026-04-21,
gpt-image-2.5-sunburst, gpt-image-2.5-sunburst-2026-09-08,
gpt-image-2.5-flare, gpt-image-2.5-flare-2026-09-08, or
chatgpt-image-latest. Default: gpt-image-1.
666 667 668 |
# File 'sig/openai/models/beta/beta_tool.rbs', line 666 def model @model end |
#moderation ⇒ OpenAI::Models::Beta::BetaTool::ImageGeneration::moderation? (readonly)
Moderation level for the generated image. Default: auto.
678 679 680 |
# File 'sig/openai/models/beta/beta_tool.rbs', line 678 def moderation @moderation end |
#output_compression ⇒ Integer? (readonly)
Compression level for the output image. Default: 100.
686 687 688 |
# File 'sig/openai/models/beta/beta_tool.rbs', line 686 def output_compression @output_compression end |
#output_format ⇒ OpenAI::Models::Beta::BetaTool::ImageGeneration::output_format? (readonly)
The output format of the generated image. One of png, webp, or jpeg.
Default: png.
693 694 695 |
# File 'sig/openai/models/beta/beta_tool.rbs', line 693 def output_format @output_format end |
#partial_images ⇒ Integer? (readonly)
Number of partial images to generate in streaming mode, from 0 (default value) to 3.
703 704 705 |
# File 'sig/openai/models/beta/beta_tool.rbs', line 703 def partial_images @partial_images end |
#quality ⇒ OpenAI::Models::Beta::BetaTool::ImageGeneration::quality? (readonly)
The quality of the generated image. The GPT image models support low,
medium, and high. gpt-image-2.5-sunburst and gpt-image-2.5-flare,
including their 2026-09-08 snapshots, also support xhigh and max. Default:
auto.
713 714 715 |
# File 'sig/openai/models/beta/beta_tool.rbs', line 713 def quality @quality end |
#size ⇒ OpenAI::Models::Beta::BetaTool::ImageGeneration::size? (readonly)
The size of the generated images. For gpt-image-2, gpt-image-2-2026-04-21,
gpt-image-2.5-sunburst, gpt-image-2.5-sunburst-2026-09-08,
gpt-image-2.5-flare, and gpt-image-2.5-flare-2026-09-08, 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.
735 736 737 |
# File 'sig/openai/models/beta/beta_tool.rbs', line 735 def size @size end |
#type ⇒ :image_generation
The type of the image generation tool. Always image_generation.
612 613 614 |
# File 'sig/openai/models/beta/beta_tool.rbs', line 612 def type @type end |
Instance Method Details
#action= ⇒ Object (readonly)
Whether to generate a new image or edit an existing image. Default: auto.
618 |
# File 'sig/openai/models/beta/beta_tool.rbs', line 618
def action=: (
|
#background= ⇒ Object (readonly)
Allows to set transparency for the background of the generated image(s). 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.5-sunburst and gpt-image-2.5-flare, including their 2026-09-08
snapshots, support opaque and transparent backgrounds. Transparent
backgrounds are available for supported GPT Image models. For gpt-image-2 and
gpt-image-2-2026-04-21, this support is in preview. When using transparent,
set the output format to png or webp.
642 |
# File 'sig/openai/models/beta/beta_tool.rbs', line 642
def background=: (
|
#input_image_mask= ⇒ Object (readonly)
Optional mask for inpainting. Contains image_url (string, optional) and
file_id (string, optional).
657 |
# File 'sig/openai/models/beta/beta_tool.rbs', line 657
def input_image_mask=: (
|
#model= ⇒ Object (readonly)
The image generation model to use. One of gpt-image-1, gpt-image-1-mini,
gpt-image-1.5, gpt-image-2, gpt-image-2-2026-04-21,
gpt-image-2.5-sunburst, gpt-image-2.5-sunburst-2026-09-08,
gpt-image-2.5-flare, gpt-image-2.5-flare-2026-09-08, or
chatgpt-image-latest. Default: gpt-image-1.
673 |
# File 'sig/openai/models/beta/beta_tool.rbs', line 673
def model=: (
|
#moderation= ⇒ Object (readonly)
Moderation level for the generated image. Default: auto.
681 |
# File 'sig/openai/models/beta/beta_tool.rbs', line 681
def moderation=: (
|
#output_compression= ⇒ Integer (readonly)
Compression level for the output image. Default: 100.
689 |
# File 'sig/openai/models/beta/beta_tool.rbs', line 689
def output_compression=: (Integer) -> Integer
|
#output_format= ⇒ Object (readonly)
The output format of the generated image. One of png, webp, or jpeg.
Default: png.
697 |
# File 'sig/openai/models/beta/beta_tool.rbs', line 697
def output_format=: (
|
#partial_images= ⇒ Integer (readonly)
Number of partial images to generate in streaming mode, from 0 (default value) to 3.
707 |
# File 'sig/openai/models/beta/beta_tool.rbs', line 707
def partial_images=: (Integer) -> Integer
|
#quality= ⇒ Object (readonly)
The quality of the generated image. The GPT image models support low,
medium, and high. gpt-image-2.5-sunburst and gpt-image-2.5-flare,
including their 2026-09-08 snapshots, also support xhigh and max. Default:
auto.
719 |
# File 'sig/openai/models/beta/beta_tool.rbs', line 719
def quality=: (
|
#size= ⇒ Object (readonly)
The size of the generated images. For gpt-image-2, gpt-image-2-2026-04-21,
gpt-image-2.5-sunburst, gpt-image-2.5-sunburst-2026-09-08,
gpt-image-2.5-flare, and gpt-image-2.5-flare-2026-09-08, 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.
749 |
# File 'sig/openai/models/beta/beta_tool.rbs', line 749
def size=: (
|
#to_hash ⇒ {
823 |
# File 'sig/openai/models/beta/beta_tool.rbs', line 823
def to_hash: -> {
|