UNPKG

i18n-ai-translate

Version:

AI-powered localization CLI, Node library, and GitHub Action. Translate i18next JSON, Gettext PO, Java .properties, and iOS .strings with ChatGPT, Claude, Gemini, or local Ollama models.

25 lines (24 loc) 875 B
import ChatInterface from "./chat_interface"; import Role from "../enums/role"; import type { ChatSession, GenerativeModel, StartChatParams } from "@google/generative-ai"; import type { ZodType, ZodTypeDef } from "zod"; import type RateLimiter from "../rate_limiter"; interface HistoryEntry { role: Role; parts: string; } export default class Gemini extends ChatInterface { model: GenerativeModel; chat: ChatSession | null; history: HistoryEntry[]; params: StartChatParams | null; rateLimiter: RateLimiter; constructor(model: GenerativeModel, rateLimiter: RateLimiter); startChat(params: StartChatParams): void; sendMessage(message: string, format?: ZodType<any, ZodTypeDef, any>): Promise<string>; resetChatHistory(): void; rollbackLastMessage(): void; invalidTranslation(): void; invalidStyling(): void; } export {};