import Anthropic, { type ClientOptions } from '@anthropic-ai/sdk'; import { Model, type BaseModelConfig, type CountTokensOptions, type StreamOptions } from '../models/model.js'; import type { Message } from '../types/messages.js'; import type { ModelStreamEvent } from '../models/streaming.js'; export interface AnthropicModelConfig extends BaseModelConfig { /** * Maximum number of tokens the model can generate in a response. * * @defaultValue 64000 — subject to change between versions. * Set this explicitly to avoid unexpected changes. */ maxTokens?: number; stopSequences?: string[]; params?: Record; /** * Beta features to enable via the `anthropic-beta` header. * * No header is sent by default. Provide a list of beta identifiers to opt into * features such as `interleaved-thinking-2025-05-14` or `mcp-client-2025-11-20`. * * @see https://docs.anthropic.com/en/api/beta-headers */ betas?: string[]; /** * Whether to use the native Anthropic countTokens API. * * When `true`, `countTokens()` calls the Anthropic token counting API for * accurate counts. When `false` or not set (default), skips the API call and uses * the character-based heuristic estimator. * * @defaultValue false */ useNativeTokenCount?: boolean; } export interface AnthropicModelOptions extends AnthropicModelConfig { apiKey?: string; client?: Anthropic; clientConfig?: ClientOptions; } export declare class AnthropicModel extends Model { private _config; private _client; constructor(options?: AnthropicModelOptions); updateConfig(modelConfig: AnthropicModelConfig): void; getConfig(): AnthropicModelConfig; /** * Count tokens using Anthropic's native countTokens API. * * Uses the same message format as the Messages API to get accurate token counts * directly from the Anthropic service. Falls back to the base class heuristic on failure. * * @param messages - Array of conversation messages to count tokens for * @param options - Optional options containing system prompt and tool specs * @returns Total input token count */ countTokens(messages: Message[], options?: CountTokensOptions): Promise; stream(messages: Message[], options?: StreamOptions): AsyncIterable; private _buildRequestOptions; private _formatRequest; private _formatMessages; private _isCacheableBlock; private _formatContentBlock; private _mapStopReason; } //# sourceMappingURL=anthropic.d.ts.map