agentforge4j.llm.<providerId>.* configuration subtree, handed to a
LlmClientConfigurationAdapter. Keys are the canonical property names in kebab-case (for example
api-key, deployment-name); values are their raw string forms.
Per-key values are resolved through a RawConfigurationSource, so the host configuration decides how a key
is looked up (including how alternate key spellings resolve to a canonical key) while this class — and the provider
adapters that consume it — stay independent of any particular configuration mechanism. A parse failure throws
LlmProviderConfigurationException naming the full property key (agentforge4j.llm.<providerId>.<key>)
— never the value, in case it is a secret.
get(String) returns a key's value whenever the key is present, even if blank — presence semantics;
require(String) and the typed accessors treat a blank value as absent.
The enumeration views (isEmpty(), keys(), asMap()) reflect the keys discovered from
configuration sources that can be enumerated by canonical key. They are best-effort for sources whose canonical keys
cannot be reconstructed; per-key accessors remain authoritative for every source. Adapters therefore gate activation
on explicit keys (an api-key, an enabled flag) rather than on isEmpty().
-
Constructor Summary
ConstructorsConstructorDescriptionRawProviderConfiguration(String providerId, RawConfigurationSource source, Set<String> presentKeys) -
Method Summary
Modifier and TypeMethodDescriptionasMap()Returns a key's value whenever the key is present, including a blank value (presence semantics).getBoolean(String key) getDuration(String key) Parses a duration in either ISO-8601 form (for examplePT15S) or the compact shorthand (an amount plus an optionalns/us/ms/s/m/h/dunit suffix, defaulting to milliseconds — for example15s,2m,500ms,5000).booleanisEmpty()booleanReturns whetherkeyis set to the literal"true"(case-insensitive), tolerating any other value — absent, blank,"false", or malformed ("yes","1", ...) — asfalserather than throwing.keys()Returns the required, non-blank value forkey.
-
Constructor Details
-
RawProviderConfiguration
public RawProviderConfiguration(String providerId, RawConfigurationSource source, Set<String> presentKeys) - Parameters:
providerId- the provider id whose subtree this represents; must not be blanksource- the per-key value lookup for this provider's subtree; must not benullpresentKeys- the keys discovered from enumerable property sources, used for the enumeration views; must not benull(copied immutably)
-
-
Method Details
-
providerId
- Returns:
- the provider id this subtree belongs to
-
isEmpty
public boolean isEmpty()- Returns:
truewhen no properties are discovered under this provider's subtree (best-effort; see the class documentation)
-
keys
- Returns:
- the discovered property keys (immutable; best-effort, see the class documentation)
-
get
Returns a key's value whenever the key is present, including a blank value (presence semantics).- Parameters:
key- the property key (kebab-case, relative to the provider subtree)- Returns:
- the value if the key is present, otherwise empty
-
require
Returns the required, non-blank value forkey.- Parameters:
key- the property key- Returns:
- the non-blank value
- Throws:
LlmProviderConfigurationException- if the key is absent or blank
-
getInt
- Parameters:
key- the property key- Returns:
- the integer value when present and non-blank
- Throws:
LlmProviderConfigurationException- if present but not a valid integer
-
getDouble
- Parameters:
key- the property key- Returns:
- the decimal value when present and non-blank
- Throws:
LlmProviderConfigurationException- if present but not a valid decimal number
-
getDuration
Parses a duration in either ISO-8601 form (for examplePT15S) or the compact shorthand (an amount plus an optionalns/us/ms/s/m/h/dunit suffix, defaulting to milliseconds — for example15s,2m,500ms,5000).- Parameters:
key- the property key- Returns:
- the duration value when present and non-blank
- Throws:
LlmProviderConfigurationException- if present but not a valid ISO-8601 or shorthand duration
-
getBoolean
- Parameters:
key- the property key- Returns:
- the boolean value when present and non-blank (strictly
true/false, case-insensitive) - Throws:
LlmProviderConfigurationException- if present but not a strict boolean
-
isTrue
Returns whetherkeyis set to the literal"true"(case-insensitive), tolerating any other value — absent, blank,"false", or malformed ("yes","1", ...) — asfalserather than throwing. Intended forenabled-style activation gates, where a malformed value must not fail startup; for every other use prefergetBoolean(String), which fails loudly on a malformed value.- Parameters:
key- the property key- Returns:
trueonly when the value is the literal"true"(case-insensitive)
-
asMap
- Returns:
- an immutable map of the discovered keys to their resolved values (best-effort; see the class documentation)
-