Package com.axelor.ai.provider.sync
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 Summary
Modifier and TypeMethodDescriptiondefault StringbaseUrl(AiProvider provider, String fallback) The endpoint root, preferring whatever the admin configured.fetch(AiProvider provider, ModelListFetcher http) Fetches and normalises the vendor's model list.default StringrequireApiKey(AiProvider provider) Refuses early, naming the field, rather than letting the vendor return an opaque 401.type()
-
Method Details
-
type
AiProviderType type() -
fetch
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
The endpoint root, preferring whatever the admin configured. -
requireApiKey
Refuses early, naming the field, rather than letting the vendor return an opaque 401.
-