Class LlmProviderConfig.ProviderBuilder

java.lang.Object
com.agentforge4j.bootstrap.LlmProviderConfig.ProviderBuilder
Enclosing class:
LlmProviderConfig

public static final class LlmProviderConfig.ProviderBuilder extends Object
  • Method Details

    • defaults

      No-op kept purely for call-site readability, e.g. openai().defaults().apiKey(...).build(). The builder's recommended defaults (baseUrl, defaultModel, connectTimeout) are already set by the static factory method that created it (e.g. LlmProviderConfig.openai()); calling this method does not populate, refresh, or otherwise change anything.
      Returns:
      this for chaining, unchanged
    • apiKey

      public LlmProviderConfig.ProviderBuilder apiKey(String apiKey)
      Sets the API key.
      Parameters:
      apiKey - the API key; must not be blank
      Returns:
      this for chaining
    • apiKeyReference

      public LlmProviderConfig.ProviderBuilder apiKeyReference(LlmSecretReference apiKeyReference)
      Sets the credential as a reference (literal or env:/sysprop: indirect).
      Parameters:
      apiKeyReference - the credential reference; must not be null
      Returns:
      this for chaining
    • option

      public LlmProviderConfig.ProviderBuilder option(String key, String value)
      Sets a provider-specific option (canonical dotted key, e.g. request.timeout).
      Parameters:
      key - the option key; must not be blank
      value - the option value; must not be blank
      Returns:
      this for chaining
    • baseUrl

      public LlmProviderConfig.ProviderBuilder baseUrl(String baseUrl)
      Overrides the provider base URL.
      Parameters:
      baseUrl - override the provider base URL; must not be blank
      Returns:
      this for chaining
    • defaultModel

      public LlmProviderConfig.ProviderBuilder defaultModel(String defaultModel)
      Overrides the provider default model.
      Parameters:
      defaultModel - override the provider default model; must not be blank
      Returns:
      this for chaining
    • connectTimeout

      public LlmProviderConfig.ProviderBuilder connectTimeout(Duration connectTimeout)
      Overrides the provider connect timeout.
      Parameters:
      connectTimeout - override the provider connect timeout; must not be null
      Returns:
      this for chaining
    • build

      public LlmProviderConfig build()
      Builds the LlmProviderConfig.
      Returns:
      immutable config; never null