Class Tool.ImageGeneration
-
- All Implemented Interfaces:
public final class Tool.ImageGeneration
A tool that generates images using a model like
gpt-image-1
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
Tool.ImageGeneration.Builder
A builder for ImageGeneration.
public final class
Tool.ImageGeneration.Background
Background type for the generated image. One of
transparent
,opaque
, orauto
. Default:auto
.public final class
Tool.ImageGeneration.InputFidelity
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
. Supportshigh
andlow
. Defaults tolow
.public final class
Tool.ImageGeneration.InputImageMask
Optional mask for inpainting. Contains
image_url
(string, optional) andfile_id
(string, optional).public final class
Tool.ImageGeneration.Model
The image generation model to use. Default:
gpt-image-1
.public final class
Tool.ImageGeneration.Moderation
Moderation level for the generated image. Default:
auto
.public final class
Tool.ImageGeneration.OutputFormat
The output format of the generated image. One of
png
,webp
, orjpeg
. Default:png
.public final class
Tool.ImageGeneration.Quality
The quality of the generated image. One of
low
,medium
,high
, orauto
. Default:auto
.public final class
Tool.ImageGeneration.Size
The size of the generated image. One of
1024x1024
,1024x1536
,1536x1024
, orauto
. Default:auto
.
-
Method Summary
Modifier and Type Method Description final JsonValue
_type()
The type of the image generation tool. final Optional<Tool.ImageGeneration.Background>
background()
Background type for the generated image. final Optional<Tool.ImageGeneration.InputFidelity>
inputFidelity()
Control how much effort the model will exert to match the style and features, especially facial features, of input images. final Optional<Tool.ImageGeneration.InputImageMask>
inputImageMask()
Optional mask for inpainting. final Optional<Tool.ImageGeneration.Model>
model()
The image generation model to use. final Optional<Tool.ImageGeneration.Moderation>
moderation()
Moderation level for the generated image. final Optional<Long>
outputCompression()
Compression level for the output image. final Optional<Tool.ImageGeneration.OutputFormat>
outputFormat()
The output format of the generated image. final Optional<Long>
partialImages()
Number of partial images to generate in streaming mode, from 0 (default value) to 3. final Optional<Tool.ImageGeneration.Quality>
quality()
The quality of the generated image. final Optional<Tool.ImageGeneration.Size>
size()
The size of the generated image. final JsonField<Tool.ImageGeneration.Background>
_background()
Returns the raw JSON value of background. final JsonField<Tool.ImageGeneration.InputFidelity>
_inputFidelity()
Returns the raw JSON value of inputFidelity. final JsonField<Tool.ImageGeneration.InputImageMask>
_inputImageMask()
Returns the raw JSON value of inputImageMask. final JsonField<Tool.ImageGeneration.Model>
_model()
Returns the raw JSON value of model. final JsonField<Tool.ImageGeneration.Moderation>
_moderation()
Returns the raw JSON value of moderation. final JsonField<Long>
_outputCompression()
Returns the raw JSON value of outputCompression. final JsonField<Tool.ImageGeneration.OutputFormat>
_outputFormat()
Returns the raw JSON value of outputFormat. final JsonField<Long>
_partialImages()
Returns the raw JSON value of partialImages. final JsonField<Tool.ImageGeneration.Quality>
_quality()
Returns the raw JSON value of quality. final JsonField<Tool.ImageGeneration.Size>
_size()
Returns the raw JSON value of size. final Map<String, JsonValue>
_additionalProperties()
final Tool.ImageGeneration.Builder
toBuilder()
final Tool.ImageGeneration
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static Tool.ImageGeneration.Builder
builder()
Returns a mutable builder for constructing an instance of ImageGeneration. -
-
Method Detail
-
_type
final JsonValue _type()
The type of the image generation tool. Always
image_generation
.Expected to always return the following:
JsonValue.from("image_generation")
However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
background
final Optional<Tool.ImageGeneration.Background> background()
Background type for the generated image. One of
transparent
,opaque
, orauto
. Default:auto
.
-
inputFidelity
final Optional<Tool.ImageGeneration.InputFidelity> inputFidelity()
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
. Supportshigh
andlow
. Defaults tolow
.
-
inputImageMask
final Optional<Tool.ImageGeneration.InputImageMask> inputImageMask()
Optional mask for inpainting. Contains
image_url
(string, optional) andfile_id
(string, optional).
-
model
final Optional<Tool.ImageGeneration.Model> model()
The image generation model to use. Default:
gpt-image-1
.
-
moderation
final Optional<Tool.ImageGeneration.Moderation> moderation()
Moderation level for the generated image. Default:
auto
.
-
outputCompression
final Optional<Long> outputCompression()
Compression level for the output image. Default: 100.
-
outputFormat
final Optional<Tool.ImageGeneration.OutputFormat> outputFormat()
The output format of the generated image. One of
png
,webp
, orjpeg
. Default:png
.
-
partialImages
final Optional<Long> partialImages()
Number of partial images to generate in streaming mode, from 0 (default value) to 3.
-
quality
final Optional<Tool.ImageGeneration.Quality> quality()
The quality of the generated image. One of
low
,medium
,high
, orauto
. Default:auto
.
-
size
final Optional<Tool.ImageGeneration.Size> size()
The size of the generated image. One of
1024x1024
,1024x1536
,1536x1024
, orauto
. Default:auto
.
-
_background
final JsonField<Tool.ImageGeneration.Background> _background()
Returns the raw JSON value of background.
Unlike background, this method doesn't throw if the JSON field has an unexpected type.
-
_inputFidelity
final JsonField<Tool.ImageGeneration.InputFidelity> _inputFidelity()
Returns the raw JSON value of inputFidelity.
Unlike inputFidelity, this method doesn't throw if the JSON field has an unexpected type.
-
_inputImageMask
final JsonField<Tool.ImageGeneration.InputImageMask> _inputImageMask()
Returns the raw JSON value of inputImageMask.
Unlike inputImageMask, this method doesn't throw if the JSON field has an unexpected type.
-
_model
final JsonField<Tool.ImageGeneration.Model> _model()
Returns the raw JSON value of model.
Unlike model, this method doesn't throw if the JSON field has an unexpected type.
-
_moderation
final JsonField<Tool.ImageGeneration.Moderation> _moderation()
Returns the raw JSON value of moderation.
Unlike moderation, this method doesn't throw if the JSON field has an unexpected type.
-
_outputCompression
final JsonField<Long> _outputCompression()
Returns the raw JSON value of outputCompression.
Unlike outputCompression, this method doesn't throw if the JSON field has an unexpected type.
-
_outputFormat
final JsonField<Tool.ImageGeneration.OutputFormat> _outputFormat()
Returns the raw JSON value of outputFormat.
Unlike outputFormat, this method doesn't throw if the JSON field has an unexpected type.
-
_partialImages
final JsonField<Long> _partialImages()
Returns the raw JSON value of partialImages.
Unlike partialImages, this method doesn't throw if the JSON field has an unexpected type.
-
_quality
final JsonField<Tool.ImageGeneration.Quality> _quality()
Returns the raw JSON value of quality.
Unlike quality, this method doesn't throw if the JSON field has an unexpected type.
-
_size
final JsonField<Tool.ImageGeneration.Size> _size()
Returns the raw JSON value of size.
Unlike size, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final Tool.ImageGeneration.Builder toBuilder()
-
validate
final Tool.ImageGeneration validate()
-
builder
final static Tool.ImageGeneration.Builder builder()
Returns a mutable builder for constructing an instance of ImageGeneration.
-
-
-
-