@vertana/facade 0.1.0-dev.5 → 0.1.0-dev.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +78 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
@vertana/facade
|
|
2
|
+
===============
|
|
3
|
+
|
|
4
|
+
[![JSR][JSR badge]][JSR]
|
|
5
|
+
[![npm][npm badge]][npm]
|
|
6
|
+
|
|
7
|
+
> [!CAUTION]
|
|
8
|
+
> Vertana is currently in early development for proof of concept purposes,
|
|
9
|
+
> and is not yet ready for production use. The API is subject to change,
|
|
10
|
+
> and there may be bugs or missing features.
|
|
11
|
+
|
|
12
|
+
High-level facade for [Vertana] providing a simple `translate()` function
|
|
13
|
+
with sensible defaults. This is the recommended starting point for most
|
|
14
|
+
applications.
|
|
15
|
+
|
|
16
|
+
[JSR]: https://jsr.io/@vertana/facade
|
|
17
|
+
[JSR badge]: https://jsr.io/badges/@vertana/facade
|
|
18
|
+
[npm]: https://www.npmjs.com/package/@vertana/facade
|
|
19
|
+
[npm badge]: https://img.shields.io/npm/v/@vertana/facade?logo=npm
|
|
20
|
+
[Vertana]: https://vertana.org/
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
Installation
|
|
24
|
+
------------
|
|
25
|
+
|
|
26
|
+
~~~~ bash
|
|
27
|
+
deno add jsr:@vertana/facade
|
|
28
|
+
npm add @vertana/facade
|
|
29
|
+
pnpm add @vertana/facade
|
|
30
|
+
~~~~
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
Quick example
|
|
34
|
+
-------------
|
|
35
|
+
|
|
36
|
+
~~~~ typescript
|
|
37
|
+
import { translate } from "@vertana/facade";
|
|
38
|
+
import { openai } from "@ai-sdk/openai";
|
|
39
|
+
|
|
40
|
+
const result = await translate(
|
|
41
|
+
openai("gpt-4o"),
|
|
42
|
+
"ko",
|
|
43
|
+
"Hello, world!"
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
console.log(result.text);
|
|
47
|
+
~~~~
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
Features
|
|
51
|
+
--------
|
|
52
|
+
|
|
53
|
+
- *Single function API*: `translate()` handles the entire pipeline
|
|
54
|
+
- *Progress reporting*: Track chunking, translation, refinement stages
|
|
55
|
+
- *Flexible options*: Tone, domain, glossary, context sources
|
|
56
|
+
- *Quality features*: Refinement and best-of-N selection
|
|
57
|
+
- *Cancellation*: AbortSignal support
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
Options
|
|
61
|
+
-------
|
|
62
|
+
|
|
63
|
+
The `translate()` function accepts an optional `TranslateOptions` object:
|
|
64
|
+
|
|
65
|
+
- `mediaType`: Input format (`"text/plain"`, `"text/markdown"`, `"text/html"`)
|
|
66
|
+
- `tone`: Style preference (formal, informal, technical, etc.)
|
|
67
|
+
- `domain`: Subject area for terminology
|
|
68
|
+
- `glossary`: Pre-defined terminology mappings
|
|
69
|
+
- `contextSources`: External context providers
|
|
70
|
+
- `refinement`: Enable iterative quality improvement
|
|
71
|
+
- `bestOfN`: Multi-model selection for best translation
|
|
72
|
+
- `onProgress`: Callback for progress updates
|
|
73
|
+
- `signal`: AbortSignal for cancellation
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
For more resources, see the [docs].
|
|
77
|
+
|
|
78
|
+
[docs]: https://vertana.org/
|