UNPKG

i18n-ai-translate

Version:

Use LLMs to translate your i18n JSON to any language.

37 lines 2.58 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.CLI_HELP = exports.RETRY_ATTEMPTS = exports.DEFAULT_MODEL = exports.FLATTEN_DELIMITER = exports.DEFAULT_TEMPLATED_STRING_SUFFIX = exports.DEFAULT_TEMPLATED_STRING_PREFIX = exports.VERSION = exports.DEFAULT_REQUEST_TOKENS = exports.DEFAULT_BATCH_SIZE = void 0; const override_prompt_1 = require("./interfaces/override_prompt"); const engine_1 = __importDefault(require("./enums/engine")); exports.DEFAULT_BATCH_SIZE = 32; exports.DEFAULT_REQUEST_TOKENS = 4096; exports.VERSION = "4.1.2"; exports.DEFAULT_TEMPLATED_STRING_PREFIX = "{{"; exports.DEFAULT_TEMPLATED_STRING_SUFFIX = "}}"; exports.FLATTEN_DELIMITER = "*"; exports.DEFAULT_MODEL = { [engine_1.default.ChatGPT]: "gpt-4o", [engine_1.default.Gemini]: "gemini-2.5-flash", [engine_1.default.Ollama]: "llama3.3", [engine_1.default.Claude]: "claude-opus-4-0", }; exports.RETRY_ATTEMPTS = 25; exports.CLI_HELP = { BatchSize: "How many keys to process at a time, 32 by default for chatgpt, 16 otherwise", DryRun: "Show the translations without writing to files, and store them in a temporary directory", Engine: "Engine to use (chatgpt, gemini, ollama, or claude)", EnsureChangedTranslation: "Each generated translation key must differ from the input (for keys longer than 4)", MaxTokens: "The maximum token size of a request", Model: `Model to use (e.g. ${Object.values(exports.DEFAULT_MODEL).join(", ")})`, OllamaHost: "The host and port number serving Ollama. 11434 is the default port number.", OverridePromptFile: `Use the prompts from the given JSON file, containing keys for at least one of ${override_prompt_1.OVERRIDE_PROMPT_KEYS.join(", ")}`, PromptMode: "Chose the prompting mode, between 'csv' mode (better performance but will only work with advanced models like GPT-4o) or 'json' mode (compatible with less advanced models, like llama3.1:8b, but translations take 50% longer on average)", RateLimit: "How many milliseconds between requests (defaults to 1s for Gemini, 120ms (at 500RPM) for ChatGPT, 1200ms for Claude)", SkipStylingVerification: "Skip validating the resulting translation's formatting through another query, only for 'csv' mode", SkipTranslationVerification: "Skip validating the resulting translation through another query", Verbose: "Print logs about progress", }; //# sourceMappingURL=constants.js.map