@vertana/core 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 +95 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
@vertana/core
|
|
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
|
+
Core translation logic and utilities for [Vertana]. Contains chunking,
|
|
13
|
+
context gathering, evaluation, refinement, selection, and translation
|
|
14
|
+
orchestration.
|
|
15
|
+
|
|
16
|
+
> [!TIP]
|
|
17
|
+
> *Building an application?* Consider *@vertana/facade* for a simpler API.
|
|
18
|
+
> This core package is for when you need fine-grained control over the
|
|
19
|
+
> translation pipeline.
|
|
20
|
+
|
|
21
|
+
[JSR]: https://jsr.io/@vertana/core
|
|
22
|
+
[JSR badge]: https://jsr.io/badges/@vertana/core
|
|
23
|
+
[npm]: https://www.npmjs.com/package/@vertana/core
|
|
24
|
+
[npm badge]: https://img.shields.io/npm/v/@vertana/core?logo=npm
|
|
25
|
+
[Vertana]: https://vertana.org/
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
When to use @vertana/core
|
|
29
|
+
-------------------------
|
|
30
|
+
|
|
31
|
+
Use *@vertana/core* when:
|
|
32
|
+
|
|
33
|
+
- Building custom translation workflows
|
|
34
|
+
- Need fine-grained control over each translation stage
|
|
35
|
+
- Implementing custom chunking strategies
|
|
36
|
+
- Working with streaming translation events
|
|
37
|
+
|
|
38
|
+
Use *@vertana/facade* when:
|
|
39
|
+
|
|
40
|
+
- Want a simple async/await API
|
|
41
|
+
- Standard translation with sensible defaults
|
|
42
|
+
- Progress reporting with callbacks
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
Installation
|
|
46
|
+
------------
|
|
47
|
+
|
|
48
|
+
~~~~ bash
|
|
49
|
+
deno add jsr:@vertana/core
|
|
50
|
+
npm add @vertana/core
|
|
51
|
+
pnpm add @vertana/core
|
|
52
|
+
~~~~
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
Quick example
|
|
56
|
+
-------------
|
|
57
|
+
|
|
58
|
+
~~~~ typescript
|
|
59
|
+
import { translateChunks, chunkText } from "@vertana/core";
|
|
60
|
+
import { openai } from "@ai-sdk/openai";
|
|
61
|
+
|
|
62
|
+
const chunks = await chunkText("Your long document here...", {
|
|
63
|
+
mediaType: "text/markdown",
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
for await (const event of translateChunks(chunks, {
|
|
67
|
+
models: [openai("gpt-4o")],
|
|
68
|
+
targetLanguage: "ko",
|
|
69
|
+
})) {
|
|
70
|
+
if (event.type === "chunk") {
|
|
71
|
+
console.log(event.translation);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
~~~~
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
Key modules
|
|
78
|
+
-----------
|
|
79
|
+
|
|
80
|
+
- *Chunking*: `@vertana/core/chunking` — Text splitting with media type
|
|
81
|
+
awareness (plain text, Markdown, HTML)
|
|
82
|
+
- *Context*: `@vertana/core/context` — Required and passive context sources
|
|
83
|
+
for agentic workflows
|
|
84
|
+
- *Evaluation*: `@vertana/core/evaluation` — Quality scoring across
|
|
85
|
+
accuracy, fluency, terminology, style
|
|
86
|
+
- *Refinement*: `@vertana/core/refine` — Iterative improvement with
|
|
87
|
+
boundary coherence
|
|
88
|
+
- *Selection*: `@vertana/core/select` — Best-of-N evaluation with
|
|
89
|
+
multiple models
|
|
90
|
+
- *Glossary*: `@vertana/core/glossary` — Dynamic term accumulation
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
For more resources, see the [docs].
|
|
94
|
+
|
|
95
|
+
[docs]: https://vertana.org/
|