feat(asr): 新增百炼 Qwen3-ASR-Flash 实时供应商(OpenAI Realtime WS 协议)#775
Open
bigsongeth wants to merge 1 commit into
Open
feat(asr): 新增百炼 Qwen3-ASR-Flash 实时供应商(OpenAI Realtime WS 协议)#775bigsongeth wants to merge 1 commit into
bigsongeth wants to merge 1 commit into
Conversation
Contributor
PR Reviewer Guide 🔍(Review updated until commit ab10692)Here are some key observations to aid the review process:
|
bailian.rs 头注释预留的 follow-up 协议线:/api-ws/v1/realtime,与经典
/api-ws/v1/inference 并列为独立供应商 bailian-qwen3-realtime。
- asr/qwen_realtime.rs:新客户端。base64 JSON 事件流 + server_vad 自动断句,
按序收集 completed 句段;session.finish 冲刷尾段后回 session.finished。
关键协议行为均经 2026-07 线上实测:尾段冲刷(说到一半松手不丢字)、
纯静音验证干净返回、language 省略走自动检测、业务空间专属域名
(wss://{WorkspaceId}.cn-beijing.maas.aliyuncs.com)同样承载此路径。
- coordinator / asr_wiring / dictation / qa_session / resources:与 Bailian
分支同构接线(流式 WS + DeferredAsrBridge)。
- 验证与拉取模型:真实 WS 连通性检查;协议头校验(qwen3EndpointSchemeInvalid)。
- 前端:ASR 预设下拉新增一项;i18n 5 语言。
测试:cargo test 573 passed(新增 18 个客户端单测);npm run build 通过。
0641aa7 to
ab10692
Compare
Contributor
|
Persistent review updated to latest commit ab10692 |
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 #774。依赖的 #773 已合并;本分支已 rebase 到合并后的 beta(复用其引入的
endpoint_scheme_is_websocket校验)。实现
asr/bailian.rs头注释预留的 follow-up 协议线:Qwen3-ASR-Flash 实时版(OpenAI Realtime 风格 WebSocket,/api-ws/v1/realtime),作为独立供应商bailian-qwen3-realtime与经典 fun-asr-realtime 并列。业务空间专属域名(wss://{WorkspaceId}.cn-beijing.maas.aliyuncs.com)用户与受限工作空间 Key(仅授权 Qwen3 系模型)用户由此获得可用的实时通道。修复 / 新增 / 改进
asr/qwen_realtime.rs(新增,核心):Realtime 协议 client。base64 JSON 事件流(input_audio_buffer.append,3200B/100ms 块)+server_vad服务端自动断句;按到达顺序收集completed句段(CJK 直连、拉丁词间补空格);session.finish依赖服务端冲刷尾段后回session.finished。整体结构、并发模型(send worker + 弱引用 reader)、超时口径(5s 会话建立 / 12s 最终结果)与bailian.rs保持同构。language省略走服务端自动检测。coordinator/asr_wiring/dictation/qa_session/resources按 Bailian 分支同构接入(流式 WS +DeferredAsrBridge缓冲开链前音频),含听写、悬浮问答、重转录、取消全路径。qwen3EndpointSchemeInvalid(含默认 Realtime 地址的明确提示)。兼容
qwen3-asr-flash(兼容模式 chat/completions,另一条协议线)。bailian-qwen3-realtime,不改动任何现有供应商的行为、凭据格式与默认值。测试计划
cargo test --manifest-path src-tauri/Cargo.toml→ 573 passed / 0 failed(含新增 18 个 client 单测:URL 拼接/专属域名、消息构造、interimstash/text语义、completed 收集、尾段兜底、错误事件、静音空会话、句段拼接、音频缓冲)npm run build(tsc + vite)→ 通过session.finish尾段冲刷(含刻意截断音频尾部的场景)、静音会话、省略 language、专属域名全链路真实语音转写逐字正确。scripts/build-mac.sh本地构建安装):PR Type
Enhancement, Tests, Documentation
Description
Added Qwen3-ASR-Flash realtime provider (OpenAI Realtime WS protocol)
Integrated with coordinator, dictation, QA session, and credentials
Implemented real connectivity check and scheme validation
Added i18n support across 5 languages and frontend preset
File Walkthrough
11 files
Register new qwen_realtime moduleAdd Qwen3 Realtime ASR client (802 lines)Include qwen_realtime provider in credential checkAdd validation and model list for Qwen3Integrate Qwen3 ASR into coordinatorWire Qwen3 ASR provider kind and startHandle Qwen3 session in dictationHandle Qwen3 ASR in QA sessionAdd cancel for Qwen3RealtimeAdd Qwen3 preset and error code mappingAdd bailian-qwen3-realtime to AsrPresetId5 files
Add English i18n for Qwen3 provider and errorAdd Japanese i18n for Qwen3 provider and errorAdd Korean i18n for Qwen3 provider and errorAdd Chinese (Simplified) i18n for Qwen3Add Chinese (Traditional) i18n for Qwen3