Package com.intellijava.core.controller
Class RemoteImageModel
java.lang.Object
com.intellijava.core.controller.RemoteImageModel
The RemoteImageModel class is used to generate images from text descriptions using an API key.
It currently supports OpenAI only.
The class uses the OpenAIWrapper to generate the images and returns a list of URLs for the generated images.
- Author:
- github.com/Barqawiz
-
Constructor Summary
ConstructorDescriptionRemoteImageModel
(String keyValue, SupportedImageModels keyType) Constructor for creating a new RemoteImageModel object.RemoteImageModel
(String keyValue, String keyTypeString) Constructor for creating a new RemoteImageModel object. -
Method Summary
Modifier and TypeMethodDescriptiongenerateImages
(ImageModelInput imageInput) Generates images from a given text description.Get the supported models names as array of string
-
Constructor Details
-
RemoteImageModel
Constructor for creating a new RemoteImageModel object. Creates an instance of the class and set the API key value and type.- Parameters:
keyValue
- the API key.keyTypeString
- support openai only.- Throws:
IllegalArgumentException
- if the keyType passed is not "openai".
-
RemoteImageModel
Constructor for creating a new RemoteImageModel object. Creates an instance of the class and set the API key value and type.- Parameters:
keyValue
- the API key.keyType
- the model type from SupportedImageModels enum.
-
-
Method Details
-
getSupportedModels
Get the supported models names as array of string- Returns:
- supportedModels
-
generateImages
Generates images from a given text description.- Parameters:
imageInput
- flexible builder for image model parameters.- Returns:
- list of URLs of the generated images.
- Throws:
IOException
- if there is a problem with the API connection.
-