qwen-audio-agent 2.0.0 → 2.1.0

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 (177) hide show
  1. package/README.md +15 -5
  2. package/README_ZH.md +13 -5
  3. package/THIRD_PARTY_NOTICES.md +1 -1
  4. package/cli/package.json +1 -1
  5. package/cli/src/arguments.mjs +4 -1
  6. package/cli/src/config-command.mjs +5 -6
  7. package/cli/src/launcher.mjs +13 -0
  8. package/config/frontend-agent/PROMPT.md +29 -26
  9. package/desktop/src/i18n.mjs +6 -0
  10. package/desktop/src/settings-config.mjs +34 -28
  11. package/desktop/src/settings-store.mjs +19 -28
  12. package/docs/architecture/deep-dive.md +103 -66
  13. package/docs/architecture/deep-dive.zh.md +73 -50
  14. package/docs/backends/configuration.md +21 -20
  15. package/docs/backends/configuration.zh.md +19 -17
  16. package/docs/backends/overview.md +14 -8
  17. package/docs/backends/overview.zh.md +11 -5
  18. package/docs/configuration/backend.md +16 -2
  19. package/docs/configuration/backend.zh.md +16 -2
  20. package/docs/configuration/frontend.md +59 -26
  21. package/docs/configuration/frontend.zh.md +58 -26
  22. package/docs/configuration.md +1 -1
  23. package/docs/configuration.zh.md +1 -1
  24. package/docs/contract.md +22 -2
  25. package/docs/contract.zh.md +18 -2
  26. package/docs/gateway-protocol.md +26 -0
  27. package/docs/gateway-protocol.zh.md +22 -0
  28. package/docs/gateway-webrtc-client.md +3 -3
  29. package/docs/gateway-webrtc-client.zh.md +3 -3
  30. package/docs/getting-started/install.md +1 -1
  31. package/docs/getting-started/install.zh.md +1 -1
  32. package/docs/getting-started/quickstart.md +2 -2
  33. package/docs/getting-started/quickstart.zh.md +2 -2
  34. package/docs/getting-started/webui.md +2 -0
  35. package/docs/getting-started/webui.zh.md +2 -0
  36. package/docs/guides/knowledge.md +8 -5
  37. package/docs/guides/knowledge.zh.md +4 -3
  38. package/docs/guides/tasks.md +63 -2
  39. package/docs/guides/tasks.zh.md +45 -1
  40. package/docs/guides/web-search.md +16 -1
  41. package/docs/guides/web-search.zh.md +14 -1
  42. package/docs/reference/backend-adapter-sdk.md +33 -2
  43. package/docs/reference/backend-adapter-sdk.zh.md +29 -2
  44. package/docs/reference/cli.md +3 -3
  45. package/docs/reference/cli.zh.md +3 -3
  46. package/docs/scenarios/lightrag.md +2 -2
  47. package/docs/scenarios/lightrag.zh.md +2 -2
  48. package/docs/scenarios/x-omni.md +5 -2
  49. package/docs/scenarios/x-omni.zh.md +5 -2
  50. package/docs/voice-agent-architecture-presentation.zh.md +34 -37
  51. package/docs/voice-frontends/custom-provider.md +6 -3
  52. package/docs/voice-frontends/custom-provider.zh.md +6 -3
  53. package/docs/voice-frontends/google-live.md +7 -5
  54. package/docs/voice-frontends/google-live.zh.md +7 -5
  55. package/docs/voice-frontends/gpt-live.md +7 -5
  56. package/docs/voice-frontends/gpt-live.zh.md +7 -5
  57. package/docs/voice-frontends/minicpm-o.md +8 -4
  58. package/docs/voice-frontends/minicpm-o.zh.md +7 -4
  59. package/docs/voice-frontends/qwen-audio-realtime.md +39 -14
  60. package/docs/voice-frontends/qwen-audio-realtime.zh.md +32 -11
  61. package/docs/voice-frontends/qwen-omni-realtime.md +11 -8
  62. package/docs/voice-frontends/qwen-omni-realtime.zh.md +11 -8
  63. package/docs/voice-frontends/speech-to-speech.md +8 -4
  64. package/docs/voice-frontends/speech-to-speech.zh.md +7 -3
  65. package/docs/voice-frontends/stepfun.md +7 -4
  66. package/docs/voice-frontends/stepfun.zh.md +7 -4
  67. package/examples/webrtc/start.mjs +2 -1
  68. package/package.json +22 -14
  69. package/scripts/audit-dependencies.mjs +3 -25
  70. package/scripts/electron-smoke.mjs +5 -5
  71. package/scripts/release-check +13 -21
  72. package/scripts/runtime/claude-code-acp.mjs +5 -5
  73. package/scripts/runtime/codex-acp.mjs +1 -1
  74. package/scripts/runtime/openclaw.mjs +3 -2
  75. package/scripts/runtime/opencode.mjs +2 -10
  76. package/scripts/runtime/pi-acp.mjs +1 -1
  77. package/scripts/verify-package.mjs +0 -2
  78. package/server/package.json +4 -4
  79. package/server/src/app/gateway-application.mjs +3 -0
  80. package/server/src/app/gateway-http-routes.mjs +3 -0
  81. package/server/src/app/session-conversation-history.mjs +9 -1
  82. package/server/src/backend/adapters/a2a/backend-adapter.mjs +32 -26
  83. package/server/src/backend/adapters/acp/backend-adapter.mjs +710 -263
  84. package/server/src/backend/adapters/acp/coordinator-contract.mjs +2 -13
  85. package/server/src/backend/adapters/acp/coordinator-instructions.mjs +29 -8
  86. package/server/src/backend/adapters/acp/coordinator-queue.mjs +58 -0
  87. package/server/src/backend/adapters/acp/drivers/codex.mjs +1 -1
  88. package/server/src/backend/adapters/acp/drivers/deepseek-harness.mjs +12 -36
  89. package/server/src/backend/adapters/acp/drivers/openclaw.mjs +1 -2
  90. package/server/src/backend/adapters/acp/input-broker.mjs +2 -0
  91. package/server/src/backend/adapters/acp/process-client.mjs +117 -17
  92. package/server/src/backend/adapters/acp/session-configuration.mjs +2 -19
  93. package/server/src/backend/adapters/acp/session-registry.mjs +9 -0
  94. package/server/src/backend/adapters/acp/session-tools.mjs +1 -1
  95. package/server/src/backend/adapters/acp/turn-updates.mjs +188 -0
  96. package/server/src/backend/adapters/acp/work-continuation.mjs +48 -0
  97. package/server/src/backend/adapters/agent-client.mjs +24 -1
  98. package/server/src/backend/adapters/llm/backend-adapter.mjs +393 -0
  99. package/server/src/backend/adapters/muse/backend-adapter.mjs +2 -0
  100. package/server/src/backend/availability.mjs +12 -3
  101. package/server/src/backend/backend-adapter-sdk.mjs +3 -0
  102. package/server/src/backend/backend-port.mjs +13 -0
  103. package/server/src/backend/backend-work-runtime.mjs +23 -0
  104. package/server/src/client/client-command-runtime.mjs +14 -0
  105. package/server/src/conversation/conversation-sync.mjs +26 -2
  106. package/server/src/conversation/frontend-notes.mjs +7 -5
  107. package/server/src/conversation/task-result-projector.mjs +1 -1
  108. package/server/src/core/backend-events.mjs +4 -0
  109. package/server/src/core/config.mjs +32 -55
  110. package/server/src/core/gateway-protocol.mjs +4 -1
  111. package/server/src/core/work-conversation-context.mjs +138 -0
  112. package/server/src/core/work-input-request.mjs +1 -0
  113. package/server/src/frontend/frontend-tools.mjs +6 -6
  114. package/server/src/frontend/retrieval/providers/factory.mjs +10 -1
  115. package/server/src/frontend/retrieval/providers/mcp.mjs +13 -2
  116. package/server/src/frontend/tools/agent-task-runtime.mjs +97 -95
  117. package/server/src/frontend/tools/features/agent-task-tools.mjs +23 -42
  118. package/server/src/frontend/tools/frontend-tool-context.mjs +2 -2
  119. package/server/src/frontend/tools/spawn-thinking-tool.mjs +2 -2
  120. package/server/src/frontend/tools/tool-call-handler.mjs +112 -68
  121. package/server/src/knowledge/providers/local/library.mjs +26 -6
  122. package/server/src/knowledge/providers/local/provider.mjs +25 -6
  123. package/server/src/memory/providers/markdown/context-store.mjs +21 -10
  124. package/server/src/orchestration/session-task-coordinator.mjs +9 -2
  125. package/server/src/orchestration/task-operations.mjs +50 -10
  126. package/server/src/orchestration/task-updates.mjs +81 -0
  127. package/server/src/task/reminder-scheduler.mjs +5 -1
  128. package/server/src/task/task-manager.mjs +72 -15
  129. package/server/src/task/task-recovery.mjs +12 -2
  130. package/server/src/task/task-scheduler.mjs +5 -5
  131. package/server/src/task/task-state.mjs +13 -0
  132. package/server/src/transport/gateway-client-transport.mjs +16 -0
  133. package/server/src/voice/announcement/announcement-manager.mjs +3 -0
  134. package/server/src/voice/providers/dashscope.mjs +34 -30
  135. package/server/src/voice/providers/doubao-seeduplex.mjs +13 -9
  136. package/server/src/voice/providers/google-live.mjs +18 -13
  137. package/server/src/voice/providers/gpt-live.mjs +13 -10
  138. package/server/src/voice/providers/minicpm-o.mjs +9 -7
  139. package/server/src/voice/providers/registry.mjs +2 -2
  140. package/server/src/voice/providers/runtime-configuration.mjs +23 -0
  141. package/server/src/voice/providers/s2s.mjs +9 -7
  142. package/server/src/voice/providers/stepfun.mjs +13 -10
  143. package/server/src/voice/realtime-input-runtime.mjs +2 -0
  144. package/server/src/voice/realtime-presentation-runtime.mjs +90 -23
  145. package/server/src/voice/realtime-provider.mjs +26 -9
  146. package/server/src/voice/realtime-session-runtime.mjs +79 -23
  147. package/server/src/voice/realtime-task-presentation.mjs +2 -0
  148. package/shared/backend/catalog.mjs +44 -45
  149. package/shared/backend/install.mjs +15 -17
  150. package/shared/backend/runtime-package.mjs +3 -3
  151. package/shared/backend/setup.mjs +59 -113
  152. package/shared/gateway/client-sdk.mjs +6 -1
  153. package/shared/gateway/setup.mjs +13 -1
  154. package/shared/protocol/gateway-client-protocol.mjs +14 -0
  155. package/shared/protocol/gateway-events.mjs +8 -1
  156. package/shared/realtime-legacy-environment.mjs +52 -0
  157. package/shared/realtime-model-catalog.mjs +66 -194
  158. package/shared/realtime-models/README.md +25 -0
  159. package/shared/realtime-models/dashscope.mjs +46 -0
  160. package/shared/realtime-models/doubao-seeduplex.mjs +12 -0
  161. package/shared/realtime-models/google-live.mjs +10 -0
  162. package/shared/realtime-models/gpt-live.mjs +10 -0
  163. package/shared/realtime-models/profile.mjs +35 -0
  164. package/shared/realtime-models/stepfun.mjs +10 -0
  165. package/shared/realtime-provider-catalog.mjs +16 -5
  166. package/shared/realtime-provider-definitions.mjs +99 -231
  167. package/shared/runtime-environment.mjs +23 -30
  168. package/shared/skill-library.mjs +49 -13
  169. package/shared/web-search-configuration.mjs +13 -2
  170. package/tui/package.json +1 -1
  171. package/web/dist/assets/index-8erKDCr2.css +1 -0
  172. package/web/dist/assets/index-Cs4hYWbS.js +96 -0
  173. package/web/dist/index.html +2 -2
  174. package/config/backends/deepseek-harness/cordis.yml +0 -59
  175. package/scripts/runtime/deepseek-harness-acp.mjs +0 -59
  176. package/web/dist/assets/index-BRaiI-dW.js +0 -91
  177. package/web/dist/assets/index-D9k8R2JY.css +0 -1
@@ -8,15 +8,15 @@ After installation, run `qwenaudio` from any directory. In a source checkout, ru
8
8
  | --- | --- |
9
9
  | `qwenaudio --version` | Show the CLI version |
10
10
  | `qwenaudio config` | Show the config path; create a template if missing |
11
- | `qwenaudio config show` | Show the configured voice provider, model, and available models without credentials |
12
- | `qwenaudio config set --realtime-model ID` | Change the current provider's model setting |
11
+ | `qwenaudio config show` | Show the configured voice provider, model, and supported models without credentials |
12
+ | `qwenaudio config set --realtime-model ID` | Select a supported model for the current provider |
13
13
  | `qwenaudio doctor` | Read-only configuration, connection, and state checks |
14
14
  | `qwenaudio doctor --json` | Print diagnostic JSON |
15
15
  | `qwenaudio doctor --turn ID` | Build a turn timeline from local logs |
16
16
  | `qwenaudio setup` | Check integration readiness for all backends |
17
17
  | `qwenaudio setup --backend qwen --json` | Check one backend and print JSON |
18
18
 
19
- `config show` reads configuration, not live model availability. `setup` does not verify backend accounts or quota. [Apply configuration changes](../operations/gateway.md#applying-configuration-changes) after changing models.
19
+ `config show` reads the framework-maintained model list, not live model availability. `config set` selects an existing supported ID; it cannot add a model or change its adaptation parameters. See [model selection](../configuration/frontend.md#select-a-supported-model). `setup` does not verify backend accounts or quota. [Apply configuration changes](../operations/gateway.md#applying-configuration-changes) after changing models.
20
20
 
21
21
  ## Gateway
22
22
 
@@ -8,15 +8,15 @@
8
8
  | --- | --- |
9
9
  | `qwenaudio --version` | 查看 CLI 版本 |
10
10
  | `qwenaudio config` | 显示配置路径,文件缺失时创建模板 |
11
- | `qwenaudio config show` | 显示已配置的语音 Provider、模型及可选模型,不显示凭据 |
12
- | `qwenaudio config set --realtime-model ID` | 修改当前 Provider 的模型配置 |
11
+ | `qwenaudio config show` | 显示已配置的语音 Provider、模型及受支持模型,不显示凭据 |
12
+ | `qwenaudio config set --realtime-model ID` | 为当前 Provider 选择受支持模型 |
13
13
  | `qwenaudio doctor` | 只读检查配置、连接与状态 |
14
14
  | `qwenaudio doctor --json` | 输出诊断 JSON |
15
15
  | `qwenaudio doctor --turn ID` | 从本机日志整理某一轮时间线 |
16
16
  | `qwenaudio setup` | 检测所有后台的接入准备情况 |
17
17
  | `qwenaudio setup --backend qwen --json` | 检测指定后台并输出 JSON |
18
18
 
19
- `config show` 显示的是配置,不是线上模型探测;`setup` 不验证后台账号或额度。修改模型后需[应用配置](../operations/gateway.zh.md#修改配置后生效)。
19
+ `config show` 显示框架维护的模型列表,不是线上模型探测。`config set` 只能选择已有的受支持 ID,不能新增模型或修改其适配参数,详见[模型选择](../configuration/frontend.zh.md#选择受支持模型)。`setup` 不验证后台账号或额度。修改模型后需[应用配置](../operations/gateway.zh.md#修改配置后生效)。
20
20
 
21
21
  ## Gateway
22
22
 
@@ -56,7 +56,7 @@ cp examples/lightrag/.env.example examples/lightrag/.env.local
56
56
  Set the voice frontend and LightRAG connection values:
57
57
 
58
58
  ```dotenv
59
- DASHSCOPE_API_KEY=your_dashscope_api_key
59
+ QWEN_AUDIO_REALTIME_API_KEY=your_dashscope_api_key
60
60
  LIGHTRAG_URL=http://127.0.0.1:9621
61
61
  LIGHTRAG_API_KEY=your_lightrag_api_key
62
62
  LIGHTRAG_WORKSPACE=
@@ -73,7 +73,7 @@ Open `http://127.0.0.1:3101`, import a file from the Knowledge Library panel, wa
73
73
  then query it by voice or text. This isolated example uses frontend-only mode and does not start
74
74
  a backend Agent.
75
75
 
76
- `DASHSCOPE_API_KEY` belongs only to the voice frontend. LightRAG keeps its LLM and embedding
76
+ `QWEN_AUDIO_REALTIME_API_KEY` belongs only to the voice frontend. LightRAG keeps its LLM and embedding
77
77
  configuration in its own process. qwen-audio-agent does not install, start, or modify LightRAG.
78
78
 
79
79
  ## Data and task boundaries
@@ -55,7 +55,7 @@ cp examples/lightrag/.env.example examples/lightrag/.env.local
55
55
  填写语音前台和 LightRAG 连接信息:
56
56
 
57
57
  ```dotenv
58
- DASHSCOPE_API_KEY=your_dashscope_api_key
58
+ QWEN_AUDIO_REALTIME_API_KEY=your_dashscope_api_key
59
59
  LIGHTRAG_URL=http://127.0.0.1:9621
60
60
  LIGHTRAG_API_KEY=your_lightrag_api_key
61
61
  LIGHTRAG_WORKSPACE=
@@ -71,7 +71,7 @@ node --env-file=examples/lightrag/.env.local examples/lightrag/gateway.mjs
71
71
  打开 `http://127.0.0.1:3101`,在资料库面板中导入文件,等待索引完成后即可通过语音或
72
72
  文字查询。这个示例使用仅前台模式,不会启动后台 Agent。
73
73
 
74
- `DASHSCOPE_API_KEY` 只用于语音前台;LightRAG 的 LLM 和 Embedding 配置保留在它自己的
74
+ `QWEN_AUDIO_REALTIME_API_KEY` 只用于语音前台;LightRAG 的 LLM 和 Embedding 配置保留在它自己的
75
75
  进程中。qwen-audio-agent 不会安装、启动或修改 LightRAG。
76
76
 
77
77
  ## 数据与任务边界
@@ -50,11 +50,14 @@ replace the frontend configuration in `.env.local` with:
50
50
 
51
51
  ```dotenv
52
52
  QWEN_AUDIO_REALTIME_PROVIDER=minicpm-o
53
- MINICPM_O_REALTIME_URL=ws://127.0.0.1:8006/v1/realtime?mode=video
53
+ QWEN_AUDIO_REALTIME_URL=ws://127.0.0.1:8006/v1/realtime?mode=video
54
+ QWEN_AUDIO_REALTIME_API_KEY=
55
+ QWEN_AUDIO_REALTIME_MODEL=
56
+ QWEN_AUDIO_REALTIME_VOICE=
54
57
  AGENT_PROTOCOL=none
55
58
  ```
56
59
 
57
- Use the endpoint of your deployment and set `MINICPM_O_AUTH_TOKEN` if needed.
60
+ Use the endpoint of your deployment and set `QWEN_AUDIO_REALTIME_API_KEY` if it requires a Bearer token.
58
61
  No DashScope key is required. The client uses continuous frames with voice
59
62
  input; typed input, on-demand inspection, observation, and backend tool calls
60
63
  are unavailable through the current MiniCPM-o interface. Unsupported controls
@@ -47,11 +47,14 @@ Qwen 默认使用 `qwen3.5-omni-plus-realtime`;也可通过
47
47
 
48
48
  ```dotenv
49
49
  QWEN_AUDIO_REALTIME_PROVIDER=minicpm-o
50
- MINICPM_O_REALTIME_URL=ws://127.0.0.1:8006/v1/realtime?mode=video
50
+ QWEN_AUDIO_REALTIME_URL=ws://127.0.0.1:8006/v1/realtime?mode=video
51
+ QWEN_AUDIO_REALTIME_API_KEY=
52
+ QWEN_AUDIO_REALTIME_MODEL=
53
+ QWEN_AUDIO_REALTIME_VOICE=
51
54
  AGENT_PROTOCOL=none
52
55
  ```
53
56
 
54
- 地址以实际部署为准,按需配置 `MINICPM_O_AUTH_TOKEN`,无需 DashScope Key。
57
+ 地址以实际部署为准;需要 Bearer 认证时填写 `QWEN_AUDIO_REALTIME_API_KEY`,无需 DashScope Key。
55
58
  客户端使用持续画面与语音输入;当前 MiniCPM-o 接口不支持文字输入、按需识图、
56
59
  观察和后台工具调用。不支持的控件会禁用,不模拟执行。
57
60
 
@@ -351,7 +351,7 @@ Gateway 承载运行时与模型接入;客户端只负责输入输出与环境
351
351
  | 语音控制 | 前台会话运行时 | 管理模型连接、回合、打断与播放;GCP 接入由独立传输层处理 |
352
352
  | 任务账本 | TaskManager | 记录任务是否排队、运行、完成或取消 |
353
353
  | 后台接入 | BackendPort / Adapter | 将 ACP、A2A 与自定义后台 Agent 归一为统一事件与状态 |
354
- | 持续协调 | ACP Coordinator Session | 后台的持久执行上下文,不是编排运行时;决定直接完成或继续委派 |
354
+ | 持续协调 | ACP Coordinator Session | 后台的持久协调上下文,不是编排运行时;分派独立工作、续接原 Session 并整理结果 |
355
355
  | 结果播报 | AnnouncementManager | 等到合适时机,再让前台自然说出结果 |
356
356
 
357
357
  **具体实现可以替换,职责边界必须保持稳定。**
@@ -432,6 +432,7 @@ export const frontendToolRegistry = new FrontendToolRegistry([
432
432
  { definition: memoryTool },
433
433
  { definition: notesTool },
434
434
  { definition: cancelAgentTaskTool },
435
+ { definition: updateAgentTaskTool, policy: { repeatHandling: 'handler' } },
435
436
  { definition: getAgentTaskStatusTool },
436
437
  // 能力或客户端动作存在时才提供相应工具
437
438
  { definition: webSearchTool, policy: { requiredCapabilities: […] } },
@@ -439,7 +440,6 @@ export const frontendToolRegistry = new FrontendToolRegistry([
439
440
  { definition: knowledgeTool, policy: { requiredCapabilities: […] } },
440
441
  { definition: recallTool, policy: { requiredCapabilities: […] } },
441
442
  { definition: respondPermissionTool, policy: { requiredCapabilities: […] } },
442
- { definition: respondAgentInputTool, policy: { requiredCapabilities: […] } },
443
443
  { definition: enterSleepTool, policy: { requiredClientActions: […] } },
444
444
  ])
445
445
  ```
@@ -510,7 +510,8 @@ spawn_thinking({ objective: "继续当前页面工作,修复登录失败问题
510
510
  objective: "继续当前页面工作,…", ownerId: "personal", sessionId: "main", turnId: "…" }
511
511
 
512
512
  ③ 后台协调会话实际收到
513
- objective 文本 + COORDINATOR_STABLE_INSTRUCTIONS 稳定指令块 + 用户原话(ACP ContentBlock 附件)
513
+ objective 文本 + 有界的新增人机对话 + 原生附件(如有)
514
+ 声明 coordinatorMcpInstructions 的后台通过 MCP instructions 接收稳定协调规则;其余后台逐轮附加。
514
515
  ```
515
516
 
516
517
  > 协调信息**内化为 Gateway 的权威任务记录**;投递给后台的只是投影——前台人格、完整记忆与聊天历史不会被批量转发,稳定指令块同时承载 Project Session 的路由纪律。
@@ -580,49 +581,46 @@ queued → running ────────────────────
580
581
 
581
582
  ### 有界并发
582
583
 
583
- 限制同时运行的后台任务,避免本机资源和后台服务过载。
584
+ 运行时默认每个 owner 与全局各有 1 个任务准入名额,名额占用时后续工作排队;新任务不隐式取消已有工作。
584
585
 
585
586
  </div>
586
587
 
587
588
  <div>
588
589
 
589
- ### 串行协调
590
+ ### 会话内串行
590
591
 
591
- 同一协调 Session 一次只处理一项任务,保证上下文顺序。
592
+ ACP 始终使用一个持久协调 Session,顺序处理请求、调整和结果整理;调整绑定原工作。
592
593
 
593
594
  </div>
594
595
 
595
596
  <div>
596
597
 
597
- ### 委派释放
598
+ ### 委派让出名额
598
599
 
599
- 任务进入独立执行层后释放协调槽位,长任务不阻塞后续请求。
600
+ 派出独立工作并结束协调轮次后,释放任务准入名额和协调租约;项目 Session 独立执行,结果再排队汇总。
600
601
 
601
602
  </div>
602
603
 
603
604
  </div>
604
605
 
605
- > <strong>核心约束:</strong> 资源可控、上下文有序、长任务不阻塞持续对话。
606
+ > <strong>核心约束:</strong> 协调轮次串行、独立工作并行、长任务不阻塞持续对话;任务准入上限不等于项目 Session 数量上限。
606
607
 
607
608
  ---
608
609
 
609
610
  # 协调 Session 提供可持续续接的后台对话窗口
610
611
 
611
- 协调 Session 是 Backend Adapter 为当前用户创建或恢复的一条后台 Agent 原生会话,用于承接跨任务的持续理解与执行协调。
612
+ ACP Backend Adapter 用一个持久协调 Session,顺序承接当前用户的任务分派、原 Session 续接与结果整理。
612
613
 
613
- - 同一用户反复复用,而不是每次重新开始。
614
- - 每轮只看到自包含任务指令和当前任务所需的原生附件。
615
- - 简单后台工作可以自己完成。
616
- - 复杂、独立或长期工作可以进入独立执行层。
617
- - 独立任务完成后,它负责校验结果并整理最终表达。
614
+ - 新请求和结果整理共用协调队列,独立工作不占用协调租约。
615
+ - 调整绑定原执行目标;已完成的框架 ACP 委派也由原协调 Session 经 `session_send` 续接原项目,不新建替代 Session。
616
+ - 续接需新版持久上下文;旧上下文或没有可靠定向续接入口的原生委派明确报错,不猜测迁移。
617
+ - 每轮接收自然任务指令、最多 2,000 字符的新增人机对话,以及原生附件。
618
+ - 对话背景不复制工具调用、工具结果或后台原始输出,不是新的执行要求。
619
+ - 目标明确独立、适合持续独立执行的工作使用项目 Session,无需用户明确要求;简短操作、澄清和结果整理留在协调 Session,不支持委派的后台直接执行。
620
+ - 同一轮可派出多项工作;派出或续接后结束轮次,不等待、不轮询、不在本地重复执行。
621
+ - 全部独立工作结束后,排队整理最终表达。
618
622
 
619
- ```js
620
- return `${protocol}:${encodeURIComponent(
621
- clean(ownerId) || 'personal'
622
- )}:backend`
623
- ```
624
-
625
- **协调会话负责持续理解;独立 Session 负责长任务执行。**
623
+ **会话上下文分开,不代表文件、工作目录或外部资源隔离。**
626
624
 
627
625
  <!--
628
626
  [Sources]
@@ -751,7 +749,7 @@ if (outcome?.completed) {
751
749
 
752
750
  ---
753
751
 
754
- # 是否进入独立执行层,取决于任务是否需要独立生命周期
752
+ # 目标明确独立、适合持续执行的工作进入项目 Session
755
753
 
756
754
  <div class="two-col">
757
755
 
@@ -759,10 +757,10 @@ if (outcome?.completed) {
759
757
 
760
758
  ## 进入独立执行层
761
759
 
762
- - 需要跨回合延续同一个工作 Session
763
- - 需要独立工作区和多步工具执行
764
- - 需要单独的权限、取消或恢复边界
765
- - 用户明确继续已有项目 Session
760
+ - 工作有明确独立的目标,适合持续独立执行
761
+ - 用户无需明确要求单独的 Session
762
+ - 相关后续要求继续原项目 Session,不另建重复工作
763
+ - 派出后结束协调轮次,由运行时等待结果
766
764
 
767
765
  </div>
768
766
 
@@ -770,16 +768,15 @@ if (outcome?.completed) {
770
768
 
771
769
  ## 留在协调 Session
772
770
 
773
- - 当前协调回合即可完成
774
- - 只需轻量检索、计算或状态查询
775
- - 回合结束后无需保留执行状态
776
- - 结果可以直接进入交付
771
+ - 简短操作与查询
772
+ - 澄清和已验证结果整理
773
+ - 不支持委派的后台直接执行请求
777
774
 
778
775
  </div>
779
776
 
780
777
  </div>
781
778
 
782
- **判断标准不是任务“难不难”,而是是否需要创建并维护独立执行状态。**
779
+ **是否使用项目 Session 取决于目标独立性与持续独立执行的收益,不要求用户明确提出。**
783
780
 
784
781
  ---
785
782
 
@@ -820,11 +817,11 @@ MCP Session 工具不暴露给语音前台,仅作为协调会话管理独立
820
817
  | ---: | --- | --- |
821
818
  | 1 | 协调会话 | 调用 `session_start` 或 `session_send` |
822
819
  | 2 | Adapter | 记录 delegation ID 与目标 Session |
823
- | 3 | TaskManager | 任务进入 `delegated`,释放协调槽位 |
820
+ | 3 | TaskManager / ACP Adapter | 进入 `delegated`,协调轮次结束后释放准入名额与租约 |
824
821
  | 4 | 独立 Session | 使用文件、终端、搜索等能力长期执行 |
825
- | 5 | Adapter | 等待与当前委派精确匹配的最终结果 |
826
- | 6 | 协调会话 | 重新取得控制权,校验并整理结果 |
827
- | 7 | TaskManager | 任务进入 `completed`,等待自然播报 |
822
+ | 5 | Adapter | 等待该工作全部独立执行目标的结果 |
823
+ | 6 | 原协调会话 | 重新排队,校验并整理一次结果,不再次委派 |
824
+ | 7 | TaskManager / ACP Adapter | 记录任务终态;成功结果等待自然播报 |
828
825
 
829
826
  > 取消、查询、权限和重启恢复,始终绑定同一项任务与目标 Session。
830
827
 
@@ -1017,7 +1014,7 @@ ConversationSync 是 Gateway 内的短期会话账本,记录用户说了什么
1017
1014
 
1018
1015
  - receipt 不等待后台完成
1019
1016
  - transcript 关联不阻塞回执
1020
- - 委派后立即释放协调槽
1017
+ - ACP 委派结束协调轮次后让出名额,独立项目继续执行
1021
1018
  - 结果等到自然窗口再播报
1022
1019
  - 播放开始才确认交付
1023
1020
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  A Realtime Provider adapts a realtime model service to the runtime; it is neither the client nor the Orchestration Runtime itself. A product host can inject a custom provider without changing shared session or backend-work logic. The example below assembles it through the Gateway application entry point.
4
4
 
5
+ For another model using an existing provider, maintain its support in that provider's data file under `shared/realtime-models/` and add tests. Model definitions and adaptation parameters belong to framework code, not user configuration. Users [select from the supported models](../configuration/frontend.md#select-a-supported-model).
6
+
5
7
  ```js
6
8
  import { createGatewayApplication } from 'qwen-audio-agent/gateway-application'
7
9
  import {
@@ -26,13 +28,14 @@ The extension boundary is:
26
28
  - `url()`, `headers()`, and `model()` can read the service URL, token, and model from host-owned configuration closures. The Gateway does not require product-specific environment variables.
27
29
  - `createProtocol()` runs once for each Realtime connection, so connection IDs and mutable state remain isolated.
28
30
  - Optional synchronous `validateSessionOptions({ sessionOptions })` runs before opening the
29
- upstream connection. Only reject known-invalid selections; leave unknown values to the service.
31
+ upstream connection. Reject known-invalid service options; other service-specific values still need upstream validation. This does not bypass the catalog check for supported model IDs.
30
32
  - `connectionMessages()` emits raw handshake frames after the WebSocket opens and before `session.update`.
31
33
  - All later events pass through `encodeOutgoing()` and `normalizeIncoming()`, leaving Gateway tools, tasks, and client protocols unchanged.
32
34
  - Protocols without transient response instructions can implement `responseInstructionsItem(response)`. Gateway creates and awaits that conversation item before calling `responseCreate(response)`, which strips unsupported wire parameters. Set `perResponseInstructions: false`; these instructions remain in history.
33
35
  - `conversationItemCreate(item, { contextOnly })` distinguishes context delivery from interactive user input. For message items, `contextOnly: true` must write context without triggering a reply; it must not merely cache the text for a later `responseCreate`. Gateway passes `false` for interactive text/file input. Tool receipts keep the provider's native continuation semantics.
34
36
  - Set `automaticToolResponses: true` only when tool results natively resume generation (Doubao Seeduplex and Google Live). Runtime sends these receipts without waiting for response completion, and the tool-batch follow-up uses `ensureResponse(..., { afterToolResults: true })` without requesting a second reply. `sendFunctionOutput` acknowledges delivery with `{ delivered: true, automatic: true }`; this is not speech completion. `createResponse: false` cannot disable the service's native continuation, nor can per-response instructions control it. Other providers keep explicit response creation and completion tracking.
35
37
  - Normalize events that only prove liveness to `response.activity` with a `response_id`, without forwarding thinking text.
38
+ - An `error` that carries a `response_id` settles only that response. Leave the id off when the failure belongs to the request waiting on the frontend, so it falls back to the sole waiter.
36
39
  - Set `conversationItemIdEcho: false` when the service assigns new IDs to acknowledged conversation items. Gateway correlates the single pending item without delays or skipping acknowledgment.
37
40
  - Set `imageRequiresAudioStart: true` only if the service requires audio before the first video frame. Gateway primes that timeline with 20 ms of PCM16 silence so camera input does not require opening the microphone.
38
41
  - Set `acknowledgesConversationItems: false` when the service accepts input or tool-response messages without sending a conversation-item acknowledgment. Gateway resolves the send after writing the frame.
@@ -55,8 +58,8 @@ For [Google Live](https://ai.google.dev/api/live), context-only history uses `cl
55
58
 
56
59
  ## Desktop settings
57
60
 
58
- Built-in frontend settings live in `shared/realtime-provider-definitions.mjs`, a browser-safe catalog without credentials or connection implementations. Declare a provider's name, fields, environment mappings, and defaults there; maintain `shared/realtime-model-catalog.mjs` when selectable models are available. The desktop chooser, form, configuration persistence, and status labels consume these definitions without provider-specific HTML panels.
61
+ Built-in frontend settings live in `shared/realtime-provider-definitions.mjs`, a browser-safe catalog without credentials or connection implementations. Declare a provider's name, configurable fields, and defaults there. All providers share the active connection's `QWEN_AUDIO_REALTIME_*` environment fields; adding a provider does not require another set of credential, model, URL, and voice variables. Provider-specific model and API data live in `shared/realtime-models/dashscope.mjs`, `stepfun.mjs`, `gpt-live.mjs`, `google-live.mjs`, and `doubao-seeduplex.mjs`; `shared/realtime-model-catalog.mjs` is their public facade. These code-owned records define model IDs, API bindings, capabilities, session defaults, and constraints. Aggregation and resolution contain no provider-specific configuration. The desktop model dropdown uses the resulting static supported-model list; it does not accept user-defined model records or infer support from a free-form model name.
59
62
 
60
- The form always displays Service URL, API Key, Model, and Voice, mapped to the `endpoint`, `credential`, `model`, and `voice` slots. Providers bind only configurable slots; unbound rows remain visible but disabled and are never persisted. Bearer tokens use the API Key row while keeping their original configuration keys. Use `activeDefault` for suggested self-hosted endpoints on selection and `modelFamily` for independent voice overrides. Existing configuration keys and aliases are preserved; inactive endpoint drafts cannot block applying the selected provider. A remote Gateway continues to own its frontend configuration.
63
+ The form displays Service URL, API Key, Model, and Voice, mapped to the `endpoint`, `credential`, `model`, and `voice` slots. Providers expose only configurable slots; upstream-owned model and voice controls remain disabled. Bearer tokens use the API Key field. Switching provider must clear or replace the previous connection's values rather than send its credential to another service. Legacy variable names are handled at the configuration-read boundary, not in adapters. A remote Gateway continues to own its frontend configuration.
61
64
 
62
65
  Settings metadata is separate from runtime adapters. Host-injected custom Providers are not automatically registered in the desktop chooser.
@@ -2,6 +2,8 @@
2
2
 
3
3
  Realtime Provider 是运行时与实时模型服务之间的适配器,不是客户端,也不是编排运行时本身。业务宿主可以注入自定义 Provider,而不必修改通用会话与后台工作逻辑。下面通过 Gateway 应用入口进行装配。
4
4
 
5
+ 为已有供应商新增模型支持时,在 `shared/realtime-models/` 下对应的供应商数据文件中维护并补充测试。模型定义与适配参数属于框架代码,不是用户配置;用户只需[选择受支持模型](../configuration/frontend.zh.md#选择受支持模型)。
6
+
5
7
  ```js
6
8
  import { createGatewayApplication } from 'qwen-audio-agent/gateway-application'
7
9
  import {
@@ -25,13 +27,14 @@ createGatewayApplication({
25
27
  - 每个 Provider 都是独立适配器,完整拥有自己的 URL、认证、模型、Session 和错误分类语义;不要通过改造另一个 Provider 来承载业务差异。
26
28
  - `url()`、`headers()`、`model()` 可从宿主配置闭包读取服务地址、令牌和模型;Gateway 不要求为业务 Provider 增加环境变量。
27
29
  - `createProtocol()` 每条 Realtime 连接调用一次,适合生成连接级 ID 和隔离状态。
28
- - 可选的同步 `validateSessionOptions({ sessionOptions })` 在上游连接前执行;只拒绝已确认无效的配置,未知值交给服务端验证。
30
+ - 可选的同步 `validateSessionOptions({ sessionOptions })` 在上游连接前执行;拒绝已确认无效的服务参数,其他服务特有参数仍需上游验证。这不绕过受支持模型 ID 的目录检查。
29
31
  - `connectionMessages()` 在 WebSocket 打开后、`session.update` 之前发送原始握手帧。
30
32
  - 其余事件通过 `encodeOutgoing()` 与 `normalizeIncoming()` 转换,Gateway 的工具调用、任务和客户端协议保持不变。
31
33
  - 不支持临时回复指令的协议可实现 `responseInstructionsItem(response)`,将内部回复指令转为普通对话项。Gateway 等待确认后调用 `responseCreate(response)`,后者负责去掉上游不支持的参数。此时 `perResponseInstructions` 为 `false`,指令会进入会话历史。
32
34
  - `conversationItemCreate(item, { contextOnly })` 区分上下文投递和用户交互输入。对于消息项,`contextOnly: true` 必须写入上下文且不触发回复,不能只缓存到下一次 `responseCreate`;用户主动发送文本或文件时,Gateway 传入 `false`。工具回执仍遵循供应商原生的续答语义。
33
35
  - 仅当工具结果会由服务原生续答时声明 `automaticToolResponses: true`(豆包 Seeduplex、Google Live)。运行时发送这类回执不等待当前响应结束;工具批次结束时通过 `ensureResponse(..., { afterToolResults: true })` 避免再次请求回复。`sendFunctionOutput` 返回 `{ delivered: true, automatic: true }` 只表示回执已投递,不表示播报完成。`createResponse: false` 不能禁止服务原生续答,单次回复指令也不能控制它。其他 Provider 保持显式请求回复和完成跟踪。
34
36
  - 只表示响应仍在进行的事件可转换为带 `response_id` 的 `response.activity`,无需转发原始思考内容。
37
+ - 带 `response_id` 的 `error` 只结算它点名的那个回复;失败属于前端正在等待的请求时不要带 id,以回落到唯一等待者。
35
38
  - 服务端确认对话项时会重分配 ID 的 Provider,应声明 `conversationItemIdEcho: false`;网关按唯一待确认项关联,无需增加延时或跳过确认。
36
39
  - 仅当服务要求首帧视频之前必须先有音频时,声明 `imageRequiresAudioStart: true`;网关用 20 毫秒 PCM16 静音初始化时间线,视频输入无需开启麦克风。
37
40
  - 服务接受输入或工具结果但不返回 conversation-item 确认事件时,应声明 `acknowledgesConversationItems: false`;Gateway 写出 frame 后即完成本次发送。
@@ -54,8 +57,8 @@ Provider 和 Protocol 会在注册与建连时校验;缺少方法或返回无
54
57
 
55
58
  ## 桌面设置
56
59
 
57
- 仓库内置前台的设置统一定义在 `shared/realtime-provider-definitions.mjs`,它不依赖 Node.js,也不包含密钥值或连接实现。新增内置前台时,在这里声明名称、字段、环境变量映射和默认值;有可选模型时,同时维护 `shared/realtime-model-catalog.mjs`。桌面选择器、表单、配置读写和状态名称会消费这些定义,无需新增供应商 HTML 面板。
60
+ 仓库内置前台的设置统一定义在 `shared/realtime-provider-definitions.mjs`,它不依赖 Node.js,也不包含密钥值或连接实现。在这里声明供应商名称、可配置字段和默认值。各供应商共用当前连接的 `QWEN_AUDIO_REALTIME_*` 环境变量,不需再新增一套 Key、模型、地址和音色变量。供应商专属模型和 API 数据分别位于 `shared/realtime-models/dashscope.mjs`、`stepfun.mjs`、`gpt-live.mjs`、`google-live.mjs`、`doubao-seeduplex.mjs`,`shared/realtime-model-catalog.mjs` 是公共入口。这些代码数据定义模型 ID、API 绑定、能力、会话默认参数和接入约束,聚合与解析层不包含供应商具体配置。桌面模型下拉框使用生成的静态支持列表,不接受用户自定义模型记录,也不通过自由输入的模型名称推断支持情况。
58
61
 
59
- 界面固定显示“服务地址、API Key、模型、音色”四行,分别对应 `endpoint`、`credential`、`model`、`voice` 配置槽位。Provider 只声明可配置槽位的绑定;未绑定的行仍显示,但禁用且不写入配置。Bearer 令牌统一显示在 API Key 行,保留原有配置键。`activeDefault` 用于选中自部署服务时填入建议地址;`modelFamily` 用于保留不同模型系列的独立音色配置。已有配置键及别名不变,未选中前台的草稿不参与当前地址校验。连接远端 Gateway 时,仍由远端管理前台配置。
62
+ 界面显示“服务地址、API Key、模型、音色”四行,分别对应 `endpoint`、`credential`、`model`、`voice` 配置槽位。Provider 只暴露可配置槽位;由上游管理的模型、音色保持禁用。Bearer 令牌使用 API Key 字段。切换供应商时应清空或替换旧连接值,不能将旧凭据发送给另一家服务。旧变量别名只在配置读取边界处理,不进入 Adapter。连接远端 Gateway 时,仍由远端管理前台配置。
60
63
 
61
64
  这份设置定义与运行时适配器分离;宿主注入的自定义 Provider 不会自动注册到桌面设置页。
@@ -11,15 +11,17 @@ Edit the user configuration file shown by `qwenaudio config`:
11
11
 
12
12
  ```dotenv
13
13
  QWEN_AUDIO_REALTIME_PROVIDER=google-live
14
- GOOGLE_API_KEY=your-google-api-key
14
+ QWEN_AUDIO_REALTIME_API_KEY=your-google-api-key
15
+ QWEN_AUDIO_REALTIME_MODEL=gemini-3.8-live
16
+ QWEN_AUDIO_REALTIME_URL=
17
+ QWEN_AUDIO_REALTIME_VOICE=
15
18
  ```
16
19
 
17
20
  | Optional setting | Default | Description |
18
21
  | --- | --- | --- |
19
- | `GOOGLE_LIVE_REALTIME_URL` / `GEMINI_LIVE_REALTIME_URL` | `wss://generativelanguage.googleapis.com/ws/google.ai.generativelanguage.v1beta.GenerativeService.BidiGenerateContent` | WebSocket endpoint |
20
- | `GOOGLE_LIVE_REALTIME_MODEL` / `GEMINI_LIVE_REALTIME_MODEL` | `gemini-3.8-live` | Current built-in model profile |
21
- | `GOOGLE_LIVE_REALTIME_VOICE` / `GEMINI_LIVE_REALTIME_VOICE` | Empty | Service default, or a prebuilt Gemini Live voice name |
22
- | `GEMINI_API_KEY` / `GOOGLE_LIVE_API_KEY` | Empty | Aliases for `GOOGLE_API_KEY` |
22
+ | `QWEN_AUDIO_REALTIME_URL` | `wss://generativelanguage.googleapis.com/ws/google.ai.generativelanguage.v1beta.GenerativeService.BidiGenerateContent` | WebSocket endpoint |
23
+ | `QWEN_AUDIO_REALTIME_MODEL` | `gemini-3.8-live` | Current built-in model profile |
24
+ | `QWEN_AUDIO_REALTIME_VOICE` | Empty | Service default, or a prebuilt Gemini Live voice name |
23
25
 
24
26
  Desktop exposes the same fields under **Voice frontend -> Google Live**.
25
27
  Restart a terminal Gateway after editing the file; for an installed service,
@@ -10,15 +10,17 @@ Adapter 只把 Gemini Live 的双向流协议转换成项目内统一的 Realtim
10
10
 
11
11
  ```dotenv
12
12
  QWEN_AUDIO_REALTIME_PROVIDER=google-live
13
- GOOGLE_API_KEY=your-google-api-key
13
+ QWEN_AUDIO_REALTIME_API_KEY=your-google-api-key
14
+ QWEN_AUDIO_REALTIME_MODEL=gemini-3.8-live
15
+ QWEN_AUDIO_REALTIME_URL=
16
+ QWEN_AUDIO_REALTIME_VOICE=
14
17
  ```
15
18
 
16
19
  | 可选配置 | 默认值 | 说明 |
17
20
  | --- | --- | --- |
18
- | `GOOGLE_LIVE_REALTIME_URL` / `GEMINI_LIVE_REALTIME_URL` | `wss://generativelanguage.googleapis.com/ws/google.ai.generativelanguage.v1beta.GenerativeService.BidiGenerateContent` | WebSocket 端点 |
19
- | `GOOGLE_LIVE_REALTIME_MODEL` / `GEMINI_LIVE_REALTIME_MODEL` | `gemini-3.8-live` | 当前内置模型档案 |
20
- | `GOOGLE_LIVE_REALTIME_VOICE` / `GEMINI_LIVE_REALTIME_VOICE` | 空 | 使用服务默认音色,或填写 Gemini Live 预置音色名 |
21
- | `GEMINI_API_KEY` / `GOOGLE_LIVE_API_KEY` | 空 | `GOOGLE_API_KEY` 的别名 |
21
+ | `QWEN_AUDIO_REALTIME_URL` | `wss://generativelanguage.googleapis.com/ws/google.ai.generativelanguage.v1beta.GenerativeService.BidiGenerateContent` | WebSocket 端点 |
22
+ | `QWEN_AUDIO_REALTIME_MODEL` | `gemini-3.8-live` | 当前内置模型档案 |
23
+ | `QWEN_AUDIO_REALTIME_VOICE` | 空 | 使用服务默认音色,或填写 Gemini Live 预置音色名 |
22
24
 
23
25
  桌面端在 **语音前台 -> Google Live** 下暴露同样字段。终端 Gateway 修改文件后需重启;
24
26
  若是已安装的后台服务,执行 `qwenaudio gateway restart`。
@@ -11,15 +11,17 @@ Edit the user configuration file shown by `qwenaudio config`:
11
11
 
12
12
  ```dotenv
13
13
  QWEN_AUDIO_REALTIME_PROVIDER=gpt-live
14
- OPENAI_API_KEY=your-openai-key
14
+ QWEN_AUDIO_REALTIME_API_KEY=your-openai-key
15
+ QWEN_AUDIO_REALTIME_MODEL=gpt-realtime-2.1
16
+ QWEN_AUDIO_REALTIME_URL=
17
+ QWEN_AUDIO_REALTIME_VOICE=
15
18
  ```
16
19
 
17
20
  | Optional setting | Default | Description |
18
21
  | --- | --- | --- |
19
- | `GPT_LIVE_REALTIME_URL` / `OPENAI_REALTIME_URL` | `wss://api.openai.com/v1/realtime` | WebSocket endpoint |
20
- | `GPT_LIVE_REALTIME_MODEL` / `OPENAI_REALTIME_MODEL` | `gpt-realtime-2.1` | Current built-in model profile |
21
- | `GPT_LIVE_REALTIME_VOICE` / `OPENAI_REALTIME_VOICE` | Empty | Service default, or a voice ID supported by the model |
22
- | `GPT_LIVE_API_KEY` | Empty | Alias for `OPENAI_API_KEY` when the realtime frontend needs a separate credential |
22
+ | `QWEN_AUDIO_REALTIME_URL` | `wss://api.openai.com/v1/realtime` | WebSocket endpoint |
23
+ | `QWEN_AUDIO_REALTIME_MODEL` | `gpt-realtime-2.1` | Current built-in model profile |
24
+ | `QWEN_AUDIO_REALTIME_VOICE` | Empty | Service default, or a voice ID supported by the model |
23
25
 
24
26
  Desktop exposes the same fields under **Voice frontend → GPT-Live**. Restart a
25
27
  terminal Gateway after editing the file; for an installed service, run
@@ -10,15 +10,17 @@ Gateway 仍负责前台工具、记忆、提醒、任务委派和后台 Agent
10
10
 
11
11
  ```dotenv
12
12
  QWEN_AUDIO_REALTIME_PROVIDER=gpt-live
13
- OPENAI_API_KEY=your-openai-key
13
+ QWEN_AUDIO_REALTIME_API_KEY=your-openai-key
14
+ QWEN_AUDIO_REALTIME_MODEL=gpt-realtime-2.1
15
+ QWEN_AUDIO_REALTIME_URL=
16
+ QWEN_AUDIO_REALTIME_VOICE=
14
17
  ```
15
18
 
16
19
  | 可选配置 | 默认值 | 说明 |
17
20
  | --- | --- | --- |
18
- | `GPT_LIVE_REALTIME_URL` / `OPENAI_REALTIME_URL` | `wss://api.openai.com/v1/realtime` | WebSocket 端点 |
19
- | `GPT_LIVE_REALTIME_MODEL` / `OPENAI_REALTIME_MODEL` | `gpt-realtime-2.1` | 当前内置模型档案 |
20
- | `GPT_LIVE_REALTIME_VOICE` / `OPENAI_REALTIME_VOICE` | 空 | 使用服务默认音色,或填写模型支持的音色 ID |
21
- | `GPT_LIVE_API_KEY` | 空 | 当实时语音前台需要独立凭据时,作为 `OPENAI_API_KEY` 的别名 |
21
+ | `QWEN_AUDIO_REALTIME_URL` | `wss://api.openai.com/v1/realtime` | WebSocket 端点 |
22
+ | `QWEN_AUDIO_REALTIME_MODEL` | `gpt-realtime-2.1` | 当前内置模型档案 |
23
+ | `QWEN_AUDIO_REALTIME_VOICE` | 空 | 使用服务默认音色,或填写模型支持的音色 ID |
22
24
 
23
25
  桌面端在 **语音前台 -> GPT-Live** 下暴露同样字段。终端 Gateway 修改文件后需重启;
24
26
  若是已安装的后台服务,执行 `qwenaudio gateway restart`。
@@ -15,14 +15,18 @@ Set the provider and endpoint after the service is ready:
15
15
 
16
16
  ```bash
17
17
  QWEN_AUDIO_REALTIME_PROVIDER=minicpm-o
18
- MINICPM_O_REALTIME_URL=ws://127.0.0.1:8006/v1/realtime?mode=audio
18
+ QWEN_AUDIO_REALTIME_URL=ws://127.0.0.1:8006/v1/realtime?mode=audio
19
+ QWEN_AUDIO_REALTIME_API_KEY=
20
+ QWEN_AUDIO_REALTIME_MODEL=
21
+ QWEN_AUDIO_REALTIME_VOICE=
19
22
  ```
20
23
 
21
24
  The default assumes the upstream Gateway was started with `--http` on the loopback interface.
22
25
  For ModelBest cloud or another TLS deployment, set its corresponding `wss://` endpoint instead.
23
- `MINICPM_O_AUTH_TOKEN` is sent as a Bearer token when the endpoint requires one. The same fields
26
+ `QWEN_AUDIO_REALTIME_API_KEY` is sent as a Bearer token when the endpoint requires one. The same fields
24
27
  are available in Desktop Settings under **Voice frontend → ModelBest**, where the model is shown
25
- as the fixed `MiniCPM-o 4.5`.
28
+ as the fixed `MiniCPM-o 4.5`. Model and voice selection belong to the upstream service;
29
+ leave those Gateway fields empty.
26
30
 
27
31
  The adapter converts the clients' 16-bit PCM stream to the protocol's 16 kHz mono float32 input,
28
32
  converts its 24 kHz mono float32 output back to 16-bit PCM, and maps MiniCPM-o session and response
@@ -34,7 +38,7 @@ Use MiniCPM-o's video full-duplex endpoint to enable the negotiated WebUI
34
38
  visual-frame stream:
35
39
 
36
40
  ```bash
37
- MINICPM_O_REALTIME_URL=ws://127.0.0.1:8006/v1/realtime?mode=video
41
+ QWEN_AUDIO_REALTIME_URL=ws://127.0.0.1:8006/v1/realtime?mode=video
38
42
  ```
39
43
 
40
44
  The public GCP shape remains `input_image_buffer.append`. The MiniCPM-o adapter
@@ -14,13 +14,16 @@ ws://127.0.0.1:8006/v1/realtime?mode=audio
14
14
 
15
15
  ```bash
16
16
  QWEN_AUDIO_REALTIME_PROVIDER=minicpm-o
17
- MINICPM_O_REALTIME_URL=ws://127.0.0.1:8006/v1/realtime?mode=audio
17
+ QWEN_AUDIO_REALTIME_URL=ws://127.0.0.1:8006/v1/realtime?mode=audio
18
+ QWEN_AUDIO_REALTIME_API_KEY=
19
+ QWEN_AUDIO_REALTIME_MODEL=
20
+ QWEN_AUDIO_REALTIME_VOICE=
18
21
  ```
19
22
 
20
23
  默认地址假设上游 Gateway 以 `--http` 方式监听本机回环地址;连接面壁智能云端或其他
21
24
  TLS 部署时,改为对应的 `wss://` 地址。服务要求 Bearer 认证时,可用
22
- `MINICPM_O_AUTH_TOKEN` 配置令牌。桌面版在“语音前台 → 面壁智能”中填写相同配置,
23
- 模型固定显示为 `MiniCPM-o 4.5`。
25
+ `QWEN_AUDIO_REALTIME_API_KEY` 配置令牌。桌面版在“语音前台 → 面壁智能”中填写相同配置,
26
+ 模型固定显示为 `MiniCPM-o 4.5`。模型和音色由上游服务配置,Gateway 中这两个字段留空。
24
27
 
25
28
  Adapter 会把客户端的 16-bit PCM 转换成协议要求的 16 kHz 单声道 float32 输入,将 24 kHz
26
29
  单声道 float32 输出转换回 16-bit PCM,并把 MiniCPM-o 的 Session 和响应事件映射到统一的
@@ -31,7 +34,7 @@ Realtime Runtime。
31
34
  要启用协商后的 WebUI 视觉帧流,需要使用 MiniCPM-o 的视频全双工端点:
32
35
 
33
36
  ```bash
34
- MINICPM_O_REALTIME_URL=ws://127.0.0.1:8006/v1/realtime?mode=video
37
+ QWEN_AUDIO_REALTIME_URL=ws://127.0.0.1:8006/v1/realtime?mode=video
35
38
  ```
36
39
 
37
40
  公开 GCP 仍使用统一的 `input_image_buffer.append`。MiniCPM-o Adapter 只保留最近一张
@@ -1,50 +1,72 @@
1
- # Qwen Audio 3.0 Realtime
1
+ # Qwen Audio Realtime
2
2
 
3
- The default voice frontend: DashScope's Qwen Audio 3.0 Realtime family,
4
- purpose-built for speech-to-speech conversation. This is what you get when
5
- you install qwen-audio-agent and only set an API key.
3
+ DashScope's Qwen Audio 3.0 and 3.1 Realtime models are purpose-built for
4
+ speech-to-speech conversation. The default is Qwen Audio 3.1 Realtime
5
+ Plus when you install qwen-audio-agent and only set an API key.
6
6
 
7
7
  ## Models
8
8
 
9
+ The built-in Audio models are:
10
+
9
11
  | Model | Notes |
10
12
  | --- | --- |
11
- | `qwen-audio-3.0-realtime-plus` | **Default.** Higher quality |
13
+ | `qwen-audio-3.1-realtime-plus` | **Default.** Uses `longanqian_v3.1` by default |
14
+ | `qwen-audio-3.1-realtime-flash` | Uses `longanqian_v3.1` by default |
15
+ | `qwen-audio-3.0-realtime-plus` | Previous-generation Plus model, still available |
12
16
  | `qwen-audio-3.0-realtime-flash` | Lower latency, lower cost |
13
17
 
14
- Both accept text and audio input, produce text and audio output, and
18
+ All accept text and audio input, produce text and audio output, and
15
19
  support Function Calling (which is how the Gateway's frontend tools —
16
20
  task delegation, memory, reminders — reach the model).
17
21
 
18
22
  ## Setup
19
23
 
20
24
  ```dotenv
21
- DASHSCOPE_API_KEY=your-key
22
- QWEN_AUDIO_REALTIME_MODEL=qwen-audio-3.0-realtime-plus
25
+ QWEN_AUDIO_REALTIME_PROVIDER=dashscope
26
+ QWEN_AUDIO_REALTIME_API_KEY=your-key
27
+ QWEN_AUDIO_REALTIME_MODEL=qwen-audio-3.1-realtime-plus
28
+ QWEN_AUDIO_REALTIME_URL=
29
+ QWEN_AUDIO_REALTIME_VOICE=
23
30
  ```
24
31
 
25
- `DASHSCOPE_API_KEY` is used only by DashScope; other providers have their own credentials.
32
+ All frontends use the same [connection fields](../configuration/frontend.md#connection-fields); the selected provider determines how the credential is used.
26
33
 
27
34
  One Gateway owns one active model. Switch it from the Desktop settings
28
35
  page or from the CLI, then restart the Gateway:
29
36
 
30
37
  ```bash
31
- qwenaudio config set --realtime-model qwen-audio-3.0-realtime-flash
38
+ qwenaudio config set --realtime-model qwen-audio-3.1-realtime-flash
32
39
  # For an installed user background service only:
33
40
  qwenaudio gateway restart
34
41
  ```
35
42
 
43
+ 3.1 Plus / Flash reuse the `dashscope` provider and the existing WebSocket event
44
+ protocol. An explicitly configured 3.0 model remains selected until you change
45
+ or clear its model setting. If you have explicitly set a voice, choose one matching the model
46
+ or clear the override to use its default. See the [official migration guidance](https://help.aliyun.com/zh/model-studio/qwen-audio-realtime-user-guides).
47
+
36
48
  WebUI and TUI only display the active model; they never override it.
37
49
 
50
+ The supported model list and each model's adaptation parameters are maintained
51
+ in framework code. Users select a model; they do not add model records or tune
52
+ API bindings, capabilities, or turn detection. The default remains 3.1 Plus.
53
+ Built-in support does not verify live account access; confirm availability for
54
+ your account and endpoint. See the
55
+ [configuration reference](../configuration/frontend.md#select-a-supported-model).
56
+
38
57
  ## Voice and turn detection
39
58
 
40
- - Default voice: `longanqian` — override with `QWEN_AUDIO_REALTIME_VOICE`.
59
+ - Default voice: `longanqian_v3.1` for 3.1 Plus / Flash;
60
+ `longanqian` for 3.0 Plus / Flash. Override with `QWEN_AUDIO_REALTIME_VOICE` using a voice supported
61
+ by the selected model.
41
62
  - A GCP client may provide a session-scoped voice in
42
63
  `connection.output_voice` on its initial `session.hello`. It takes precedence
43
64
  over the environment default. At runtime, call
44
65
  `GatewayClient.updateOutputVoice(voice)`; the Gateway rebuilds the upstream
45
66
  Realtime Session while preserving the Client connection and Gateway session.
46
- - Turn detection: `smart_turn` (semantic end-of-turn), configured by the
47
- runtime; no manual VAD tuning is exposed.
67
+ - Turn detection: `smart_turn_v2` for 3.1 Plus / Flash; `smart_turn` for 3.0 Plus / Flash.
68
+ The framework selects the fixed mode for the chosen model. Turn detection and
69
+ VAD parameters are not user-configurable.
48
70
 
49
71
  ## Endpoint overrides
50
72
 
@@ -52,9 +74,12 @@ For private deployments or proxies:
52
74
 
53
75
  | Setting | Effect |
54
76
  | --- | --- |
55
- | `QWEN_AUDIO_REALTIME_BASE_URL` / `QWEN_AUDIO_REALTIME_URL` | Replace the DashScope Realtime endpoint |
77
+ | `QWEN_AUDIO_REALTIME_URL` | Replace the DashScope Realtime endpoint |
56
78
  | `DASHSCOPE_WORKSPACE_ID` | Switch to a Bailian dedicated-workspace endpoint (`wss://<workspace-id>.cn-beijing.maas.aliyuncs.com/...`) |
57
79
 
80
+ For workspace-specific access, use the existing workspace setting or base URL
81
+ override with the endpoint supplied for your region and workspace.
82
+
58
83
  The transport runs 16 kHz PCM input and 24 kHz PCM output over a single
59
84
  WebSocket.
60
85