public interface LlmProviderOptions
Validated, provider-specific configuration transport for the LLM SPI. Carries the provider-specific settings (beyond
the common provider id / default model / connect timeout) that a provider factory needs, exposed through typed,
validating accessors.
The backing key/value store is never exposed raw: callers read through string(java.lang.String),
integer(java.lang.String), bool(java.lang.String), duration(java.lang.String), and secret(java.lang.String), each of which parses and validates. A
type-parse failure throws LlmProviderConfigurationException naming the provider and offending key — never the
value, in case it is a secret.
This type defines only the mechanism. The option-key vocabulary belongs to each provider module
(for example openai-compatible documents auth.header.name, auth.header.prefix,
responses.path). Unknown keys are not an error here (forward-compatibility); required-key validation is
provider-owned.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the boolean value forkey(strictly"true"or"false", case insensitive).Returns the decimal value forkey.Returns theDurationvalue forkey, accepting either ISO-8601 (for examplePT30S) or a compact shorthand — an amount plus an optionalns/us/ms/s/m/h/dunit suffix, defaulting to milliseconds (for example15s,2m,500ms).static LlmProviderOptionsempty()Returns the integer value forkey.keys()static LlmProviderOptionsCreates options backed by the given key/value map.default DurationrequireDuration(String key) Returns the requiredDurationvalue forkey.default intrequireInteger(String key) Returns the required integer value forkey.default StringrequireString(String key) Returns the required string value forkey.Returns the value forkeyas a credential reference (seeLlmSecretReference.parse(java.lang.String)).Returns the value forkeyexactly as configured (not trimmed — significant whitespace such as an auth header prefix"Bearer "is preserved), or empty when the key is absent or blank.
-
Method Details
-
string
Returns the value forkeyexactly as configured (not trimmed — significant whitespace such as an auth header prefix"Bearer "is preserved), or empty when the key is absent or blank.- Parameters:
key- the option key- Returns:
- the value, if present and non-blank
-
integer
Returns the integer value forkey.- Parameters:
key- the option key- Returns:
- the value, if present
- Throws:
LlmProviderConfigurationException- if the value is not a valid integer
-
bool
Returns the boolean value forkey(strictly"true"or"false", case insensitive).- Parameters:
key- the option key- Returns:
- the value, if present
- Throws:
LlmProviderConfigurationException- if the value is not a strict boolean
-
duration
Returns theDurationvalue forkey, accepting either ISO-8601 (for examplePT30S) or a compact shorthand — an amount plus an optionalns/us/ms/s/m/h/dunit suffix, defaulting to milliseconds (for example15s,2m,500ms).- Parameters:
key- the option key- Returns:
- the value, if present
- Throws:
LlmProviderConfigurationException- if the value is not a valid ISO-8601 or shorthand duration
-
decimal
Returns the decimal value forkey.- Parameters:
key- the option key- Returns:
- the value, if present
- Throws:
LlmProviderConfigurationException- if the value is not a valid decimal number
-
secret
Returns the value forkeyas a credential reference (seeLlmSecretReference.parse(java.lang.String)).- Parameters:
key- the option key- Returns:
- the reference, if present
-
keys
- Returns:
- the set of option keys present
-
providerName
String providerName()- Returns:
- the owning provider id, used in error messages
-
requireString
Returns the required string value forkey.- Parameters:
key- the option key- Returns:
- the value
- Throws:
LlmProviderConfigurationException- if the key is absent or blank
-
requireInteger
Returns the required integer value forkey.- Parameters:
key- the option key- Returns:
- the value
- Throws:
LlmProviderConfigurationException- if the key is absent, or not a valid integer
-
requireDuration
Returns the requiredDurationvalue forkey.- Parameters:
key- the option key- Returns:
- the value
- Throws:
LlmProviderConfigurationException- if the key is absent, or not a valid ISO-8601 or shorthand duration
-
empty
- Returns:
- an empty options instance
-
of
Creates options backed by the given key/value map.- Parameters:
providerName- the owning provider id, used only for error messages; must not benullvalues- the option key/value pairs; must not benull- Returns:
- validated options
-