Class AzureOpenAiImageModel.Builder

java.lang.Object
dev.langchain4j.model.azure.AzureOpenAiImageModel.Builder
Enclosing class:
AzureOpenAiImageModel

public static class AzureOpenAiImageModel.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • endpoint

      public AzureOpenAiImageModel.Builder endpoint(String endpoint)
      Sets the Azure OpenAI endpoint. This is a mandatory parameter.
      Parameters:
      endpoint - The Azure OpenAI endpoint in the format: https://{resource}.openai.azure.com/
      Returns:
      builder
    • serviceVersion

      public AzureOpenAiImageModel.Builder serviceVersion(String serviceVersion)
      Sets the Azure OpenAI API service version. This is a mandatory parameter.
      Parameters:
      serviceVersion - The Azure OpenAI API service version in the format: 2023-05-15
      Returns:
      builder
    • apiKey

      public AzureOpenAiImageModel.Builder apiKey(String apiKey)
      Sets the Azure OpenAI API key.
      Parameters:
      apiKey - The Azure OpenAI API key.
      Returns:
      builder
    • nonAzureApiKey

      public AzureOpenAiImageModel.Builder nonAzureApiKey(String nonAzureApiKey)
      Used to authenticate with the OpenAI service, instead of Azure OpenAI. This automatically sets the endpoint to https://api.openai.com/v1.
      Parameters:
      nonAzureApiKey - The non-Azure OpenAI API key
      Returns:
      builder
    • tokenCredential

      public AzureOpenAiImageModel.Builder tokenCredential(com.azure.core.credential.TokenCredential tokenCredential)
      Used to authenticate to Azure OpenAI with Azure Active Directory credentials.
      Parameters:
      tokenCredential - the credentials to authenticate with Azure Active Directory
      Returns:
      builder
    • deploymentName

      public AzureOpenAiImageModel.Builder deploymentName(String deploymentName)
      Sets the deployment name in Azure OpenAI. This is a mandatory parameter.
      Parameters:
      deploymentName - The Deployment name.
      Returns:
      builder
    • quality

      public AzureOpenAiImageModel.Builder quality(String quality)
      Sets the quality of the image. This is an optional parameter.
      Parameters:
      quality - The quality of the image.
      Returns:
      builder
    • quality

      public AzureOpenAiImageModel.Builder quality(com.azure.ai.openai.models.ImageGenerationQuality imageGenerationQuality)
      Sets the quality of the image, using the ImageGenerationQuality enum. This is an optional parameter.
      Parameters:
      imageGenerationQuality - The quality of the image.
      Returns:
      builder
    • size

      Sets the size of the image. This is an optional parameter.
      Parameters:
      size - The size of the image.
      Returns:
      builder
    • size

      public AzureOpenAiImageModel.Builder size(com.azure.ai.openai.models.ImageSize imageSize)
      Sets the size of the image, using the ImageSize enum. This is an optional parameter.
      Parameters:
      imageSize - The size of the image.
      Returns:
      builder
    • user

      Sets the user of the image. This is an optional parameter.
      Parameters:
      user - The user of the image.
      Returns:
      builder
    • style

      public AzureOpenAiImageModel.Builder style(String style)
      Sets the style of the image. This is an optional parameter.
      Parameters:
      style - The style of the image.
      Returns:
      builder
    • style

      public AzureOpenAiImageModel.Builder style(com.azure.ai.openai.models.ImageGenerationStyle imageGenerationStyle)
      Sets the style of the image, using the ImageGenerationStyle enum. This is an optional parameter.
      Parameters:
      imageGenerationStyle - The style of the image.
      Returns:
      builder
    • responseFormat

      public AzureOpenAiImageModel.Builder responseFormat(String responseFormat)
      Sets the response format of the image. This is an optional parameter.
      Parameters:
      responseFormat - The response format of the image.
      Returns:
      builder
    • responseFormat

      public AzureOpenAiImageModel.Builder responseFormat(com.azure.ai.openai.models.ImageGenerationResponseFormat imageGenerationResponseFormat)
      Sets the response format of the image, using the ImageGenerationResponseFormat enum. This is an optional parameter.
      Parameters:
      imageGenerationResponseFormat - The response format of the image.
      Returns:
      builder
    • timeout

      public AzureOpenAiImageModel.Builder timeout(Duration timeout)
    • maxRetries

      public AzureOpenAiImageModel.Builder maxRetries(Integer maxRetries)
    • proxyOptions

      public AzureOpenAiImageModel.Builder proxyOptions(com.azure.core.http.ProxyOptions proxyOptions)
    • logRequestsAndResponses

      public AzureOpenAiImageModel.Builder logRequestsAndResponses(Boolean logRequestsAndResponses)
    • openAIClient

      public AzureOpenAiImageModel.Builder openAIClient(com.azure.ai.openai.OpenAIClient openAIClient)
    • userAgentSuffix

      public AzureOpenAiImageModel.Builder userAgentSuffix(String userAgentSuffix)
    • build

      public AzureOpenAiImageModel build()