class

OpenAI::ImageGenTool

Inherits JSON::Serializable < Reference < Object

A tool that generates images using a model like gpt-image-1.

Constructors

new(type_value : ImageGenToolType = ImageGenToolType::ImageGeneration, model : ImageGenToolModel | Nil = nil, quality : ImageGenToolQuality | Nil = nil, size : ImageGenToolSize | Nil = nil, output_format : ImageGenToolOutputFormat | Nil = nil, output_compression : Int64 | Nil = nil, moderation : ImageGenToolModeration | Nil = nil, background : ImageGenToolBackground | Nil = nil, input_fidelity : ImageGenToolInputFidelity | Nil = nil, input_image_mask : ImageGenToolInputImageMask | Nil = nil, partial_images : Int64 | Nil = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

background

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

Source
background=(background : ImageGenToolBackground | Nil)

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

Source
input_fidelity
Source
input_fidelity=(input_fidelity : ImageGenToolInputFidelity | Nil)
Source
input_image_mask

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

Source
input_image_mask=(input_image_mask : ImageGenToolInputImageMask | Nil)

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

Source
model

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

Source
model=(model : ImageGenToolModel | Nil)

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

Source
moderation

Moderation level for the generated image. Default: auto.

Source
moderation=(moderation : ImageGenToolModeration | Nil)

Moderation level for the generated image. Default: auto.

Source
output_compression

Compression level for the output image. Default: 100.

Source
output_compression=(output_compression : Int64 | Nil)

Compression level for the output image. Default: 100.

Source
output_format

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

Source
output_format=(output_format : ImageGenToolOutputFormat | Nil)

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

Source
partial_images

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

Source
partial_images=(partial_images : Int64 | Nil)

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

Source
quality

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

Source
quality=(quality : ImageGenToolQuality | Nil)

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

Source
size

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

Source
size=(size : ImageGenToolSize | Nil)

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

Source
type_value

The type of the image generation tool. Always image_generation.

Source
type_value=(type_value : ImageGenToolType)

The type of the image generation tool. Always image_generation.

Source