createAnthropicProvider function
Create an Anthropic provider with default configuration
Implementation
AnthropicProvider createAnthropicProvider({
required String apiKey,
String? model,
String? baseUrl,
int? maxTokens,
double? temperature,
String? systemPrompt,
Duration? timeout,
bool? stream,
double? topP,
int? topK,
bool? reasoning,
int? thinkingBudgetTokens,
bool? interleavedThinking,
}) {
final config = AnthropicConfig(
apiKey: apiKey,
model: model ?? ProviderDefaults.anthropicDefaultModel,
baseUrl: baseUrl ?? ProviderDefaults.anthropicBaseUrl,
maxTokens: maxTokens,
temperature: temperature,
systemPrompt: systemPrompt,
timeout: timeout,
stream: stream ?? false,
topP: topP,
topK: topK,
reasoning: reasoning ?? false,
thinkingBudgetTokens: thinkingBudgetTokens,
interleavedThinking: interleavedThinking ?? false,
);
return AnthropicProvider(config);
}