Class Tool.ImageGeneration
- 
                    
                    
- All Implemented Interfaces:
 
public final class Tool.ImageGenerationA tool that generates images using a model like
gpt-image-1. 
- 
                
                    
                    
- 
                                
                            
                                
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classTool.ImageGeneration.BuilderA builder for ImageGeneration.
public final classTool.ImageGeneration.BackgroundBackground type for the generated image. One of
transparent,opaque, orauto. Default:auto.public final classTool.ImageGeneration.InputFidelityControl 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. Unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.public final classTool.ImageGeneration.InputImageMaskOptional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).public final classTool.ImageGeneration.ModelThe image generation model to use. Default:
gpt-image-1.public final classTool.ImageGeneration.ModerationModeration level for the generated image. Default:
auto.public final classTool.ImageGeneration.OutputFormatThe output format of the generated image. One of
png,webp, orjpeg. Default:png.public final classTool.ImageGeneration.QualityThe quality of the generated image. One of
low,medium,high, orauto. Default:auto.public final classTool.ImageGeneration.SizeThe 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.BuildertoBuilder()final Tool.ImageGenerationvalidate()final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static Tool.ImageGeneration.Builderbuilder()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. Unsupported forgpt-image-1-mini. Supportshighandlow. 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.
 
 - 
                                        
 
 - 
                                
                            
                                
 
 - 
                    
                    
                    
 
 -