AnthropicChatModel constructor
AnthropicChatModel({
- required String apiKey,
- String model = 'claude-opus-5',
- int maxTokens = 16000,
- int streamMaxTokens = 64000,
- bool adaptiveThinking = true,
- ClaudeEffort? effort,
- bool? serverSideFallbacks,
- bool promptCaching = true,
- Uri? baseUrl,
- Map<
String, String> headers = const {}, - Duration timeout = const Duration(minutes: 10),
- int maxRetries = 2,
- HttpClient? httpClient,
Creates a client.
Implementation
AnthropicChatModel({
required this.apiKey,
this.model = 'claude-opus-5',
this.maxTokens = 16000,
this.streamMaxTokens = 64000,
this.adaptiveThinking = true,
this.effort,
this.serverSideFallbacks,
this.promptCaching = true,
Uri? baseUrl,
this.headers = const {},
Duration timeout = const Duration(minutes: 10),
int maxRetries = 2,
HttpClient? httpClient,
}) : baseUrl = baseUrl ?? Uri.parse('https://api.anthropic.com'),
_http = HttpTransport(
client: httpClient,
timeout: timeout,
maxRetries: maxRetries,
);