You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/commands/src/commands/speech/recognize.ts
+73-9Lines changed: 73 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -14,9 +14,11 @@ import {
14
14
speechRecognizePath,
15
15
resolveAsrApi,
16
16
buildAsrFlashRequest,
17
+
buildAsrContextMessages,
17
18
buildAsyncAsrLanguageFields,
18
19
collectAsrTranscriptionItems,
19
20
extractAsrFlashText,
21
+
parseInstantVocabulary,
20
22
typeAsrApiRoute,
21
23
typeAsrFlashFamily,
22
24
typeOutputFormat,
@@ -73,8 +75,30 @@ const RECOGNIZE_FLAGS = {
73
75
type: "string",
74
76
valueHint: "<id>",
75
77
description: {
76
-
"en-US": "Hot-word vocabulary ID for improved accuracy",
77
-
"zh-CN": "用于提升识别准确率的热词表 ID",
78
+
"en-US":
79
+
"Pre-built hot-word vocabulary ID (create it via `speech vocabulary create`). Its target_model must exactly match --model, otherwise it is silently ignored. Wider model support than --vocabulary, including Fun-ASR and Paraformer",
"Instant hot words as JSON object of word→weight, e.g. '{\"Fendouzhe\":4}'. Weight 1-5 (4 recommended; higher values can hurt other words), 50 for super hot word. No pre-built vocabulary needed. Takes effect only on Qwen-Audio-3.0-ASR-Flash models",
"Context enhancement word list to improve accuracy on proper nouns; must contain the target words themselves (a topic description alone has little effect); max 400 chars. Takes effect only on Qwen-Audio-3.0-ASR-Flash and Fun-ASR-Flash models",
"ASR model this vocabulary is built for (required). Must exactly match the --model passed to `speech recognize` later, otherwise the vocabulary is silently ignored",
25
+
"zh-CN":
26
+
"该热词表服务的 ASR 模型(必填)。必须与后续 `speech recognize` 的 --model 完全一致,否则热词表静默失效",
27
+
},
28
+
required: true,
29
+
},
30
+
prefix: {
31
+
type: "string",
32
+
valueHint: "<prefix>",
33
+
description: {
34
+
"en-US":
35
+
"Custom vocabulary prefix (required). Digits and lowercase letters only, max 10 chars",
36
+
"zh-CN": "热词表自定义前缀(必填)。仅允许数字和小写字母,最长 10 个字符",
37
+
},
38
+
required: true,
39
+
},
40
+
...VOCABULARY_BODY_FLAGS,
41
+
}satisfiesFlagsDef;
42
+
typeCreateFlags=ParsedFlags<typeofCREATE_FLAGS>;
43
+
44
+
exportdefaultdefineCommand({
45
+
description: {
46
+
"en-US": "Create a precompiled hot-word vocabulary for ASR",
0 commit comments