Package com.azure.ai.openai.models
Class ImageGenerationOptions
java.lang.Object
com.azure.ai.openai.models.ImageGenerationOptions
- All Implemented Interfaces:
com.azure.json.JsonSerializable<ImageGenerationOptions>
public final class ImageGenerationOptions
extends Object
implements com.azure.json.JsonSerializable<ImageGenerationOptions>
Represents the request data used to generate images.
-
Constructor Summary
ConstructorsConstructorDescriptionImageGenerationOptions(String prompt) Creates an instance of ImageGenerationOptions class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ImageGenerationOptionsfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of ImageGenerationOptions from the JsonReader.getModel()Get the model property: The model name or Azure OpenAI model deployment name to use for image generation.getN()Get the n property: The number of images to generate.Get the prompt property: A description of the desired images.Get the quality property: The desired image generation quality level to use.Get the responseFormat property: The format in which image generation response items should be presented.getSize()Get the size property: The desired dimensions for generated images.getStyle()Get the style property: The desired image generation style to use.getUser()Get the user property: A unique identifier representing your end-user, which can help to monitor and detect abuse.Set the model property: The model name or Azure OpenAI model deployment name to use for image generation.Set the n property: The number of images to generate.setQuality(ImageGenerationQuality quality) Set the quality property: The desired image generation quality level to use.setResponseFormat(ImageGenerationResponseFormat responseFormat) Set the responseFormat property: The format in which image generation response items should be presented.Set the size property: The desired dimensions for generated images.setStyle(ImageGenerationStyle style) Set the style property: The desired image generation style to use.Set the user property: A unique identifier representing your end-user, which can help to monitor and detect abuse.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
ImageGenerationOptions
Creates an instance of ImageGenerationOptions class.- Parameters:
prompt- the prompt value to set.
-
-
Method Details
-
getPrompt
Get the prompt property: A description of the desired images.- Returns:
- the prompt value.
-
getN
Get the n property: The number of images to generate. Dall-e-2 models support values between 1 and 10. Dall-e-3 models only support a value of 1.- Returns:
- the n value.
-
setN
Set the n property: The number of images to generate. Dall-e-2 models support values between 1 and 10. Dall-e-3 models only support a value of 1.- Parameters:
n- the n value to set.- Returns:
- the ImageGenerationOptions object itself.
-
getSize
Get the size property: The desired dimensions for generated images. Dall-e-2 models support 256x256, 512x512, or 1024x1024. Dall-e-3 models support 1024x1024, 1792x1024, or 1024x1792.- Returns:
- the size value.
-
setSize
Set the size property: The desired dimensions for generated images. Dall-e-2 models support 256x256, 512x512, or 1024x1024. Dall-e-3 models support 1024x1024, 1792x1024, or 1024x1792.- Parameters:
size- the size value to set.- Returns:
- the ImageGenerationOptions object itself.
-
getUser
Get the user property: A unique identifier representing your end-user, which can help to monitor and detect abuse.- Returns:
- the user value.
-
setUser
Set the user property: A unique identifier representing your end-user, which can help to monitor and detect abuse.- Parameters:
user- the user value to set.- Returns:
- the ImageGenerationOptions object itself.
-
getResponseFormat
Get the responseFormat property: The format in which image generation response items should be presented.- Returns:
- the responseFormat value.
-
setResponseFormat
Set the responseFormat property: The format in which image generation response items should be presented.- Parameters:
responseFormat- the responseFormat value to set.- Returns:
- the ImageGenerationOptions object itself.
-
getModel
Get the model property: The model name or Azure OpenAI model deployment name to use for image generation. If not specified, dall-e-2 will be inferred as a default.- Returns:
- the model value.
-
setModel
Set the model property: The model name or Azure OpenAI model deployment name to use for image generation. If not specified, dall-e-2 will be inferred as a default.- Parameters:
model- the model value to set.- Returns:
- the ImageGenerationOptions object itself.
-
getQuality
Get the quality property: The desired image generation quality level to use. Only configurable with dall-e-3 models.- Returns:
- the quality value.
-
setQuality
Set the quality property: The desired image generation quality level to use. Only configurable with dall-e-3 models.- Parameters:
quality- the quality value to set.- Returns:
- the ImageGenerationOptions object itself.
-
getStyle
Get the style property: The desired image generation style to use. Only configurable with dall-e-3 models.- Returns:
- the style value.
-
setStyle
Set the style property: The desired image generation style to use. Only configurable with dall-e-3 models.- Parameters:
style- the style value to set.- Returns:
- the ImageGenerationOptions object itself.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<ImageGenerationOptions>- Throws:
IOException
-
fromJson
public static ImageGenerationOptions fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of ImageGenerationOptions from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of ImageGenerationOptions if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IllegalStateException- If the deserialized JSON object was missing any required properties.IOException- If an error occurs while reading the ImageGenerationOptions.
-