speechflow 2.0.3 → 2.0.4
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/CHANGELOG.md +8 -0
- package/README.md +9 -9
- package/package.json +3 -3
- package/speechflow-cli/dst/speechflow-node-a2t-amazon.d.ts +1 -0
- package/speechflow-cli/dst/speechflow-node-a2t-amazon.js +19 -11
- package/speechflow-cli/dst/speechflow-node-a2t-amazon.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-a2t-openai.js +7 -6
- package/speechflow-cli/dst/speechflow-node-a2t-openai.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-t2a-amazon.js +2 -4
- package/speechflow-cli/dst/speechflow-node-t2a-amazon.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-t2a-elevenlabs.js +3 -3
- package/speechflow-cli/dst/speechflow-node-t2a-elevenlabs.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-t2a-google.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-t2a-supertonic.js +1 -1
- package/speechflow-cli/dst/speechflow-node-t2a-supertonic.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-t2t-amazon.js +9 -8
- package/speechflow-cli/dst/speechflow-node-t2t-amazon.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-t2t-deepl.js +2 -2
- package/speechflow-cli/dst/speechflow-node-t2t-deepl.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-t2t-opus.js +5 -5
- package/speechflow-cli/dst/speechflow-node-t2t-opus.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-t2t-punctuation.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-t2t-spellcheck.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-t2t-summary.js.map +1 -1
- package/speechflow-cli/dst/speechflow-node-t2t-translate.js +50 -25
- package/speechflow-cli/dst/speechflow-node-t2t-translate.js.map +1 -1
- package/speechflow-cli/etc/oxlint.jsonc +8 -1
- package/speechflow-cli/etc/stx.conf +1 -1
- package/speechflow-cli/package.json +15 -14
- package/speechflow-cli/src/speechflow-node-a2t-amazon.ts +21 -12
- package/speechflow-cli/src/speechflow-node-a2t-openai.ts +9 -8
- package/speechflow-cli/src/speechflow-node-t2a-amazon.ts +2 -4
- package/speechflow-cli/src/speechflow-node-t2a-elevenlabs.ts +3 -3
- package/speechflow-cli/src/speechflow-node-t2a-google.ts +2 -2
- package/speechflow-cli/src/speechflow-node-t2a-supertonic.ts +1 -1
- package/speechflow-cli/src/speechflow-node-t2t-amazon.ts +11 -10
- package/speechflow-cli/src/speechflow-node-t2t-deepl.ts +2 -2
- package/speechflow-cli/src/speechflow-node-t2t-opus.ts +6 -6
- package/speechflow-cli/src/speechflow-node-t2t-punctuation.ts +1 -1
- package/speechflow-cli/src/speechflow-node-t2t-spellcheck.ts +1 -1
- package/speechflow-cli/src/speechflow-node-t2t-summary.ts +1 -1
- package/speechflow-cli/src/speechflow-node-t2t-translate.ts +54 -29
- package/speechflow-ui-db/package.json +10 -10
- package/speechflow-ui-st/package.json +10 -10
|
@@ -121,17 +121,17 @@ export default class SpeechFlowNodeT2TOPUS extends SpeechFlowNode {
|
|
|
121
121
|
|
|
122
122
|
/* close node */
|
|
123
123
|
async close () {
|
|
124
|
-
/* shutdown Transformers */
|
|
125
|
-
if (this.translator !== null) {
|
|
126
|
-
this.translator.dispose()
|
|
127
|
-
this.translator = null
|
|
128
|
-
}
|
|
129
|
-
|
|
130
124
|
/* shutdown stream */
|
|
131
125
|
if (this.stream !== null) {
|
|
132
126
|
await util.destroyStream(this.stream)
|
|
133
127
|
this.stream = null
|
|
134
128
|
}
|
|
129
|
+
|
|
130
|
+
/* shutdown Transformers */
|
|
131
|
+
if (this.translator !== null) {
|
|
132
|
+
this.translator.dispose()
|
|
133
|
+
this.translator = null
|
|
134
|
+
}
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
|
|
@@ -141,7 +141,7 @@ export default class SpeechFlowNodeT2TPunctuation extends SpeechFlowNode {
|
|
|
141
141
|
await this.llm.open()
|
|
142
142
|
|
|
143
143
|
/* provide text-to-text punctuation restoration */
|
|
144
|
-
const llm = this.llm
|
|
144
|
+
const llm = this.llm
|
|
145
145
|
const punctuate = async (text: string) => {
|
|
146
146
|
const cfg = this.setup[this.params.lang]
|
|
147
147
|
if (!cfg)
|
|
@@ -128,7 +128,7 @@ export default class SpeechFlowNodeT2TSpellcheck extends SpeechFlowNode {
|
|
|
128
128
|
await this.llm.open()
|
|
129
129
|
|
|
130
130
|
/* provide text-to-text spellchecking */
|
|
131
|
-
const llm = this.llm
|
|
131
|
+
const llm = this.llm
|
|
132
132
|
const spellcheck = async (text: string) => {
|
|
133
133
|
const cfg = this.setup[this.params.lang]
|
|
134
134
|
if (!cfg)
|
|
@@ -127,7 +127,7 @@ export default class SpeechFlowNodeT2TSummary extends SpeechFlowNode {
|
|
|
127
127
|
await this.llm.open()
|
|
128
128
|
|
|
129
129
|
/* provide text summarization */
|
|
130
|
-
const llm = this.llm
|
|
130
|
+
const llm = this.llm
|
|
131
131
|
const summarize = async (text: string) => {
|
|
132
132
|
const cfg = this.setup[this.params.lang]
|
|
133
133
|
if (!cfg)
|
|
@@ -13,7 +13,7 @@ import * as util from "./speechflow-util"
|
|
|
13
13
|
import { LLM, type LLMCompleteMessage } from "./speechflow-util-llm"
|
|
14
14
|
|
|
15
15
|
/* internal utility types */
|
|
16
|
-
type ConfigEntry = { systemPrompt: string, chat: LLMCompleteMessage[] }
|
|
16
|
+
type ConfigEntry = { systemPrompt: { [ type: string ]: string }, chat: LLMCompleteMessage[] }
|
|
17
17
|
type Config = { [ key: string ]: ConfigEntry }
|
|
18
18
|
|
|
19
19
|
/* SpeechFlow node for LLM-based text-to-text translation */
|
|
@@ -28,19 +28,30 @@ export default class SpeechFlowNodeT2TTranslate extends SpeechFlowNode {
|
|
|
28
28
|
private setup: Config = {
|
|
29
29
|
/* English (EN) to German (DE) translation */
|
|
30
30
|
"en-de": {
|
|
31
|
-
systemPrompt:
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
systemPrompt: {
|
|
32
|
+
"any":
|
|
33
|
+
"You are a translator.\n" +
|
|
34
|
+
"Output only the requested text.\n" +
|
|
35
|
+
"Do not use markdown.\n" +
|
|
36
|
+
"Do not chat.\n" +
|
|
37
|
+
"Do not show any explanations.\n" +
|
|
38
|
+
"Do not show any introduction.\n" +
|
|
39
|
+
"Do not show any preamble.\n" +
|
|
40
|
+
"Do not show any prolog.\n" +
|
|
41
|
+
"Do not show any epilog.\n" +
|
|
42
|
+
"Get to the point.\n" +
|
|
43
|
+
"Preserve the original meaning, tone, and nuance.\n" +
|
|
44
|
+
"Directly translate text from English (EN) to fluent and natural German (DE) language.\n",
|
|
45
|
+
"translategemma":
|
|
46
|
+
/* ATTENTION: do not change this prompt, as TranslateGemma requires this fixed format! */
|
|
47
|
+
"You are a professional English (en) to German (de) translator. " +
|
|
48
|
+
"Your goal is to accurately convey the meaning and nuances of the original " +
|
|
49
|
+
"English text while adhering to German grammar, vocabulary, and cultural sensitivities. " +
|
|
50
|
+
"Produce only the German translation, without any additional explanations or commentary. " +
|
|
51
|
+
"Please translate the following English text into German:\n" +
|
|
52
|
+
"\n" +
|
|
53
|
+
"\n"
|
|
54
|
+
},
|
|
44
55
|
chat: [
|
|
45
56
|
{ role: "user", content: "I love my wife." },
|
|
46
57
|
{ role: "assistant", content: "Ich liebe meine Frau." },
|
|
@@ -53,19 +64,30 @@ export default class SpeechFlowNodeT2TTranslate extends SpeechFlowNode {
|
|
|
53
64
|
|
|
54
65
|
/* German (DE) to English (EN) translation */
|
|
55
66
|
"de-en": {
|
|
56
|
-
systemPrompt:
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
systemPrompt: {
|
|
68
|
+
"any":
|
|
69
|
+
"You are a translator.\n" +
|
|
70
|
+
"Output only the requested text.\n" +
|
|
71
|
+
"Do not use markdown.\n" +
|
|
72
|
+
"Do not chat.\n" +
|
|
73
|
+
"Do not show any explanations.\n" +
|
|
74
|
+
"Do not show any introduction.\n" +
|
|
75
|
+
"Do not show any preamble.\n" +
|
|
76
|
+
"Do not show any prolog.\n" +
|
|
77
|
+
"Do not show any epilog.\n" +
|
|
78
|
+
"Get to the point.\n" +
|
|
79
|
+
"Preserve the original meaning, tone, and nuance.\n" +
|
|
80
|
+
"Directly translate text from German (DE) to fluent and natural English (EN) language.\n",
|
|
81
|
+
"translategemma":
|
|
82
|
+
/* ATTENTION: do not change this prompt, as TranslateGemma requires this fixed format! */
|
|
83
|
+
"You are a professional German (de) to English (en) translator. " +
|
|
84
|
+
"Your goal is to accurately convey the meaning and nuances of the original " +
|
|
85
|
+
"German text while adhering to English grammar, vocabulary, and cultural sensitivities. " +
|
|
86
|
+
"Produce only the English translation, without any additional explanations or commentary. " +
|
|
87
|
+
"Please translate the following German text into English:\n" +
|
|
88
|
+
"\n" +
|
|
89
|
+
"\n"
|
|
90
|
+
},
|
|
69
91
|
chat: [
|
|
70
92
|
{ role: "user", content: "Ich liebe meine Frau." },
|
|
71
93
|
{ role: "assistant", content: "I love my wife." },
|
|
@@ -120,14 +142,17 @@ export default class SpeechFlowNodeT2TTranslate extends SpeechFlowNode {
|
|
|
120
142
|
await this.llm.open()
|
|
121
143
|
|
|
122
144
|
/* provide text-to-text translation */
|
|
123
|
-
const llm = this.llm
|
|
145
|
+
const llm = this.llm
|
|
124
146
|
const translate = async (text: string) => {
|
|
125
147
|
const key = `${this.params.src}-${this.params.dst}`
|
|
126
148
|
const cfg = this.setup[key]
|
|
127
149
|
if (!cfg)
|
|
128
150
|
throw new Error(`unsupported language pair: ${key}`)
|
|
151
|
+
let systemPrompt = cfg.systemPrompt["any"]
|
|
152
|
+
if (this.params.model.match(/^translategemma/))
|
|
153
|
+
systemPrompt = cfg.systemPrompt["translategemma"]
|
|
129
154
|
return llm.complete({
|
|
130
|
-
system:
|
|
155
|
+
system: systemPrompt,
|
|
131
156
|
messages: cfg.chat,
|
|
132
157
|
prompt: text
|
|
133
158
|
})
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
"@rse/stx": "1.1.4"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"vite": "7.3.
|
|
28
|
-
"typescript-eslint": "8.
|
|
29
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
30
|
-
"@typescript-eslint/parser": "8.
|
|
27
|
+
"vite": "7.3.1",
|
|
28
|
+
"typescript-eslint": "8.53.0",
|
|
29
|
+
"@typescript-eslint/eslint-plugin": "8.53.0",
|
|
30
|
+
"@typescript-eslint/parser": "8.53.0",
|
|
31
31
|
"@vitejs/plugin-vue": "6.0.3",
|
|
32
32
|
"@rollup/plugin-yaml": "4.1.2",
|
|
33
|
-
"vite-plugin-node-polyfills": "0.
|
|
33
|
+
"vite-plugin-node-polyfills": "0.25.0",
|
|
34
34
|
"vite-svg-loader": "5.1.0",
|
|
35
35
|
"@liuli-util/vite-plugin-node": "0.10.0",
|
|
36
36
|
"mkdirp": "3.0.1",
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
"@eslint/js": "9.39.2",
|
|
42
42
|
"neostandard": "0.12.2",
|
|
43
43
|
"eslint-plugin-import": "2.32.0",
|
|
44
|
-
"eslint-plugin-vue": "10.
|
|
44
|
+
"eslint-plugin-vue": "10.7.0",
|
|
45
45
|
|
|
46
|
-
"oxlint": "1.
|
|
47
|
-
"eslint-plugin-oxlint": "1.
|
|
46
|
+
"oxlint": "1.39.0",
|
|
47
|
+
"eslint-plugin-oxlint": "1.39.0",
|
|
48
48
|
|
|
49
49
|
"htmllint": "0.8.0",
|
|
50
50
|
"htmllint-cli": "0.0.7",
|
|
@@ -58,10 +58,10 @@
|
|
|
58
58
|
"stylelint-config-standard": "39.0.1",
|
|
59
59
|
"stylelint-config-standard-vue": "1.0.0",
|
|
60
60
|
"stylelint-stylus": "1.0.0",
|
|
61
|
-
"postcss-html": "1.8.
|
|
61
|
+
"postcss-html": "1.8.1",
|
|
62
62
|
"stylus": "0.64.0",
|
|
63
63
|
"typescript": "5.9.3",
|
|
64
|
-
"vue-tsc": "3.2.
|
|
64
|
+
"vue-tsc": "3.2.2",
|
|
65
65
|
"delay-cli": "3.0.0",
|
|
66
66
|
"cross-env": "10.1.0",
|
|
67
67
|
"serve": "14.2.5",
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"animejs": "4.2.2"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"vite": "7.3.
|
|
30
|
-
"typescript-eslint": "8.
|
|
31
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
32
|
-
"@typescript-eslint/parser": "8.
|
|
29
|
+
"vite": "7.3.1",
|
|
30
|
+
"typescript-eslint": "8.53.0",
|
|
31
|
+
"@typescript-eslint/eslint-plugin": "8.53.0",
|
|
32
|
+
"@typescript-eslint/parser": "8.53.0",
|
|
33
33
|
"@vitejs/plugin-vue": "6.0.3",
|
|
34
34
|
"@rollup/plugin-yaml": "4.1.2",
|
|
35
|
-
"vite-plugin-node-polyfills": "0.
|
|
35
|
+
"vite-plugin-node-polyfills": "0.25.0",
|
|
36
36
|
"vite-svg-loader": "5.1.0",
|
|
37
37
|
"@liuli-util/vite-plugin-node": "0.10.0",
|
|
38
38
|
"mkdirp": "3.0.1",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"@eslint/js": "9.39.2",
|
|
44
44
|
"neostandard": "0.12.2",
|
|
45
45
|
"eslint-plugin-import": "2.32.0",
|
|
46
|
-
"eslint-plugin-vue": "10.
|
|
46
|
+
"eslint-plugin-vue": "10.7.0",
|
|
47
47
|
|
|
48
|
-
"oxlint": "1.
|
|
49
|
-
"eslint-plugin-oxlint": "1.
|
|
48
|
+
"oxlint": "1.39.0",
|
|
49
|
+
"eslint-plugin-oxlint": "1.39.0",
|
|
50
50
|
|
|
51
51
|
"htmllint": "0.8.0",
|
|
52
52
|
"htmllint-cli": "0.0.7",
|
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
"stylelint-config-standard": "39.0.1",
|
|
61
61
|
"stylelint-config-standard-vue": "1.0.0",
|
|
62
62
|
"stylelint-stylus": "1.0.0",
|
|
63
|
-
"postcss-html": "1.8.
|
|
63
|
+
"postcss-html": "1.8.1",
|
|
64
64
|
"stylus": "0.64.0",
|
|
65
65
|
"typescript": "5.9.3",
|
|
66
|
-
"vue-tsc": "3.2.
|
|
66
|
+
"vue-tsc": "3.2.2",
|
|
67
67
|
"delay-cli": "3.0.0",
|
|
68
68
|
"cross-env": "10.1.0",
|
|
69
69
|
"serve": "14.2.5",
|