Class AbstractOpenAiOptions.AbstractBuilder<O extends AbstractOpenAiOptions,B extends AbstractOpenAiOptions.AbstractBuilder<O,B>>

java.lang.Object
org.springframework.ai.openai.AbstractOpenAiOptions.AbstractBuilder<O,B>
Direct Known Subclasses:
OpenAiAudioSpeechOptions.Builder, OpenAiAudioTranscriptionOptions.Builder, OpenAiEmbeddingOptions.Builder, OpenAiImageOptions.Builder, OpenAiModerationOptions.Builder
Enclosing class:
AbstractOpenAiOptions

protected abstract static class AbstractOpenAiOptions.AbstractBuilder<O extends AbstractOpenAiOptions,B extends AbstractOpenAiOptions.AbstractBuilder<O,B>> extends Object
  • Field Details

    • baseUrl

      protected @Nullable String baseUrl
    • apiKey

      protected @Nullable String apiKey
    • credential

      protected @Nullable com.openai.credential.Credential credential
    • model

      protected @Nullable String model
    • microsoftDeploymentName

      protected @Nullable String microsoftDeploymentName
    • microsoftFoundryServiceVersion

      protected @Nullable com.openai.azure.AzureOpenAIServiceVersion microsoftFoundryServiceVersion
    • organizationId

      protected @Nullable String organizationId
    • isMicrosoftFoundry

      protected @Nullable Boolean isMicrosoftFoundry
    • isGitHubModels

      protected @Nullable Boolean isGitHubModels
    • timeout

      protected @Nullable Duration timeout
    • maxRetries

      protected @Nullable Integer maxRetries
    • proxy

      protected @Nullable Proxy proxy
    • customHeaders

      protected @Nullable Map<String,String> customHeaders
  • Constructor Details

    • AbstractBuilder

      protected AbstractBuilder()
  • Method Details

    • self

      protected B self()
    • baseUrl

      public B baseUrl(@Nullable String baseUrl)
    • apiKey

      public B apiKey(@Nullable String apiKey)
    • apiKey

      public B apiKey(@Nullable ApiKey apiKey)
      Sets the API key using an ApiKey instance. Pass a NoopApiKey to disable authentication (no Authorization header will be sent), which is the same behavior as setting an empty string via apiKey(String).
      Parameters:
      apiKey - the API key instance; if null, the key is cleared
    • credential

      public B credential(@Nullable com.openai.credential.Credential credential)
    • model

      public B model(@Nullable String model)
    • deploymentName

      public B deploymentName(@Nullable String deploymentName)
    • microsoftFoundryServiceVersion

      public B microsoftFoundryServiceVersion(@Nullable com.openai.azure.AzureOpenAIServiceVersion microsoftFoundryServiceVersion)
    • azureOpenAIServiceVersion

      public B azureOpenAIServiceVersion(@Nullable com.openai.azure.AzureOpenAIServiceVersion azureOpenAIServiceVersion)
    • organizationId

      public B organizationId(@Nullable String organizationId)
    • microsoftFoundry

      public B microsoftFoundry(@Nullable Boolean microsoftFoundry)
    • azure

      public B azure(@Nullable Boolean azure)
    • gitHubModels

      public B gitHubModels(@Nullable Boolean gitHubModels)
    • timeout

      public B timeout(@Nullable Duration timeout)
    • maxRetries

      public B maxRetries(@Nullable Integer maxRetries)
    • proxy

      public B proxy(@Nullable Proxy proxy)
    • customHeaders

      public B customHeaders(@Nullable Map<String,String> customHeaders)
    • build

      public abstract O build()