Interface ProviderAdapter

All Known Implementing Classes:
AnthropicAdapter, GoogleAdapter, MistralAdapter, OllamaAdapter, OpenAiAdapter

public interface ProviderAdapter
Knows how to ask one vendor what models it offers, and how to normalise the answer.

Normalising is the point: an adapter translates the vendor's own field names into the keys VendorModel.reported defines, so nothing downstream has to know that Anthropic says max_input_tokens while Gemini says inputTokenLimit.

  • Method Details

    • type

    • fetch

      List<VendorModel> fetch(AiProvider provider, ModelListFetcher http)
      Fetches and normalises the vendor's model list.
      Throws:
      SyncException - when the provider is not configured well enough to ask, or the call fails
    • baseUrl

      default String baseUrl(AiProvider provider, String fallback)
      The endpoint root, preferring whatever the admin configured.
    • requireApiKey

      default String requireApiKey(AiProvider provider)
      Refuses early, naming the field, rather than letting the vendor return an opaque 401.