java.lang.Object
java.lang.Record
com.agentforge4j.llm.StandardNeutralConfiguration
- Record Components:
providerId- the provider id this configuration is for (seegetProviderName()); must not be blankdefaultModel- the default model id, ornullwhen the provider has noneconnectTimeout- the HTTP connect timeout; must not benullbaseUrl- the service base URL, ornullfor providers with no HTTP base URL (for example Bedrock, reached through the AWS SDK rather than a base URL)apiKeyReference- the credential reference, ornullfor providers that need noneoptions- the canonical dotted provider-option map (seeNeutralOptions.toMap()); must not benull(empty when the provider has no extra options)
- All Implemented Interfaces:
LlmClientConfiguration
public record StandardNeutralConfiguration(String providerId, String defaultModel, Duration connectTimeout, String baseUrl, LlmSecretReference apiKeyReference, Map<String,String> options)
extends Record
implements LlmClientConfiguration
Standard
LlmClientConfiguration shape shared by every provider's LlmClientConfigurationAdapter.
Across providers the only variation is which entries land in options (see NeutralOptions) and
whether an API-key reference exists at all — self-hosted / credential-less providers (for example Ollama, vLLM,
Bedrock) pass null. Every other component has the same shape everywhere, so adapters construct this record
instead of each hand-writing its own private LlmClientConfiguration implementation.-
Constructor Summary
ConstructorsConstructorDescriptionStandardNeutralConfiguration(String providerId, String defaultModel, Duration connectTimeout, String baseUrl, LlmSecretReference apiKeyReference, Map<String, String> options) Validates the required components and defensively copiesoptions. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theapiKeyReferencerecord component.baseUrl()Returns the value of thebaseUrlrecord component.Returns the value of theconnectTimeoutrecord component.Returns the value of thedefaultModelrecord component.final booleanIndicates whether some other object is "equal to" this one.The provider credential, carried as a reference so a raw value never travels through the wiring layer.Service base URL for HTTP providers (scheme + host, optional port), without trailing slash.HTTP connect timeout for outbound requests to this provider.Default model when a request does not setLlmExecutionRequest.model().Validated, provider-specific options beyond the common settings above (seeLlmProviderOptions).Provider id for this configuration (must align with the matchingLlmClientFactory).final inthashCode()Returns a hash code value for this object.options()Returns the value of theoptionsrecord component.Returns the value of theproviderIdrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.agentforge4j.llm.LlmClientConfiguration
getRetryPolicy, requireBaseUrl
-
Constructor Details
-
Method Details
-
getProviderName
Description copied from interface:LlmClientConfigurationProvider id for this configuration (must align with the matchingLlmClientFactory).- Specified by:
getProviderNamein interfaceLlmClientConfiguration- Returns:
- non-blank provider id such as
"openai"or"ollama"
-
getDefaultModel
Description copied from interface:LlmClientConfigurationDefault model when a request does not setLlmExecutionRequest.model().- Specified by:
getDefaultModelin interfaceLlmClientConfiguration- Returns:
- non-blank default model id for this provider
-
getConnectTimeout
Description copied from interface:LlmClientConfigurationHTTP connect timeout for outbound requests to this provider.- Specified by:
getConnectTimeoutin interfaceLlmClientConfiguration- Returns:
- connect timeout duration
-
getBaseUrl
Description copied from interface:LlmClientConfigurationService base URL for HTTP providers (scheme + host, optional port), without trailing slash.Returns a nullable
Stringto match the existing provider configurations that already declareString getBaseUrl();nullmeans the provider has a fixed endpoint or none applies.- Specified by:
getBaseUrlin interfaceLlmClientConfiguration- Returns:
- the base URL, or
nullwhen not applicable
-
getApiKeyReference
Description copied from interface:LlmClientConfigurationThe provider credential, carried as a reference so a raw value never travels through the wiring layer. A factory resolves it viaLlmClientFactoryContext.secretResolver().- Specified by:
getApiKeyReferencein interfaceLlmClientConfiguration- Returns:
- the credential reference, or empty for providers that need none
-
getOptions
Description copied from interface:LlmClientConfigurationValidated, provider-specific options beyond the common settings above (seeLlmProviderOptions).- Specified by:
getOptionsin interfaceLlmClientConfiguration- Returns:
- the provider options; never
null(empty when none)
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
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). -
providerId
Returns the value of theproviderIdrecord component.- Returns:
- the value of the
providerIdrecord 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
-
baseUrl
Returns the value of thebaseUrlrecord component.- Returns:
- the value of the
baseUrlrecord component
-
apiKeyReference
Returns the value of theapiKeyReferencerecord component.- Returns:
- the value of the
apiKeyReferencerecord component
-
options
Returns the value of theoptionsrecord component.- Returns:
- the value of the
optionsrecord component
-