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.
Files changed (44) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +9 -9
  3. package/package.json +3 -3
  4. package/speechflow-cli/dst/speechflow-node-a2t-amazon.d.ts +1 -0
  5. package/speechflow-cli/dst/speechflow-node-a2t-amazon.js +19 -11
  6. package/speechflow-cli/dst/speechflow-node-a2t-amazon.js.map +1 -1
  7. package/speechflow-cli/dst/speechflow-node-a2t-openai.js +7 -6
  8. package/speechflow-cli/dst/speechflow-node-a2t-openai.js.map +1 -1
  9. package/speechflow-cli/dst/speechflow-node-t2a-amazon.js +2 -4
  10. package/speechflow-cli/dst/speechflow-node-t2a-amazon.js.map +1 -1
  11. package/speechflow-cli/dst/speechflow-node-t2a-elevenlabs.js +3 -3
  12. package/speechflow-cli/dst/speechflow-node-t2a-elevenlabs.js.map +1 -1
  13. package/speechflow-cli/dst/speechflow-node-t2a-google.js.map +1 -1
  14. package/speechflow-cli/dst/speechflow-node-t2a-supertonic.js +1 -1
  15. package/speechflow-cli/dst/speechflow-node-t2a-supertonic.js.map +1 -1
  16. package/speechflow-cli/dst/speechflow-node-t2t-amazon.js +9 -8
  17. package/speechflow-cli/dst/speechflow-node-t2t-amazon.js.map +1 -1
  18. package/speechflow-cli/dst/speechflow-node-t2t-deepl.js +2 -2
  19. package/speechflow-cli/dst/speechflow-node-t2t-deepl.js.map +1 -1
  20. package/speechflow-cli/dst/speechflow-node-t2t-opus.js +5 -5
  21. package/speechflow-cli/dst/speechflow-node-t2t-opus.js.map +1 -1
  22. package/speechflow-cli/dst/speechflow-node-t2t-punctuation.js.map +1 -1
  23. package/speechflow-cli/dst/speechflow-node-t2t-spellcheck.js.map +1 -1
  24. package/speechflow-cli/dst/speechflow-node-t2t-summary.js.map +1 -1
  25. package/speechflow-cli/dst/speechflow-node-t2t-translate.js +50 -25
  26. package/speechflow-cli/dst/speechflow-node-t2t-translate.js.map +1 -1
  27. package/speechflow-cli/etc/oxlint.jsonc +8 -1
  28. package/speechflow-cli/etc/stx.conf +1 -1
  29. package/speechflow-cli/package.json +15 -14
  30. package/speechflow-cli/src/speechflow-node-a2t-amazon.ts +21 -12
  31. package/speechflow-cli/src/speechflow-node-a2t-openai.ts +9 -8
  32. package/speechflow-cli/src/speechflow-node-t2a-amazon.ts +2 -4
  33. package/speechflow-cli/src/speechflow-node-t2a-elevenlabs.ts +3 -3
  34. package/speechflow-cli/src/speechflow-node-t2a-google.ts +2 -2
  35. package/speechflow-cli/src/speechflow-node-t2a-supertonic.ts +1 -1
  36. package/speechflow-cli/src/speechflow-node-t2t-amazon.ts +11 -10
  37. package/speechflow-cli/src/speechflow-node-t2t-deepl.ts +2 -2
  38. package/speechflow-cli/src/speechflow-node-t2t-opus.ts +6 -6
  39. package/speechflow-cli/src/speechflow-node-t2t-punctuation.ts +1 -1
  40. package/speechflow-cli/src/speechflow-node-t2t-spellcheck.ts +1 -1
  41. package/speechflow-cli/src/speechflow-node-t2t-summary.ts +1 -1
  42. package/speechflow-cli/src/speechflow-node-t2t-translate.ts +54 -29
  43. package/speechflow-ui-db/package.json +10 -10
  44. 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
- "You are a translator.\n" +
33
- "Output only the requested text.\n" +
34
- "Do not use markdown.\n" +
35
- "Do not chat.\n" +
36
- "Do not show any explanations.\n" +
37
- "Do not show any introduction.\n" +
38
- "Do not show any preamble.\n" +
39
- "Do not show any prolog.\n" +
40
- "Do not show any epilog.\n" +
41
- "Get to the point.\n" +
42
- "Preserve the original meaning, tone, and nuance.\n" +
43
- "Directly translate text from English (EN) to fluent and natural German (DE) language.\n",
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
- "You are a translator.\n" +
58
- "Output only the requested text.\n" +
59
- "Do not use markdown.\n" +
60
- "Do not chat.\n" +
61
- "Do not show any explanations.\n" +
62
- "Do not show any introduction.\n" +
63
- "Do not show any preamble.\n" +
64
- "Do not show any prolog.\n" +
65
- "Do not show any epilog.\n" +
66
- "Get to the point.\n" +
67
- "Preserve the original meaning, tone, and nuance.\n" +
68
- "Directly translate text from German (DE) to fluent and natural English (EN) language.\n",
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: cfg.systemPrompt,
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.0",
28
- "typescript-eslint": "8.50.1",
29
- "@typescript-eslint/eslint-plugin": "8.50.1",
30
- "@typescript-eslint/parser": "8.50.1",
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.24.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.6.2",
44
+ "eslint-plugin-vue": "10.7.0",
45
45
 
46
- "oxlint": "1.35.0",
47
- "eslint-plugin-oxlint": "1.35.0",
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.0",
61
+ "postcss-html": "1.8.1",
62
62
  "stylus": "0.64.0",
63
63
  "typescript": "5.9.3",
64
- "vue-tsc": "3.2.1",
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.0",
30
- "typescript-eslint": "8.50.1",
31
- "@typescript-eslint/eslint-plugin": "8.50.1",
32
- "@typescript-eslint/parser": "8.50.1",
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.24.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.6.2",
46
+ "eslint-plugin-vue": "10.7.0",
47
47
 
48
- "oxlint": "1.35.0",
49
- "eslint-plugin-oxlint": "1.35.0",
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.0",
63
+ "postcss-html": "1.8.1",
64
64
  "stylus": "0.64.0",
65
65
  "typescript": "5.9.3",
66
- "vue-tsc": "3.2.1",
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",