- Record Components:
provider- non-blank provider idapiKeyReference- optional credential reference for this layer (never a raw value in atoString)baseUrl- optional base URL; null requires the static factory preset or an explicit caller valuedefaultModel- optional default model; null requires the static factory preset or an explicit caller valueconnectTimeout- optional connect timeout; null requires the static factory preset or an explicit caller valueoptions- provider-specific option key/values; nevernull(empty when none)
AgentForge4jBootstrap.Builder.withLlmProvider(LlmProviderConfig).
Construct via the per-provider static factory methods, supplying the credential and any provider-specific options the provider requires:
LlmProviderConfig config = LlmProviderConfig.openai()
.defaults()
.apiKey("sk-...")
.option("request.timeout", "PT30S")
.build();
All fields except provider are nullable/empty. A null apiKeyReference means
"no credential configured at this layer." A null baseUrl or defaultModel does not fall back
to a default supplied by the provider module itself — the provider client requires a non-blank base URL and default
model at construction time and has no fallback of its own. A null value here means either the per-provider static
factory already populated a recommended preset (see openai(), claude(), etc.) or, for
deployment-specific providers such as azureOpenAi(), openAiCompatible(), and bedrock(),
that the caller must supply one explicitly before LlmProviderConfig.ProviderBuilder.build(). options carries
provider-specific settings (keyed in the canonical dotted form, e.g. request.timeout,
auth.header.name) consumed via LlmProviderOptions.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionLlmProviderConfig(String provider, LlmSecretReference apiKeyReference, String baseUrl, String defaultModel, Duration connectTimeout, Map<String, String> options) Validatesprovideris non-blank and defensively copiesoptions. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theapiKeyReferencerecord component.Returns a builder for Azure OpenAI.baseUrl()Returns the value of thebaseUrlrecord component.bedrock()Returns a builder for AWS Bedrock.claude()Returns a builder pre-populated with Anthropic Claude defaults.Returns the value of theconnectTimeoutrecord component.Returns the value of thedefaultModelrecord component.final booleanIndicates whether some other object is "equal to" this one.gemini()Returns a builder pre-populated with Google Gemini defaults.final inthashCode()Returns a hash code value for this object.mistral()Returns a builder pre-populated with Mistral defaults.ollama()Returns a builder pre-populated with Ollama defaults.openai()Returns a builder pre-populated with OpenAI defaults.Returns a builder for any OpenAI-compatible endpoint.options()Returns the value of theoptionsrecord component.provider()Returns the value of theproviderrecord component.toString()Renders without exposing credentials:apiKeyReferencealready redacts itself, and only option keys are shown because an option value may carry a provider secret.vllm()Returns a builder pre-populated with vLLM defaults.
-
Constructor Details
-
Method Details
-
toString
Renders without exposing credentials:apiKeyReferencealready redacts itself, and only option keys are shown because an option value may carry a provider secret. Replaces the record's generatedtoString, which would print option values verbatim. -
openai
Returns a builder pre-populated with OpenAI defaults.- Returns:
- builder for OpenAI configuration
-
claude
Returns a builder pre-populated with Anthropic Claude defaults.- Returns:
- builder for Claude configuration
-
ollama
Returns a builder pre-populated with Ollama defaults.- Returns:
- builder for Ollama configuration
-
vllm
Returns a builder pre-populated with vLLM defaults.- Returns:
- builder for vLLM configuration
-
gemini
Returns a builder pre-populated with Google Gemini defaults.- Returns:
- builder for Gemini configuration
-
mistral
Returns a builder pre-populated with Mistral defaults.- Returns:
- builder for Mistral configuration
-
azureOpenAi
Returns a builder for Azure OpenAI.baseUrlanddefaultModelarenullby default — both are deployment-specific and must be set by the caller.- Returns:
- builder for Azure OpenAI configuration
-
openAiCompatible
Returns a builder for any OpenAI-compatible endpoint.baseUrlanddefaultModelarenullby default — both are deployment-specific and must be set by the caller.- Returns:
- builder for OpenAI-compatible configuration
-
bedrock
Returns a builder for AWS Bedrock.baseUrlanddefaultModelarenullby default — both are deployment-specific and must be set by the caller.- Returns:
- builder for Bedrock configuration
-
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
provider
Returns the value of theproviderrecord component.- Returns:
- the value of the
providerrecord component
-
apiKeyReference
Returns the value of theapiKeyReferencerecord component.- Returns:
- the value of the
apiKeyReferencerecord component
-
baseUrl
Returns the value of thebaseUrlrecord component.- Returns:
- the value of the
baseUrlrecord component
-
defaultModel
Returns the value of thedefaultModelrecord component.- Returns:
- the value of the
defaultModelrecord component
-
connectTimeout
Returns the value of theconnectTimeoutrecord component.- Returns:
- the value of the
connectTimeoutrecord component
-
options
Returns the value of theoptionsrecord component.- Returns:
- the value of the
optionsrecord component
-