RemoteLanguageModel.create constructor
RemoteLanguageModel.create(
- ProviderConfig config, {
- String? apiKey,
- Client? client,
- Duration timeout = const Duration(seconds: 90),
The adapter for config's protocol. apiKey may be null for servers
that need none (a local Ollama). Pass a shared client to reuse
connections; otherwise one is created and released by close.
Implementation
factory RemoteLanguageModel.create(
ProviderConfig config, {
String? apiKey,
http.Client? client,
Duration timeout = const Duration(seconds: 90),
}) => switch (config.protocol) {
ProviderProtocol.openAiCompatible => OpenAiCompatibleModel(
config: config,
apiKey: apiKey,
client: client,
timeout: timeout,
),
ProviderProtocol.anthropic => AnthropicModel(
config: config,
apiKey: apiKey,
client: client,
timeout: timeout,
),
};