/** * Anthropic provider - implements the {@link LLMProvider} contract for * Anthropic's Messages API (direct + via Veryfront Cloud / Bedrock-compatible * proxies). * * Ported from `src/provider/runtime-loader.ts` as part of PR 12. * * @module extensions/ext-llm-anthropic/anthropic-provider */ import type { LLMProvider, LLMProviderConfig } from "veryfront/extensions/llm"; import type { ModelRuntime } from "veryfront/provider/types"; import { buildProviderError, isNumberArray, mergeUsage, parseRetryAfterMs, ProviderError, ProviderOverloadedError, ProviderQuotaError, ProviderRateLimitError, ProviderRequestError, TOOL_INPUT_PENDING_THRESHOLD_MS } from "veryfront/provider/shared"; import { type OpenAICompatibleLanguageOptions } from "./anthropic-request-builder.js"; import { type AnthropicCitation } from "./anthropic-citations.js"; export { buildProviderError, isNumberArray, mergeUsage, parseRetryAfterMs, ProviderError, ProviderOverloadedError, ProviderQuotaError, ProviderRateLimitError, ProviderRequestError, TOOL_INPUT_PENDING_THRESHOLD_MS, }; export interface AnthropicRuntimeConfig { apiKey?: string; authToken?: string; baseURL?: string; name?: string; fetch?: typeof globalThis.fetch; } type AnthropicReasoningContent = { type: "reasoning"; text?: string; signature?: string; redactedData?: string; }; type AnthropicTextContent = { type: "text"; text: string; citations?: AnthropicCitation[]; }; type AnthropicToolCallContent = { type: "tool-call"; toolCallId: string; toolName: string; input: string; providerExecuted?: boolean; }; type AnthropicToolResultContent = { type: "tool-result"; toolCallId: string; toolName: string; result: unknown; isError?: boolean; providerExecuted: true; }; type AnthropicGenerateContent = AnthropicTextContent | AnthropicReasoningContent | AnthropicToolCallContent | AnthropicToolResultContent; export declare function createAnthropicModelRuntime(config: AnthropicRuntimeConfig, modelId: string): ModelRuntime; export declare class AnthropicProvider implements LLMProvider { readonly id = "anthropic"; createModel(modelId: string, config: LLMProviderConfig): ModelRuntime; } //# sourceMappingURL=anthropic-provider.d.ts.map