Interface LlmClientConfigurationAdapter


public interface LlmClientConfigurationAdapter
Provider-owned mapping from a provider's agentforge4j.llm.<providerId>.* configuration subtree to a neutral LlmClientConfiguration. It lives in the provider module — alongside the provider's LlmClientFactory — so the provider, which owns its option-key vocabulary, also owns its property mapping. Discovered via ServiceLoader, mirroring LlmClientFactory.

Implementations must remain framework-neutral.

  • Method Details

    • providerId

      String providerId()
      Returns:
      the provider id this adapter configures; must match the namespace segment (agentforge4j.llm.<providerId>) and the matching LlmClientFactory.getProviderName()
    • isConfigured

      default boolean isConfigured(RawProviderConfiguration raw)
      Whether this provider is configured by the given subtree. The default is "any property present"; override where the provider's activation condition is stricter (for example an API key is required) or different (for example an enabled flag, or credentials that are not an API key).
      Parameters:
      raw - this provider's configuration subtree
      Returns:
      true when the provider should be activated
    • adapt

      Maps this provider's configuration subtree to the neutral configuration the provider's LlmClientFactory consumes. Provider-specific validation stays in the factory / its neutral-configuration mapping; this method only translates property keys to neutral fields and the provider's dotted option vocabulary.
      Parameters:
      raw - this provider's configuration subtree (only called when isConfigured(RawProviderConfiguration))
      Returns:
      the neutral client configuration