/** * @verevoir/llm/anthropic — Anthropic SDK adapter. * * Wraps `@anthropic-ai/sdk` in the provider-agnostic surface defined in * the core. Importing this subpath requires `@anthropic-ai/sdk` as a * peer dependency on the consumer. * * The model catalogue itself (PROVIDER, CATALOG) lives in `./catalog.js`, * which has no SDK import — a consumer that only needs to resolve a model * term (not place a real call) can import `@verevoir/llm/catalog` instead * and never pull in `@anthropic-ai/sdk` at all. This file still imports and * registers it exactly as before, so nothing here changes for an existing * consumer of this subpath. */ import { PROVIDER } from './catalog.js'; import { type ChatOptions, type ChatReply, type ChatWithToolLoopOptions, type ChatWithToolLoopResult, type ChatWithToolsOptions, type ChatWithToolsResult, type ContentBlock, type ModelClass, type RatesTable } from '../index.js'; export { PROVIDER }; export type { ContentBlock }; /** * Concrete model id per {@link ModelClass}, derived from {@link CATALOG} — the * only place a call site needs. Upgrades happen in the catalog, not here. */ export declare const models: Readonly>; /** * Per-model pricing keyed by the concrete current id, derived from * {@link CATALOG}. Kept for back-compat with consumers that look pricing up by * exact id. * * @deprecated Part of the old static-rates cost API. Use * `createPriceBook(...)` / `book.costOf(...)` instead (see `src/pricing.ts`) * — it prices from LiteLLM's live table (the bundled snapshot as fallback) * and reports an unmatched model as `unpriced` rather than `0`. */ export declare const rates: RatesTable; /** * Single-shot LLM call. Streams the response, supports retry with * narration, BYOK, and live progress reporting via the auto-injected * `report_progress` tool when `onProgress` is set. */ export declare function chat(options: ChatOptions): Promise; /** * Tool-calling variant. The model decides which tools to invoke * against the supplied definitions; we surface every non-progress * tool_use to the caller for execution. Single-shot — no automated * multi-turn tool dance. */ export declare function chatWithTools(options: ChatWithToolsOptions): Promise; /** * Multi-turn tool-using chat. The caller supplies an executor; this * function runs the model → execute tools → feed results back loop * internally until the model produces a text-only response (or the * iteration cap fires). * * Each loop iteration is a full Anthropic call. Tool execution * happens between iterations; tool failures are surfaced to the model * as `tool_result` blocks with `is_error: true` so it can recover * (apologise, retry, switch approach) rather than the loop crashing. * * Usage and progress hooks fire per-iteration. Returned `usage` is * the sum across all iterations of the loop, so cost accounting at * the call site stays per-conversation-turn. */ export declare function chatWithToolLoop(options: ChatWithToolLoopOptions): Promise; /** * Namespaced re-export for callers that prefer the namespace form * (`anthropic.chat(...)`) over named imports. */ export declare const anthropic: { PROVIDER: string; models: Readonly>; rates: Readonly>; chat: typeof chat; chatWithTools: typeof chatWithTools; chatWithToolLoop: typeof chatWithToolLoop; }; //# sourceMappingURL=index.d.ts.map