aiwrapper
Version:
A Universal AI Wrapper for JavaScript & TypeScript
31 lines (30 loc) • 1.08 kB
TypeScript
import { LangMessage, LangOptions, LanguageProvider } from "../language-provider.ts";
import { LangMessages } from "../messages.ts";
export type AnthropicLangOptions = {
apiKey: string;
model?: string;
systemPrompt?: string;
maxTokens?: number;
extendedThinking?: boolean;
};
export type AnthropicLangConfig = {
apiKey: string;
model: string;
systemPrompt?: string;
maxTokens?: number;
extendedThinking?: boolean;
};
export declare class AnthropicLang extends LanguageProvider {
_config: AnthropicLangConfig;
constructor(options: AnthropicLangOptions);
ask(prompt: string, options?: LangOptions): Promise<LangMessages>;
chat(messages: LangMessage[] | LangMessages, options?: LangOptions): Promise<LangMessages>;
private prepareRequest;
protected transformMessagesForProvider(messages: LangMessages): any[];
private mapUserMessageItems;
private mapAssistantMessageItems;
private mapToolResultItems;
private appendImageBlocks;
private mapImageItemToAnthropicImageBlock;
private getVisionHintText;
}