@adaline/anthropic
Version:
Adaline Anthropic
1,535 lines (1,516 loc) • 119 kB
text/typescript
import * as zod from 'zod';
import { z } from 'zod';
import { ChatModelV1, ChatModelSchemaType, UrlType, HeadersType, ParamsType, EmbeddingModelSchemaType, EmbeddingModelV1, ProviderV1 } from '@adaline/provider';
import { MessageType, ConfigType, ToolType, ChatResponseType, PartialChatResponseType, ChatModelPriceType, EmbeddingRequestsType, EmbeddingResponseType } from '@adaline/types';
declare const ChatModelBaseConfigSchema: (maxOutputTokens: number, maxSequences: number) => z.ZodObject<{
temperature: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
maxTokens: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
stop: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
topP: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
topK: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
toolChoice: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodEnum<[string, ...string[]]>>>>;
}, "strip", z.ZodTypeAny, {
temperature?: number | undefined;
maxTokens?: number | undefined;
stop?: string[] | undefined;
topP?: number | undefined;
topK?: number | undefined;
toolChoice?: string | null | undefined;
}, {
temperature?: number | undefined;
maxTokens?: number | undefined;
stop?: string[] | undefined;
topP?: number | undefined;
topK?: number | undefined;
toolChoice?: string | null | undefined;
}>;
declare const ChatModelBaseConfigDef: (maxOutputTokens: number, maxSequences: number) => {
readonly temperature: {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
};
readonly maxTokens: {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
};
readonly stop: {
type: "multi-string";
param: string;
title: string;
description: string;
max: number;
};
readonly topP: {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
};
readonly topK: {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
};
readonly toolChoice: {
type: "select-string";
param: string;
title: string;
description: string;
default: string;
choices: string[];
};
};
declare const temperature: {
def: {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
};
schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
};
declare const maxTokens: (maxOutputTokens: number) => {
def: {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
};
schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
};
declare const stop: (maxSequences: number) => {
def: {
type: "multi-string";
param: string;
title: string;
description: string;
max: number;
};
schema: zod.ZodOptional<zod.ZodDefault<zod.ZodArray<zod.ZodString, "many">>>;
};
declare const topP: {
def: {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
};
schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
};
declare const topK: {
def: {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
};
schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
};
declare const toolChoice: {
def: {
type: "select-string";
param: string;
title: string;
description: string;
default: string;
choices: string[];
};
schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNullable<zod.ZodEnum<[string, ...string[]]>>>>;
};
declare const ChatModelReasoningConfigDef: (maxOutputTokens: number, maxSequences: number, minReasoningToken: number, maxReasoningToken: number) => {
reasoningEnabled: {
type: "select-boolean";
param: string;
title: string;
description: string;
default: boolean | null;
};
maxReasoningTokens: {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
};
temperature: {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
};
maxTokens: {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
};
stop: {
type: "multi-string";
param: string;
title: string;
description: string;
max: number;
};
topP: {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
};
topK: {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
};
toolChoice: {
type: "select-string";
param: string;
title: string;
description: string;
default: string;
choices: string[];
};
};
declare const ChatModelReasoningConfigSchema: (maxOutputTokens: number, maxSequences: number, minReasoningToken: number, maxReasoningToken: number) => zod.ZodObject<zod.objectUtil.extendShape<{
temperature: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
maxTokens: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
stop: zod.ZodOptional<zod.ZodDefault<zod.ZodArray<zod.ZodString, "many">>>;
topP: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
topK: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
toolChoice: zod.ZodOptional<zod.ZodDefault<zod.ZodNullable<zod.ZodEnum<[string, ...string[]]>>>>;
}, {
reasoningEnabled: zod.ZodOptional<zod.ZodDefault<zod.ZodNullable<zod.ZodBoolean>>>;
maxReasoningTokens: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
}>, "strip", zod.ZodTypeAny, {
temperature?: number | undefined;
maxTokens?: number | undefined;
stop?: string[] | undefined;
topP?: number | undefined;
topK?: number | undefined;
toolChoice?: string | null | undefined;
reasoningEnabled?: boolean | null | undefined;
maxReasoningTokens?: number | undefined;
}, {
temperature?: number | undefined;
maxTokens?: number | undefined;
stop?: string[] | undefined;
topP?: number | undefined;
topK?: number | undefined;
toolChoice?: string | null | undefined;
reasoningEnabled?: boolean | null | undefined;
maxReasoningTokens?: number | undefined;
}>;
declare const AnthropicChatModelConfigs: {
readonly base: (maxOutputTokens: number, maxSequences: number) => {
def: {
readonly temperature: {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
};
readonly maxTokens: {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
};
readonly stop: {
type: "multi-string";
param: string;
title: string;
description: string;
max: number;
};
readonly topP: {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
};
readonly topK: {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
};
readonly toolChoice: {
type: "select-string";
param: string;
title: string;
description: string;
default: string;
choices: string[];
};
};
schema: zod.ZodObject<{
temperature: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
maxTokens: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
stop: zod.ZodOptional<zod.ZodDefault<zod.ZodArray<zod.ZodString, "many">>>;
topP: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
topK: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
toolChoice: zod.ZodOptional<zod.ZodDefault<zod.ZodNullable<zod.ZodEnum<[string, ...string[]]>>>>;
}, "strip", zod.ZodTypeAny, {
temperature?: number | undefined;
maxTokens?: number | undefined;
stop?: string[] | undefined;
topP?: number | undefined;
topK?: number | undefined;
toolChoice?: string | null | undefined;
}, {
temperature?: number | undefined;
maxTokens?: number | undefined;
stop?: string[] | undefined;
topP?: number | undefined;
topK?: number | undefined;
toolChoice?: string | null | undefined;
}>;
};
readonly extendedThinking: (maxOutputTokens: number, maxSequences: number, minReasoningToken: number, maxReasoningTokens: number) => {
def: {
reasoningEnabled: {
type: "select-boolean";
param: string;
title: string;
description: string;
default: boolean | null;
};
maxReasoningTokens: {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
};
temperature: {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
};
maxTokens: {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
};
stop: {
type: "multi-string";
param: string;
title: string;
description: string;
max: number;
};
topP: {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
};
topK: {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
};
toolChoice: {
type: "select-string";
param: string;
title: string;
description: string;
default: string;
choices: string[];
};
};
schema: zod.ZodObject<zod.objectUtil.extendShape<{
temperature: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
maxTokens: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
stop: zod.ZodOptional<zod.ZodDefault<zod.ZodArray<zod.ZodString, "many">>>;
topP: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
topK: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
toolChoice: zod.ZodOptional<zod.ZodDefault<zod.ZodNullable<zod.ZodEnum<[string, ...string[]]>>>>;
}, {
reasoningEnabled: zod.ZodOptional<zod.ZodDefault<zod.ZodNullable<zod.ZodBoolean>>>;
maxReasoningTokens: zod.ZodOptional<zod.ZodDefault<zod.ZodNumber>>;
}>, "strip", zod.ZodTypeAny, {
temperature?: number | undefined;
maxTokens?: number | undefined;
stop?: string[] | undefined;
topP?: number | undefined;
topK?: number | undefined;
toolChoice?: string | null | undefined;
reasoningEnabled?: boolean | null | undefined;
maxReasoningTokens?: number | undefined;
}, {
temperature?: number | undefined;
maxTokens?: number | undefined;
stop?: string[] | undefined;
topP?: number | undefined;
topK?: number | undefined;
toolChoice?: string | null | undefined;
reasoningEnabled?: boolean | null | undefined;
maxReasoningTokens?: number | undefined;
}>;
};
};
declare const AnthropicEmbeddingModelConfigs: {
readonly base: () => {
def: {
encodingFormat: {
type: "select-string";
param: string;
title: string;
description: string;
default: string;
choices: string[];
};
inputType: {
type: "select-string";
param: string;
title: string;
description: string;
default: string;
choices: string[];
};
truncation: {
type: "select-boolean";
param: string;
title: string;
description: string;
default: boolean | null;
};
};
schema: zod.ZodObject<{
encodingFormat: zod.ZodOptional<zod.ZodDefault<zod.ZodNullable<zod.ZodEnum<[string, ...string[]]>>>>;
inputType: zod.ZodOptional<zod.ZodDefault<zod.ZodNullable<zod.ZodEnum<[string, ...string[]]>>>>;
truncation: zod.ZodOptional<zod.ZodDefault<zod.ZodNullable<zod.ZodBoolean>>>;
}, "strip", zod.ZodTypeAny, {
truncation?: boolean | null | undefined;
encodingFormat?: string | null | undefined;
inputType?: string | null | undefined;
}, {
truncation?: boolean | null | undefined;
encodingFormat?: string | null | undefined;
inputType?: string | null | undefined;
}>;
};
};
declare const EmbeddingModelBaseConfigSchema: () => z.ZodObject<{
encodingFormat: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodEnum<[string, ...string[]]>>>>;
inputType: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodEnum<[string, ...string[]]>>>>;
truncation: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodBoolean>>>;
}, "strip", z.ZodTypeAny, {
truncation?: boolean | null | undefined;
encodingFormat?: string | null | undefined;
inputType?: string | null | undefined;
}, {
truncation?: boolean | null | undefined;
encodingFormat?: string | null | undefined;
inputType?: string | null | undefined;
}>;
declare const EmbeddingModelBaseConfigDef: () => {
encodingFormat: {
type: "select-string";
param: string;
title: string;
description: string;
default: string;
choices: string[];
};
inputType: {
type: "select-string";
param: string;
title: string;
description: string;
default: string;
choices: string[];
};
truncation: {
type: "select-boolean";
param: string;
title: string;
description: string;
default: boolean | null;
};
};
declare const encodingFormat: {
def: {
type: "select-string";
param: string;
title: string;
description: string;
default: string;
choices: string[];
};
schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNullable<zod.ZodEnum<[string, ...string[]]>>>>;
};
declare const inputType: {
def: {
type: "select-string";
param: string;
title: string;
description: string;
default: string;
choices: string[];
};
schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNullable<zod.ZodEnum<[string, ...string[]]>>>>;
};
declare const truncation: {
def: {
type: "select-boolean";
param: string;
title: string;
description: string;
default: boolean | null;
};
schema: zod.ZodOptional<zod.ZodDefault<zod.ZodNullable<zod.ZodBoolean>>>;
};
declare const BaseChatModelOptions: z.ZodObject<{
modelName: z.ZodString;
apiKey: z.ZodString;
completeChatUrl: z.ZodOptional<z.ZodString>;
streamChatUrl: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
modelName: string;
apiKey: string;
completeChatUrl?: string | undefined;
streamChatUrl?: string | undefined;
}, {
modelName: string;
apiKey: string;
completeChatUrl?: string | undefined;
streamChatUrl?: string | undefined;
}>;
type BaseChatModelOptionsType = z.infer<typeof BaseChatModelOptions>;
declare class BaseChatModel implements ChatModelV1<ChatModelSchemaType> {
readonly version: "v1";
readonly modelName: string;
modelSchema: ChatModelSchemaType;
private readonly apiKey;
private readonly baseUrl;
private readonly completeChatUrl;
private readonly streamChatUrl;
constructor(modelSchema: ChatModelSchemaType, options: BaseChatModelOptionsType);
getDefaultBaseUrl(): UrlType;
getDefaultHeaders(): HeadersType;
getDefaultParams(): ParamsType;
getRetryDelay(responseHeaders: HeadersType): {
shouldRetry: boolean;
delayMs: number;
};
getTokenCount(messages: MessageType[]): number;
transformModelRequest(request: any): {
modelName: string | undefined;
config: ConfigType;
messages: MessageType[];
tools: ToolType[] | undefined;
};
transformConfig(config: ConfigType, messages?: MessageType[], tools?: ToolType[]): ParamsType;
transformMessages(messages: MessageType[]): ParamsType;
transformTools(tools: ToolType[]): ParamsType;
getCompleteChatUrl(config?: ConfigType, messages?: MessageType[], tools?: ToolType[]): Promise<UrlType>;
getCompleteChatHeaders(config?: ConfigType, messages?: MessageType[], tools?: ToolType[]): Promise<HeadersType>;
getCompleteChatData(config: ConfigType, messages: MessageType[], tools?: ToolType[]): Promise<ParamsType>;
transformCompleteChatResponse(response: any): ChatResponseType;
getStreamChatUrl(config?: ConfigType, messages?: MessageType[], tools?: ToolType[]): Promise<UrlType>;
getStreamChatHeaders(config?: ConfigType, messages?: MessageType[], tools?: ToolType[]): Promise<HeadersType>;
getStreamChatData(config: ConfigType, messages: MessageType[], tools?: ToolType[]): Promise<ParamsType>;
transformStreamChatResponseChunk(chunk: string, buffer: string): AsyncGenerator<{
partialResponse: PartialChatResponseType;
buffer: string;
}>;
transformProxyStreamChatResponseChunk(chunk: string, buffer: string, data?: any, headers?: Record<string, string>, query?: Record<string, string>): AsyncGenerator<{
partialResponse: PartialChatResponseType;
buffer: string;
}>;
getProxyStreamChatUrl(data?: any, headers?: Record<string, string>, query?: Record<string, string>): Promise<UrlType>;
getProxyCompleteChatUrl(data?: any, headers?: Record<string, string>, query?: Record<string, string>): Promise<UrlType>;
getProxyCompleteChatHeaders(data?: any, headers?: Record<string, string>, query?: Record<string, string>): Promise<HeadersType>;
getProxyStreamChatHeaders(data?: any, headers?: Record<string, string>, query?: Record<string, string>): Promise<HeadersType>;
getModelPricing(): ChatModelPriceType;
}
declare const Claude4Opus20250514Literal = "claude-4-opus-20250514";
declare const Claude4Opus20250514Schema: {
description: string;
name: string;
roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
modalities: ["text" | "image" | "tool-call" | "tool-response" | "reasoning", ...("text" | "image" | "tool-call" | "tool-response" | "reasoning")[]];
maxInputTokens: number;
maxOutputTokens: number;
config: {
def: Record<string, {
type: "multi-string";
param: string;
title: string;
description: string;
max: number;
} | {
type: "object-schema";
param: string;
title: string;
description: string;
objectSchema?: any;
} | {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
} | {
type: "select-boolean";
param: string;
title: string;
description: string;
default: boolean | null;
} | {
type: "select-string";
param: string;
title: string;
description: string;
default: string;
choices: string[];
}>;
schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
};
price: {
modelName: string;
currency: string;
tokenRanges: {
minTokens: number;
prices: {
base: {
inputPricePerMillion: number;
outputPricePerMillion: number;
};
};
maxTokens?: number | null | undefined;
}[];
};
maxReasoningTokens?: number | undefined;
};
declare const Claude4Opus20250514Options: z.ZodObject<{
modelName: z.ZodString;
apiKey: z.ZodString;
completeChatUrl: z.ZodOptional<z.ZodString>;
streamChatUrl: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
modelName: string;
apiKey: string;
completeChatUrl?: string | undefined;
streamChatUrl?: string | undefined;
}, {
modelName: string;
apiKey: string;
completeChatUrl?: string | undefined;
streamChatUrl?: string | undefined;
}>;
type Claude4Opus20250514OptionsType = z.infer<typeof Claude4Opus20250514Options>;
declare class Claude4Opus20250514 extends BaseChatModel {
constructor(options: Claude4Opus20250514OptionsType);
}
declare const Claude4Sonnet20250514Literal = "claude-4-sonnet-20250514";
declare const Claude4Sonnet20250514Schema: {
description: string;
name: string;
roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
modalities: ["text" | "image" | "tool-call" | "tool-response" | "reasoning", ...("text" | "image" | "tool-call" | "tool-response" | "reasoning")[]];
maxInputTokens: number;
maxOutputTokens: number;
config: {
def: Record<string, {
type: "multi-string";
param: string;
title: string;
description: string;
max: number;
} | {
type: "object-schema";
param: string;
title: string;
description: string;
objectSchema?: any;
} | {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
} | {
type: "select-boolean";
param: string;
title: string;
description: string;
default: boolean | null;
} | {
type: "select-string";
param: string;
title: string;
description: string;
default: string;
choices: string[];
}>;
schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
};
price: {
modelName: string;
currency: string;
tokenRanges: {
minTokens: number;
prices: {
base: {
inputPricePerMillion: number;
outputPricePerMillion: number;
};
};
maxTokens?: number | null | undefined;
}[];
};
maxReasoningTokens?: number | undefined;
};
declare const Claude4Sonnet20250514Options: z.ZodObject<{
modelName: z.ZodString;
apiKey: z.ZodString;
completeChatUrl: z.ZodOptional<z.ZodString>;
streamChatUrl: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
modelName: string;
apiKey: string;
completeChatUrl?: string | undefined;
streamChatUrl?: string | undefined;
}, {
modelName: string;
apiKey: string;
completeChatUrl?: string | undefined;
streamChatUrl?: string | undefined;
}>;
type Claude4Sonnet20250514OptionsType = z.infer<typeof Claude4Sonnet20250514Options>;
declare class Claude4Sonnet20250514 extends BaseChatModel {
constructor(options: Claude4Sonnet20250514OptionsType);
}
declare const Claude3_5Sonnet20240620Literal = "claude-3-5-sonnet-20240620";
declare const Claude3_5Sonnet20240620Schema: {
description: string;
name: string;
roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
maxInputTokens: number;
maxOutputTokens: number;
config: {
def: Record<string, {
type: "multi-string";
param: string;
title: string;
description: string;
max: number;
} | {
type: "object-schema";
param: string;
title: string;
description: string;
objectSchema?: any;
} | {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
} | {
type: "select-boolean";
param: string;
title: string;
description: string;
default: boolean | null;
} | {
type: "select-string";
param: string;
title: string;
description: string;
default: string;
choices: string[];
}>;
schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
};
price: {
modelName: string;
currency: string;
tokenRanges: {
minTokens: number;
prices: {
base: {
inputPricePerMillion: number;
outputPricePerMillion: number;
};
};
maxTokens?: number | null | undefined;
}[];
};
maxReasoningTokens?: number | undefined;
};
declare const Claude3_5Sonnet20240620Options: z.ZodObject<{
modelName: z.ZodString;
apiKey: z.ZodString;
completeChatUrl: z.ZodOptional<z.ZodString>;
streamChatUrl: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
modelName: string;
apiKey: string;
completeChatUrl?: string | undefined;
streamChatUrl?: string | undefined;
}, {
modelName: string;
apiKey: string;
completeChatUrl?: string | undefined;
streamChatUrl?: string | undefined;
}>;
type Claude3_5Sonnet20240620OptionsType = z.infer<typeof Claude3_5Sonnet20240620Options>;
declare class Claude3_5Sonnet20240620 extends BaseChatModel {
constructor(options: Claude3_5Sonnet20240620OptionsType);
}
declare const Claude3_5Sonnet20241022Literal = "claude-3-5-sonnet-20241022";
declare const Claude3_5Sonnet20241022Schema: {
description: string;
name: string;
roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
maxInputTokens: number;
maxOutputTokens: number;
config: {
def: Record<string, {
type: "multi-string";
param: string;
title: string;
description: string;
max: number;
} | {
type: "object-schema";
param: string;
title: string;
description: string;
objectSchema?: any;
} | {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
} | {
type: "select-boolean";
param: string;
title: string;
description: string;
default: boolean | null;
} | {
type: "select-string";
param: string;
title: string;
description: string;
default: string;
choices: string[];
}>;
schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
};
price: {
modelName: string;
currency: string;
tokenRanges: {
minTokens: number;
prices: {
base: {
inputPricePerMillion: number;
outputPricePerMillion: number;
};
};
maxTokens?: number | null | undefined;
}[];
};
maxReasoningTokens?: number | undefined;
};
declare const Claude3_5Sonnet20241022Options: z.ZodObject<{
modelName: z.ZodString;
apiKey: z.ZodString;
completeChatUrl: z.ZodOptional<z.ZodString>;
streamChatUrl: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
modelName: string;
apiKey: string;
completeChatUrl?: string | undefined;
streamChatUrl?: string | undefined;
}, {
modelName: string;
apiKey: string;
completeChatUrl?: string | undefined;
streamChatUrl?: string | undefined;
}>;
type Claude3_5Sonnet20241022OptionsType = z.infer<typeof Claude3_5Sonnet20241022Options>;
declare class Claude3_5Sonnet20241022 extends BaseChatModel {
constructor(options: Claude3_5Sonnet20241022OptionsType);
}
declare const Claude3_7Sonnet20250219Literal = "claude-3-7-sonnet-20250219";
declare const Claude3_7Sonnet20250219Schema: {
description: string;
name: string;
roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
modalities: ["text" | "image" | "tool-call" | "tool-response" | "reasoning", ...("text" | "image" | "tool-call" | "tool-response" | "reasoning")[]];
maxInputTokens: number;
maxOutputTokens: number;
config: {
def: Record<string, {
type: "multi-string";
param: string;
title: string;
description: string;
max: number;
} | {
type: "object-schema";
param: string;
title: string;
description: string;
objectSchema?: any;
} | {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
} | {
type: "select-boolean";
param: string;
title: string;
description: string;
default: boolean | null;
} | {
type: "select-string";
param: string;
title: string;
description: string;
default: string;
choices: string[];
}>;
schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
};
price: {
modelName: string;
currency: string;
tokenRanges: {
minTokens: number;
prices: {
base: {
inputPricePerMillion: number;
outputPricePerMillion: number;
};
};
maxTokens?: number | null | undefined;
}[];
};
maxReasoningTokens?: number | undefined;
};
declare const Claude3_7Sonnet20250219Options: z.ZodObject<{
modelName: z.ZodString;
apiKey: z.ZodString;
completeChatUrl: z.ZodOptional<z.ZodString>;
streamChatUrl: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
modelName: string;
apiKey: string;
completeChatUrl?: string | undefined;
streamChatUrl?: string | undefined;
}, {
modelName: string;
apiKey: string;
completeChatUrl?: string | undefined;
streamChatUrl?: string | undefined;
}>;
type Claude3_7Sonnet20250219OptionsType = z.infer<typeof Claude3_7Sonnet20250219Options>;
declare class Claude3_7Sonnet20250219 extends BaseChatModel {
constructor(options: Claude3_7Sonnet20250219OptionsType);
getDefaultHeaders(): HeadersType;
}
declare const Claude3Haiku20240307Literal = "claude-3-haiku-20240307";
declare const Claude3Haiku20240307Schema: {
description: string;
name: string;
roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
maxInputTokens: number;
maxOutputTokens: number;
config: {
def: Record<string, {
type: "multi-string";
param: string;
title: string;
description: string;
max: number;
} | {
type: "object-schema";
param: string;
title: string;
description: string;
objectSchema?: any;
} | {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
} | {
type: "select-boolean";
param: string;
title: string;
description: string;
default: boolean | null;
} | {
type: "select-string";
param: string;
title: string;
description: string;
default: string;
choices: string[];
}>;
schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
};
price: {
modelName: string;
currency: string;
tokenRanges: {
minTokens: number;
prices: {
base: {
inputPricePerMillion: number;
outputPricePerMillion: number;
};
};
maxTokens?: number | null | undefined;
}[];
};
maxReasoningTokens?: number | undefined;
};
declare const Claude3Haiku20240307Options: z.ZodObject<{
modelName: z.ZodString;
apiKey: z.ZodString;
completeChatUrl: z.ZodOptional<z.ZodString>;
streamChatUrl: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
modelName: string;
apiKey: string;
completeChatUrl?: string | undefined;
streamChatUrl?: string | undefined;
}, {
modelName: string;
apiKey: string;
completeChatUrl?: string | undefined;
streamChatUrl?: string | undefined;
}>;
type Claude3Haiku20240307OptionsType = z.infer<typeof Claude3Haiku20240307Options>;
declare class Claude3Haiku20240307 extends BaseChatModel {
constructor(options: Claude3Haiku20240307OptionsType);
}
declare const Claude3_5Haiku20241022Literal = "claude-3-5-haiku-20241022";
declare const Claude3_5Haiku20241022Schema: {
description: string;
name: string;
roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
maxInputTokens: number;
maxOutputTokens: number;
config: {
def: Record<string, {
type: "multi-string";
param: string;
title: string;
description: string;
max: number;
} | {
type: "object-schema";
param: string;
title: string;
description: string;
objectSchema?: any;
} | {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
} | {
type: "select-boolean";
param: string;
title: string;
description: string;
default: boolean | null;
} | {
type: "select-string";
param: string;
title: string;
description: string;
default: string;
choices: string[];
}>;
schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
};
price: {
modelName: string;
currency: string;
tokenRanges: {
minTokens: number;
prices: {
base: {
inputPricePerMillion: number;
outputPricePerMillion: number;
};
};
maxTokens?: number | null | undefined;
}[];
};
maxReasoningTokens?: number | undefined;
};
declare const Claude3_5Haiku20241022Options: z.ZodObject<{
modelName: z.ZodString;
apiKey: z.ZodString;
completeChatUrl: z.ZodOptional<z.ZodString>;
streamChatUrl: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
modelName: string;
apiKey: string;
completeChatUrl?: string | undefined;
streamChatUrl?: string | undefined;
}, {
modelName: string;
apiKey: string;
completeChatUrl?: string | undefined;
streamChatUrl?: string | undefined;
}>;
type Claude3_5Haiku20241022OptionsType = z.infer<typeof Claude3_5Haiku20241022Options>;
declare class Claude3_5Haiku20241022 extends BaseChatModel {
constructor(options: Claude3_5Haiku20241022OptionsType);
}
declare const Claude3Opus20240229Literal = "claude-3-opus-20240229";
declare const Claude3Opus20240229Schema: {
description: string;
name: string;
roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
maxInputTokens: number;
maxOutputTokens: number;
config: {
def: Record<string, {
type: "multi-string";
param: string;
title: string;
description: string;
max: number;
} | {
type: "object-schema";
param: string;
title: string;
description: string;
objectSchema?: any;
} | {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
} | {
type: "select-boolean";
param: string;
title: string;
description: string;
default: boolean | null;
} | {
type: "select-string";
param: string;
title: string;
description: string;
default: string;
choices: string[];
}>;
schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
};
price: {
modelName: string;
currency: string;
tokenRanges: {
minTokens: number;
prices: {
base: {
inputPricePerMillion: number;
outputPricePerMillion: number;
};
};
maxTokens?: number | null | undefined;
}[];
};
maxReasoningTokens?: number | undefined;
};
declare const Claude3Opus20240229Options: z.ZodObject<{
modelName: z.ZodString;
apiKey: z.ZodString;
completeChatUrl: z.ZodOptional<z.ZodString>;
streamChatUrl: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
modelName: string;
apiKey: string;
completeChatUrl?: string | undefined;
streamChatUrl?: string | undefined;
}, {
modelName: string;
apiKey: string;
completeChatUrl?: string | undefined;
streamChatUrl?: string | undefined;
}>;
type Claude3Opus20240229OptionsType = z.infer<typeof Claude3Opus20240229Options>;
declare class Claude3Opus20240229 extends BaseChatModel {
constructor(options: Claude3Opus20240229OptionsType);
}
declare const Claude3Sonnet20240229Literal = "claude-3-sonnet-20240229";
declare const Claude3Sonnet20240229Schema: {
description: string;
name: string;
roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
maxInputTokens: number;
maxOutputTokens: number;
config: {
def: Record<string, {
type: "multi-string";
param: string;
title: string;
description: string;
max: number;
} | {
type: "object-schema";
param: string;
title: string;
description: string;
objectSchema?: any;
} | {
type: "range";
param: string;
title: string;
description: string;
max: number;
default: number;
min: number;
step: number;
} | {
type: "select-boolean";
param: string;
title: string;
description: string;
default: boolean | null;
} | {
type: "select-string";
param: string;
title: string;
description: string;
default: string;
choices: string[];
}>;
schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
};
price: {
modelName: string;
currency: string;
tokenRanges: {
minTokens: number;
prices: {
base: {
inputPricePerMillion: number;
outputPricePerMillion: number;
};
};
maxTokens?: number | null | undefined;
}[];
};
maxReasoningTokens?: number | undefined;
};
declare const Claude3Sonnet20240229Options: z.ZodObject<{
modelName: z.ZodString;
apiKey: z.ZodString;
completeChatUrl: z.ZodOptional<z.ZodString>;
streamChatUrl: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
modelName: string;
apiKey: string;
completeChatUrl?: string | undefined;
streamChatUrl?: string | undefined;
}, {
modelName: string;
apiKey: string;
completeChatUrl?: string | undefined;
streamChatUrl?: string | undefined;
}>;
type Claude3Sonnet20240229OptionsType = z.infer<typeof Claude3Sonnet20240229Options>;
declare class Claude3Sonnet20240229 extends BaseChatModel {
constructor(options: Claude3Sonnet20240229OptionsType);
}
declare const AnthropicChatModelRoles: z.ZodEnum<["system", "user", "assistant", "tool"]>;
declare const AnthropicChatModelRolesMap: {
readonly system: "system";
readonly user: "user";
readonly assistant: "assistant";
readonly tool: "user";
};
declare const AnthropicChatModelModalities: ChatModelSchemaType["modalities"];
declare const AnthropicChatModelModalitiesEnum: z.ZodEnum<["text", "image", "tool-call", "tool-response"]>;
declare const AnthropicThinkingChatModelModalities: ChatModelSchemaType["modalities"];
declare const AnthropicThinkingChatModelModalitiesEnum: z.ZodEnum<["text", "image", "tool-call", "tool-response", "reasoning"]>;
declare const AnthropicCompleteChatResponse: z.ZodObject<{
content: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
type: z.ZodLiteral<"text">;
text: z.ZodString;
}, "strip", z.ZodTypeAny, {
type: "text";
text: string;
}, {
type: "text";
text: string;
}>, z.ZodObject<{
type: z.ZodLiteral<"tool_use">;
id: z.ZodString;
name: z.ZodString;
input: z.ZodRecord<z.ZodString, z.ZodAny>;
}, "strip", z.ZodTypeAny, {
type: "tool_use";
name: string;
id: string;
input: Record<string, any>;
}, {
type: "tool_use";
name: string;
id: string;
input: Record<string, any>;
}>, z.ZodObject<{
type: z.ZodLiteral<"thinking">;
thinking: z.ZodString;
signature: z.ZodString;
}, "strip", z.ZodTypeAny, {
type: "thinking";
thinking: string;
signature: string;
}, {
type: "thinking";
thinking: string;
signature: string;
}>, z.ZodObject<{
type: z.ZodLiteral<"redacted_thinking">;
data: z.ZodString;
}, "strip", z.ZodTypeAny, {
type: "redacted_thinking";
data: string;
}, {
type: "redacted_thinking";
data: string;
}>]>, "many">;
id: z.ZodString;
model: z.ZodString;
role: z.ZodString;
stop_reason: z.ZodString;
stop_sequence: z.ZodNull;
type: z.ZodLiteral<"message">;
usage: z.ZodObject<{
input_tokens: z.ZodNumber;
output_tokens: z.ZodNumber;
cache_creation_input_tokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
cache_read_input_tokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
}, "strip", z.ZodTypeAny, {
input_tokens: number;
output_tokens: number;
cache_creation_input_tokens?: number | null | undefined;
cache_read_input_tokens?: number | null | undefined;
}, {
input_tokens: number;
output_tokens: number;
cache_creation_input_tokens?: number | null | undefined;
cache_read_input_tokens?: number | null | undefined;
}>;
}, "strip", z.ZodTypeAny, {
type: "message";
role: string;
content: ({
type: "text";
text: string;
} | {
type: "tool_use";
name: string;
id: string;
input: Record<string, any>;
} | {
type: "thinking";
thinking: string;
signature: string;
} | {
type: "redacted_thinking";
data: string;
})[];
id: string;
model: string;
stop_reason: string;
stop_sequence: null;
usage: {
input_tokens: number;
output_tokens: number;
cache_creation_input_tokens?: number | null | undefined;
cache_read_input_tokens?: number | null | undefined;
};
}, {
type: "message";
role: string;
content: ({
type: "text";
text: string;
} | {
type: "tool_use";
name: string;
id: string;
input: Record<string, any>;
} | {
type: "thinking";
thinking: string;
signature: string;
} | {
type: "redacted_thinking";
data: string;
})[];
id: string;
model: string;
stop_reason: string;
stop_sequence: null;
usage: {
input_tokens: number;
output_tokens: number;
cache_creation_input_tokens?: number | null | undefined;
cache_read_input_tokens?: number | null | undefined;
};
}>;
type AnthropicCompleteChatResponseType = z.infer<typeof AnthropicCompleteChatResponse>;
declare const AnthropicStreamChatMessageStartResponse: z.ZodObject<{
type: z.ZodLiteral<"message_start">;
message: z.ZodObject<{
id: z.ZodString;
type: z.ZodLiteral<"message">;
role: z.ZodString;
model: z.ZodString;
stop_reason: z.ZodNullable<z.ZodString>;
stop_sequence: z.ZodNullable<z.ZodString>;
content: z.ZodArray<z.ZodAny, "many">;
usage: z.ZodObject<{
input_tokens: z.ZodNumber;
output_tokens: z.ZodNumber;
}, "strip", z.ZodTypeAn