@vertana/facade
v0.1.1
Published
An LLM-powered natural language translation facade library
Downloads
208
Maintainers
Readme
@vertana/facade
[!CAUTION] Vertana is currently in early development for proof of concept purposes, and is not yet ready for production use. The API is subject to change, and there may be bugs or missing features.
High-level facade for Vertana providing a simple translate() function
with sensible defaults. This is the recommended starting point for most
applications.
Installation
deno add jsr:@vertana/facade
npm add @vertana/facade
pnpm add @vertana/facadeQuick example
import { translate } from "@vertana/facade";
import { openai } from "@ai-sdk/openai";
const result = await translate(
openai("gpt-4o"),
"ko",
"Hello, world!"
);
console.log(result.text);Features
- Single function API:
translate()handles the entire pipeline - Progress reporting: Track chunking, translation, refinement stages
- Flexible options: Tone, domain, glossary, context sources
- Quality features: Refinement and best-of-N selection
- Cancellation: AbortSignal support
Options
The translate() function accepts an optional TranslateOptions object:
mediaType: Input format ("text/plain","text/markdown","text/html")tone: Style preference (formal, informal, technical, etc.)domain: Subject area for terminologyglossary: Pre-defined terminology mappingscontextSources: External context providersrefinement: Enable iterative quality improvementbestOfN: Multi-model selection for best translationonProgress: Callback for progress updatessignal: AbortSignal for cancellation
For more resources, see the docs.
