Class OpenAiImageOptions

java.lang.Object
org.springframework.ai.openai.AbstractOpenAiOptions
org.springframework.ai.openai.OpenAiImageOptions
All Implemented Interfaces:
org.springframework.ai.image.ImageOptions, org.springframework.ai.model.ModelOptions

public class OpenAiImageOptions extends AbstractOpenAiOptions implements org.springframework.ai.image.ImageOptions
Configuration information for the Image Model implementation using the OpenAI Java SDK.
Author:
Julien Dubois, Christian Tzolov, Mark Pollack
  • Field Details

    • DEFAULT_IMAGE_MODEL

      public static final String DEFAULT_IMAGE_MODEL
  • Constructor Details

    • OpenAiImageOptions

      protected OpenAiImageOptions(@Nullable String baseUrl, @Nullable String apiKey, @Nullable com.openai.credential.Credential credential, @Nullable String model, @Nullable String microsoftDeploymentName, @Nullable com.openai.azure.AzureOpenAIServiceVersion microsoftFoundryServiceVersion, @Nullable String organizationId, @Nullable Boolean isMicrosoftFoundry, @Nullable Boolean isGitHubModels, @Nullable Duration timeout, @Nullable Integer maxRetries, @Nullable Proxy proxy, @Nullable Map<String,String> customHeaders, @Nullable Integer n, @Nullable Integer width, @Nullable Integer height, @Nullable String quality, @Nullable String responseFormat, @Nullable String size, @Nullable String style, @Nullable String user)
  • Method Details

    • builder

      public static OpenAiImageOptions.Builder builder()
    • getN

      public @Nullable Integer getN()
      Specified by:
      getN in interface org.springframework.ai.image.ImageOptions
    • getWidth

      public @Nullable Integer getWidth()
      Specified by:
      getWidth in interface org.springframework.ai.image.ImageOptions
    • getHeight

      public @Nullable Integer getHeight()
      Specified by:
      getHeight in interface org.springframework.ai.image.ImageOptions
    • getResponseFormat

      public @Nullable String getResponseFormat()
      Specified by:
      getResponseFormat in interface org.springframework.ai.image.ImageOptions
    • getSize

      public @Nullable String getSize()
    • getUser

      public @Nullable String getUser()
    • getQuality

      public @Nullable String getQuality()
    • getStyle

      public @Nullable String getStyle()
      Specified by:
      getStyle in interface org.springframework.ai.image.ImageOptions
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toOpenAiImageGenerateParams

      public com.openai.models.images.ImageGenerateParams toOpenAiImageGenerateParams(org.springframework.ai.image.ImagePrompt imagePrompt)