Class ImageEditParams.Body.Builder
-
- All Implemented Interfaces:
public final class ImageEditParams.Body.Builder
A builder for Body.
-
-
Method Summary
Modifier and Type Method Description final ImageEditParams.Body.Builder
image(InputStream image)
The image to edit. final ImageEditParams.Body.Builder
image(MultipartField<InputStream> image)
Sets Builder.image to an arbitrary multipart value. final ImageEditParams.Body.Builder
image(ByteArray image)
The image to edit. final ImageEditParams.Body.Builder
image(Path image)
The image to edit. final ImageEditParams.Body.Builder
prompt(String prompt)
A text description of the desired image(s). final ImageEditParams.Body.Builder
prompt(MultipartField<String> prompt)
Sets Builder.prompt to an arbitrary multipart value. final ImageEditParams.Body.Builder
mask(InputStream mask)
An additional image whose fully transparent areas (e.g. final ImageEditParams.Body.Builder
mask(MultipartField<InputStream> mask)
Sets Builder.mask to an arbitrary multipart value. final ImageEditParams.Body.Builder
mask(ByteArray mask)
An additional image whose fully transparent areas (e.g. final ImageEditParams.Body.Builder
mask(Path mask)
An additional image whose fully transparent areas (e.g. final ImageEditParams.Body.Builder
model(ImageModel model)
The model to use for image generation. final ImageEditParams.Body.Builder
model(Optional<ImageModel> model)
Alias for calling Builder.model with model.orElse(null)
.final ImageEditParams.Body.Builder
model(MultipartField<ImageModel> model)
Sets Builder.model to an arbitrary multipart value. final ImageEditParams.Body.Builder
model(String value)
Sets model to an arbitrary String. final ImageEditParams.Body.Builder
n(Long n)
The number of images to generate. final ImageEditParams.Body.Builder
n(Long n)
Alias for Builder.n. final ImageEditParams.Body.Builder
n(Optional<Long> n)
Alias for calling Builder.n with n.orElse(null)
.final ImageEditParams.Body.Builder
n(MultipartField<Long> n)
Sets Builder.n to an arbitrary multipart value. final ImageEditParams.Body.Builder
responseFormat(ImageEditParams.ResponseFormat responseFormat)
The format in which the generated images are returned. final ImageEditParams.Body.Builder
responseFormat(Optional<ImageEditParams.ResponseFormat> responseFormat)
Alias for calling Builder.responseFormat with responseFormat.orElse(null)
.final ImageEditParams.Body.Builder
responseFormat(MultipartField<ImageEditParams.ResponseFormat> responseFormat)
Sets Builder.responseFormat to an arbitrary multipart value. final ImageEditParams.Body.Builder
size(ImageEditParams.Size size)
The size of the generated images. final ImageEditParams.Body.Builder
size(Optional<ImageEditParams.Size> size)
Alias for calling Builder.size with size.orElse(null)
.final ImageEditParams.Body.Builder
size(MultipartField<ImageEditParams.Size> size)
Sets Builder.size to an arbitrary multipart value. final ImageEditParams.Body.Builder
user(String user)
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. final ImageEditParams.Body.Builder
user(MultipartField<String> user)
Sets Builder.user to an arbitrary multipart value. final ImageEditParams.Body
build()
Returns an immutable instance of Body. -
-
Method Detail
-
image
final ImageEditParams.Body.Builder image(InputStream image)
The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask.
-
image
final ImageEditParams.Body.Builder image(MultipartField<InputStream> image)
Sets Builder.image to an arbitrary multipart value.
You should usually call Builder.image with a well-typed InputStream value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
image
final ImageEditParams.Body.Builder image(ByteArray image)
The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask.
-
image
final ImageEditParams.Body.Builder image(Path image)
The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask.
-
prompt
final ImageEditParams.Body.Builder prompt(String prompt)
A text description of the desired image(s). The maximum length is 1000 characters.
-
prompt
final ImageEditParams.Body.Builder prompt(MultipartField<String> prompt)
Sets Builder.prompt to an arbitrary multipart value.
You should usually call Builder.prompt with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
mask
final ImageEditParams.Body.Builder mask(InputStream mask)
An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where
image
should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions asimage
.
-
mask
final ImageEditParams.Body.Builder mask(MultipartField<InputStream> mask)
Sets Builder.mask to an arbitrary multipart value.
You should usually call Builder.mask with a well-typed InputStream value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
mask
final ImageEditParams.Body.Builder mask(ByteArray mask)
An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where
image
should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions asimage
.
-
mask
final ImageEditParams.Body.Builder mask(Path mask)
An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where
image
should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions asimage
.
-
model
final ImageEditParams.Body.Builder model(ImageModel model)
The model to use for image generation. Only
dall-e-2
is supported at this time.
-
model
final ImageEditParams.Body.Builder model(Optional<ImageModel> model)
Alias for calling Builder.model with
model.orElse(null)
.
-
model
final ImageEditParams.Body.Builder model(MultipartField<ImageModel> model)
Sets Builder.model to an arbitrary multipart value.
You should usually call Builder.model with a well-typed ImageModel value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
model
final ImageEditParams.Body.Builder model(String value)
Sets model to an arbitrary String.
You should usually call model with a well-typed ImageModel constant instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
n
final ImageEditParams.Body.Builder n(Long n)
The number of images to generate. Must be between 1 and 10.
-
n
final ImageEditParams.Body.Builder n(Long n)
Alias for Builder.n.
This unboxed primitive overload exists for backwards compatibility.
-
n
final ImageEditParams.Body.Builder n(Optional<Long> n)
Alias for calling Builder.n with
n.orElse(null)
.
-
n
final ImageEditParams.Body.Builder n(MultipartField<Long> n)
Sets Builder.n to an arbitrary multipart value.
You should usually call Builder.n with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
responseFormat
final ImageEditParams.Body.Builder responseFormat(ImageEditParams.ResponseFormat responseFormat)
The format in which the generated images are returned. Must be one of
url
orb64_json
. URLs are only valid for 60 minutes after the image has been generated.
-
responseFormat
final ImageEditParams.Body.Builder responseFormat(Optional<ImageEditParams.ResponseFormat> responseFormat)
Alias for calling Builder.responseFormat with
responseFormat.orElse(null)
.
-
responseFormat
final ImageEditParams.Body.Builder responseFormat(MultipartField<ImageEditParams.ResponseFormat> responseFormat)
Sets Builder.responseFormat to an arbitrary multipart value.
You should usually call Builder.responseFormat with a well-typed ResponseFormat value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
size
final ImageEditParams.Body.Builder size(ImageEditParams.Size size)
The size of the generated images. Must be one of
256x256
,512x512
, or1024x1024
.
-
size
final ImageEditParams.Body.Builder size(Optional<ImageEditParams.Size> size)
Alias for calling Builder.size with
size.orElse(null)
.
-
size
final ImageEditParams.Body.Builder size(MultipartField<ImageEditParams.Size> size)
Sets Builder.size to an arbitrary multipart value.
You should usually call Builder.size with a well-typed Size value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
user
final ImageEditParams.Body.Builder user(String user)
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.
-
user
final ImageEditParams.Body.Builder user(MultipartField<String> user)
Sets Builder.user to an arbitrary multipart value.
You should usually call Builder.user with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
build
final ImageEditParams.Body build()
Returns an immutable instance of Body.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.image() .prompt()
-
-
-
-