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.
29 lines (28 loc) • 821 B
TypeScript
import type { ChatParams, Model } from "./types";
import type Chats from "./interfaces/chats";
import type Engine from "./enums/engine";
import type RateLimiter from "./rate_limiter";
type PoolOptions = {
engine: Engine;
model: Model;
rateLimiter: RateLimiter;
apiKey?: string;
host?: string;
chatParams?: ChatParams;
concurrency: number;
};
export default class ChatPool {
readonly rateLimiter: RateLimiter;
private available;
private waiters;
private readonly slots;
private constructor();
static create(options: PoolOptions): ChatPool;
get size(): number;
/** Returns every triple, in order. Used for per-worker sharding. */
all(): Chats[];
run<T>(fn: (chats: Chats) => Promise<T>): Promise<T>;
private acquire;
private release;
}
export {};