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.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionOpenAiImageModel
(String baseUrl, @NonNull String apiKey, String organizationId, String modelName, String size, String quality, String style, String user, String responseFormat, Duration timeout, Integer maxRetries, Proxy proxy, Boolean logRequests, Boolean logResponses, Boolean withPersisting, Path persistTo) Instantiates OpenAI DALL·E image processing model. -
Method Summary
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
public OpenAiImageModel(String baseUrl, @NonNull @NonNull String apiKey, String organizationId, String modelName, String size, String quality, String style, String user, String responseFormat, Duration timeout, Integer maxRetries, Proxy proxy, Boolean logRequests, Boolean logResponses, Boolean withPersisting, Path persistTo) Instantiates OpenAI DALL·E image processing model. Find the parameters description here.- Parameters:
modelName
- dall-e-3 is default onewithPersisting
- generated response will be persisted underjava.io.tmpdir
. The URL withindev.ai4j.openai4j.image.GenerateImagesResponse
will contain the URL to local images then.persistTo
- specifies the local path where the generated image will be downloaded to (in case provided). The URL withindev.ai4j.openai4j.image.GenerateImagesResponse
will contain the URL to local images then.
-
-
Method Details
-
generate
- Specified by:
generate
in interfaceImageModel
-
generate
- Specified by:
generate
in interfaceImageModel
-
builder
-
withApiKey
-