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.

24 lines (23 loc) 881 B
import ChatInterface, { type InvalidKind } 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; signalInvalid(kind: InvalidKind): void; } export {};