Package dev.langchain4j.model.openai
Class OpenAiImageModel
java.lang.Object
dev.langchain4j.model.openai.OpenAiImageModel
- All Implemented Interfaces:
ImageModel
Represents an OpenAI DALLĀ·E models to generate artistic images. Versions 2 and 3 (default) are supported.
Find the parameters description here.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Given a prompt, generate an image.Given a prompt, generate n images.static OpenAiImageModel
withApiKey
(String apiKey) Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.langchain4j.model.image.ImageModel
edit, edit
-
Constructor Details
-
OpenAiImageModel
-
-
Method Details
-
modelName
-
generate
Description copied from interface:ImageModel
Given a prompt, generate an image.- Specified by:
generate
in interfaceImageModel
- Parameters:
prompt
- The prompt to generate an image from.- Returns:
- The generated image Response.
-
generate
Description copied from interface:ImageModel
Given a prompt, generate n images.Not supported by all models; as explicit support is needed to generate different images from the same prompt.
- Specified by:
generate
in interfaceImageModel
- Parameters:
prompt
- The prompt to generate images from.n
- The number of images to generate.- Returns:
- The generated images Response.
-
builder
-
withApiKey
Deprecated, for removal: This API element is subject to removal in a future version.Please usebuilder()
instead, and explicitly set the model name and, if necessary, other parameters. The default value for the model name will be removed in future releases!
-
builder()
instead, and explicitly set the model name and, if necessary, other parameters.