feat(asr): 接入 ZenMux 语音转写(JSON + base64)作为可选云端 ASR(#837) - #915
Merged
Conversation
- WhisperBatchASR 新增 ZenMuxJson 请求格式:application/json + base64 input_audio,language 跟随工作语言(ISO 639-1 映射),enable_itn 可配置 - 新增 zenmux 命名预设:默认 https://zenmux.ai/api/v1 + qwen/qwen3-asr-flash, 复用 Whisper 兼容路由与 30s 分片;模型 slug 自由输入 - 设置页新增 enable_itn 开关(per-provider 高级配置,默认开启) - 补齐五语言 i18n、前端单测与 README
Contributor
PR Reviewer Guide 🔍(Review updated until commit 7331f7f)Here are some key observations to aid the review process:
|
- validate_asr_transcription 按 provider 真实请求格式发探针:OpenRouter / ZenMux 走 JSON+base64,其余 whisper 兼容厂商走 multipart,避免假阴性 - 设置页对 zenmux 预设增加说明:JSON 协议不发送词典热词(prompt/hotwords), 词典仍进入润色链路但不参与识别偏置;README 同步标注例外 - coordinator 再导出 whisper_request_format 供验证路径复用
Contributor
|
Persistent review updated to latest commit 7331f7f |
bigsongeth
added a commit
to bigsongeth/openless
that referenced
this pull request
Aug 4, 2026
beta 合入 Open-Less#915(ZenMux 语音转写)后与本分支在 asr_wiring.rs 的 QA 构造点相撞: 两边改的是同一条语句的不同部分。 本分支 词表来源换成 asr_vocab_phrases(按命中排序 + 保底席位) beta 外面包一层 apply_zenmux_asr_options 互不冲突,取并集。闭合括号那几行 beta 已经写成 apply_zenmux_asr_options 的形状, 所以只需保留自己那半个词表调用。听写路径那处 git 自动合并正确(asr_vocab_phrases 保住了),已核对。 cargo check 干净;cargo test --lib 1000 passed;tsc --noEmit 干净;npm test 通过。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Aug 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
背景
Closes #837
OpenLess 已支持多路云端 ASR,但聚合平台 ZenMux(zenmux.ai)的语音转写接口是 JSON 请求体 + base64 内联音频的私有格式,现有「OpenAI Whisper(兼容)」provider 对不上。已在使用 ZenMux 做 LLM 润色的用户无法复用同一把 Key 做语音识别。
变更
WhisperBatchASR新增ZenMuxJson请求格式(POST /audio/transcriptions+application/json,input_audio.data走标准 base64),与 OpenRouter 的 JSON 路径隔离,避免互相污染。language字段取working_languages主语言 → ISO 639-1 映射(zh/en/ja/ko/fr/de/es/it/pt/ru/ar/vi/th/hi),未收录语言省略字段由服务端自动检测。asr.advanced_configvault),默认开启;设置页对 zenmux 预设显示「数字归一化」开关。ASR_PRESETS新增zenmux,默认https://zenmux.ai/api/v1+qwen/qwen3-asr-flash;模型 slug 自由输入(可填bytedance/doubao-seed-asr-2.0、xiaomi/mimo-v2.5-asr等)。后端空槽回落同款默认值。测试
zenmux相关单测 5 个、whisper 模块 29 个、coordinator 82 个全部通过;cargo check --lib无错误。tsc --noEmit零错误,完整前端测试套件通过。说明
ZenMux 官方文档在实现时不可访问,协议以 issue #837 提供的请求/响应形状为准(与已实现的 OpenRouter JSON 格式一致);如联调发现
language/enable_itn字段校验更严,仅需微调映射或开关发送策略。PR Type
Enhancement
Description
Add ZenMux ASR preset using JSON+base64 transcription
Follow working language and expose enable_itn toggle
Make test connection match provider real request format
Update i18n, docs, and tests across the app
Diagram Walkthrough
flowchart LR A["ASR request"] --> B{"Request format"} B -- "zenmux" --> C["ZenMuxJson JSON+base64"] B -- "openrouter" --> D["OpenRouterJson"] B -- "others" --> E["Multipart"] C --> F["ZenMux /audio/transcriptions"] F --> G["Transcript text"]File Walkthrough
8 files
Add ZenMuxJson request format with language/itn optionsValidate ASR connection using provider-specific JSON or multipartAdd zenmux provider id, defaults, and enable_itn configWire zenmux format, language mapping, and ASR optionsApply ZenMux options in dictation session constructionAdd enableItn field to advanced ASR configShow enable_itn toggle and ZenMux vocabulary noteAdd ZenMux preset with default endpoint and model5 files
Add English translations for ZenMux and enable_itnAdd Japanese translations for ZenMux and enable_itnAdd Korean translations for ZenMux and enable_itnAdd Simplified Chinese translations for ZenMux and enable_itnAdd Traditional Chinese translations for ZenMux and enable_itn2 files
Update tests for enable_itn config parsingAdd test for ZenMux ASR preset defaults2 files
Document ZenMux ASR and hotword exceptionDocument ZenMux ASR and hotword exception in Chinese