AnthropicChatModel constructor

AnthropicChatModel({
  1. required String apiKey,
  2. String model = 'claude-opus-5',
  3. int maxTokens = 16000,
  4. int streamMaxTokens = 64000,
  5. bool adaptiveThinking = true,
  6. ClaudeEffort? effort,
  7. bool? serverSideFallbacks,
  8. bool promptCaching = true,
  9. Uri? baseUrl,
  10. Map<String, String> headers = const {},
  11. Duration timeout = const Duration(minutes: 10),
  12. int maxRetries = 2,
  13. 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,
     );