UNPKG

i18n-ai-translate

Version:

Use LLMs to translate your i18n JSON to any language.

19 lines (18 loc) 825 B
import ChatInterface from "./chat_interface"; import type { Anthropic as InternalAnthropic } from "@anthropic-ai/sdk"; import type { MessageCreateParams, MessageParam } from "@anthropic-ai/sdk/resources"; import type { ZodType, ZodTypeDef } from "zod"; import type RateLimiter from "../rate_limiter"; export default class Anthropic extends ChatInterface { model: InternalAnthropic; chatParams: MessageCreateParams | null; history: MessageParam[]; rateLimiter: RateLimiter; constructor(model: InternalAnthropic, rateLimiter: RateLimiter); startChat(params: MessageCreateParams): void; sendMessage(message: string, _format?: ZodType<any, ZodTypeDef, any>): Promise<string>; resetChatHistory(): void; rollbackLastMessage(): void; invalidTranslation(): void; invalidStyling(): void; }