Class RemoteImageModel

java.lang.Object
com.intellijava.core.controller.RemoteImageModel

public class RemoteImageModel extends Object
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 Details

    • RemoteImageModel

      public RemoteImageModel(String keyValue, String keyTypeString)
      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

      public RemoteImageModel(String keyValue, SupportedImageModels keyType)
      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

      public List<String> getSupportedModels()
      Get the supported models names as array of string
      Returns:
      supportedModels
    • generateImages

      public List<String> generateImages(ImageModelInput imageInput) throws IOException
      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.