qwen-audio-agent 2.0.1 → 2.2.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.
- package/README.md +21 -10
- package/README_ZH.md +19 -10
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/cli/package.json +1 -1
- package/cli/src/arguments.mjs +4 -1
- package/cli/src/config-command.mjs +36 -6
- package/cli/src/gateway-service.mjs +7 -1
- package/cli/src/launcher.mjs +13 -0
- package/config/frontend-agent/LIVE_PROMPT.md +64 -0
- package/config/frontend-agent/PROMPT.md +29 -26
- package/desktop/src/i18n.mjs +6 -1
- package/desktop/src/settings-config.mjs +32 -40
- package/desktop/src/settings-store.mjs +19 -28
- package/docs/architecture/deep-dive.md +103 -66
- package/docs/architecture/deep-dive.zh.md +73 -50
- package/docs/backends/configuration.md +4 -4
- package/docs/backends/configuration.zh.md +4 -4
- package/docs/backends/overview.md +3 -0
- package/docs/backends/overview.zh.md +3 -0
- package/docs/configuration/backend.md +15 -1
- package/docs/configuration/backend.zh.md +15 -1
- package/docs/configuration/frontend.md +78 -28
- package/docs/configuration/frontend.zh.md +76 -28
- package/docs/configuration.md +1 -1
- package/docs/configuration.zh.md +1 -1
- package/docs/contract.md +24 -2
- package/docs/contract.zh.md +20 -2
- package/docs/extensions.md +14 -0
- package/docs/extensions.zh.md +11 -0
- package/docs/gateway-protocol.md +26 -0
- package/docs/gateway-protocol.zh.md +22 -0
- package/docs/gateway-webrtc-client.md +3 -3
- package/docs/gateway-webrtc-client.zh.md +3 -3
- package/docs/getting-started/install.md +4 -1
- package/docs/getting-started/install.zh.md +4 -1
- package/docs/getting-started/mobile.md +8 -2
- package/docs/getting-started/mobile.zh.md +5 -0
- package/docs/getting-started/quickstart.md +2 -2
- package/docs/getting-started/quickstart.zh.md +2 -2
- package/docs/getting-started/webui.md +2 -0
- package/docs/getting-started/webui.zh.md +2 -0
- package/docs/guides/knowledge.md +8 -5
- package/docs/guides/knowledge.zh.md +4 -3
- package/docs/guides/tasks.md +63 -2
- package/docs/guides/tasks.zh.md +45 -1
- package/docs/guides/web-search.md +32 -1
- package/docs/guides/web-search.zh.md +28 -1
- package/docs/operations/troubleshooting.md +30 -0
- package/docs/operations/troubleshooting.zh.md +26 -0
- package/docs/reference/backend-adapter-sdk.md +33 -2
- package/docs/reference/backend-adapter-sdk.zh.md +29 -2
- package/docs/reference/cli.md +3 -3
- package/docs/reference/cli.zh.md +3 -3
- package/docs/scenarios/lightrag.md +2 -2
- package/docs/scenarios/lightrag.zh.md +2 -2
- package/docs/scenarios/x-omni.md +5 -2
- package/docs/scenarios/x-omni.zh.md +5 -2
- package/docs/voice-agent-architecture-presentation.zh.md +34 -37
- package/docs/voice-frontends/custom-provider.md +22 -4
- package/docs/voice-frontends/custom-provider.zh.md +22 -4
- package/docs/voice-frontends/google-live.md +14 -8
- package/docs/voice-frontends/google-live.zh.md +13 -8
- package/docs/voice-frontends/gpt-live-1.md +149 -0
- package/docs/voice-frontends/gpt-live-1.zh.md +114 -0
- package/docs/voice-frontends/minicpm-o.md +8 -4
- package/docs/voice-frontends/minicpm-o.zh.md +7 -4
- package/docs/voice-frontends/{gpt-live.md → openai-realtime.md} +19 -10
- package/docs/voice-frontends/{gpt-live.zh.md → openai-realtime.zh.md} +18 -10
- package/docs/voice-frontends/qwen-audio-live.md +164 -0
- package/docs/voice-frontends/qwen-audio-live.zh.md +122 -0
- package/docs/voice-frontends/qwen-audio-realtime.md +41 -15
- package/docs/voice-frontends/qwen-audio-realtime.zh.md +34 -12
- package/docs/voice-frontends/qwen-omni-realtime.md +12 -9
- package/docs/voice-frontends/qwen-omni-realtime.zh.md +12 -9
- package/docs/voice-frontends/speech-to-speech.md +8 -4
- package/docs/voice-frontends/speech-to-speech.zh.md +7 -3
- package/docs/voice-frontends/stepfun.md +7 -4
- package/docs/voice-frontends/stepfun.zh.md +7 -4
- package/examples/webrtc/start.mjs +2 -1
- package/package.json +34 -16
- package/scripts/audit-dependencies.mjs +3 -25
- package/scripts/electron-smoke.mjs +5 -5
- package/scripts/patch-build-node-gyp.mjs +63 -0
- package/scripts/prepare-build.mjs +2 -0
- package/scripts/release-check +2 -2
- package/scripts/runtime/claude-code-acp.mjs +5 -5
- package/scripts/verify-package.mjs +3 -0
- package/server/package.json +5 -5
- package/server/src/app/gateway-application.mjs +3 -0
- package/server/src/app/gateway-http-routes.mjs +3 -0
- package/server/src/app/session-conversation-history.mjs +9 -1
- package/server/src/backend/adapters/a2a/backend-adapter.mjs +32 -26
- package/server/src/backend/adapters/acp/backend-adapter.mjs +703 -251
- package/server/src/backend/adapters/acp/coordinator-contract.mjs +2 -13
- package/server/src/backend/adapters/acp/coordinator-instructions.mjs +29 -8
- package/server/src/backend/adapters/acp/coordinator-queue.mjs +58 -0
- package/server/src/backend/adapters/acp/drivers/codex.mjs +1 -1
- package/server/src/backend/adapters/acp/drivers/openclaw.mjs +1 -2
- package/server/src/backend/adapters/acp/input-broker.mjs +2 -0
- package/server/src/backend/adapters/acp/process-client.mjs +111 -16
- package/server/src/backend/adapters/acp/session-configuration.mjs +2 -19
- package/server/src/backend/adapters/acp/session-registry.mjs +9 -0
- package/server/src/backend/adapters/acp/session-tools.mjs +1 -1
- package/server/src/backend/adapters/acp/turn-updates.mjs +188 -0
- package/server/src/backend/adapters/acp/work-continuation.mjs +48 -0
- package/server/src/backend/adapters/agent-client.mjs +24 -1
- package/server/src/backend/adapters/llm/backend-adapter.mjs +393 -0
- package/server/src/backend/adapters/muse/backend-adapter.mjs +2 -0
- package/server/src/backend/availability.mjs +12 -3
- package/server/src/backend/backend-adapter-sdk.mjs +3 -0
- package/server/src/backend/backend-port.mjs +13 -0
- package/server/src/backend/backend-work-runtime.mjs +23 -0
- package/server/src/client/client-command-runtime.mjs +14 -0
- package/server/src/conversation/conversation-sync.mjs +26 -2
- package/server/src/conversation/frontend-agent-context.mjs +18 -5
- package/server/src/conversation/frontend-notes.mjs +7 -5
- package/server/src/conversation/task-result-projector.mjs +1 -1
- package/server/src/core/backend-events.mjs +4 -0
- package/server/src/core/citation.mjs +8 -2
- package/server/src/core/config.mjs +46 -54
- package/server/src/core/gateway-protocol.mjs +4 -1
- package/server/src/core/request-security.mjs +7 -1
- package/server/src/core/work-conversation-context.mjs +138 -0
- package/server/src/core/work-input-request.mjs +1 -0
- package/server/src/frontend/frontend-tools.mjs +20 -7
- package/server/src/frontend/retrieval/providers/bing.mjs +23 -12
- package/server/src/frontend/retrieval/providers/factory.mjs +18 -1
- package/server/src/frontend/retrieval/providers/mcp.mjs +30 -11
- package/server/src/frontend/retrieval/providers/so360.mjs +23 -12
- package/server/src/frontend/tools/agent-task-runtime.mjs +119 -99
- package/server/src/frontend/tools/features/agent-task-tools.mjs +23 -42
- package/server/src/frontend/tools/frontend-tool-context.mjs +2 -2
- package/server/src/frontend/tools/spawn-thinking-tool.mjs +2 -2
- package/server/src/frontend/tools/tool-call-handler.mjs +166 -86
- package/server/src/knowledge/providers/local/library.mjs +26 -6
- package/server/src/knowledge/providers/local/provider.mjs +25 -6
- package/server/src/memory/providers/markdown/context-store.mjs +24 -11
- package/server/src/orchestration/session-task-coordinator.mjs +13 -3
- package/server/src/orchestration/task-operations.mjs +54 -12
- package/server/src/orchestration/task-updates.mjs +82 -0
- package/server/src/task/reminder-scheduler.mjs +5 -1
- package/server/src/task/task-manager.mjs +72 -15
- package/server/src/task/task-recovery.mjs +12 -2
- package/server/src/task/task-scheduler.mjs +5 -5
- package/server/src/task/task-state.mjs +13 -0
- package/server/src/transport/gateway-client-transport.mjs +35 -0
- package/server/src/transport/webrtc/protocol.mjs +1 -1
- package/server/src/voice/announcement/announcement-manager.mjs +3 -0
- package/server/src/voice/audio-stream-diagnostics.mjs +139 -0
- package/server/src/voice/native-delegation-runtime.mjs +360 -0
- package/server/src/voice/providers/dashscope-live.mjs +93 -0
- package/server/src/voice/providers/dashscope.mjs +45 -33
- package/server/src/voice/providers/doubao-seeduplex-protocol.mjs +54 -0
- package/server/src/voice/providers/doubao-seeduplex.mjs +16 -11
- package/server/src/voice/providers/ga-protocol.mjs +7 -2
- package/server/src/voice/providers/google-live-protocol.mjs +124 -34
- package/server/src/voice/providers/google-live.mjs +20 -14
- package/server/src/voice/providers/gpt-live-1-protocol.mjs +597 -0
- package/server/src/voice/providers/gpt-live-1.mjs +3 -0
- package/server/src/voice/providers/gpt-live-client-context.mjs +182 -0
- package/server/src/voice/providers/minicpm-o.mjs +9 -7
- package/server/src/voice/providers/openai-live.mjs +150 -0
- package/server/src/voice/providers/{gpt-live.mjs → openai-realtime.mjs} +23 -19
- package/server/src/voice/providers/provider-registry.mjs +11 -1
- package/server/src/voice/providers/qwen-live-protocol.mjs +399 -0
- package/server/src/voice/providers/registry.mjs +47 -12
- package/server/src/voice/providers/runtime-configuration.mjs +34 -0
- package/server/src/voice/providers/s2s.mjs +9 -7
- package/server/src/voice/providers/stepfun.mjs +14 -11
- package/server/src/voice/realtime-input-runtime.mjs +58 -20
- package/server/src/voice/realtime-presentation-runtime.mjs +111 -27
- package/server/src/voice/realtime-provider-session.mjs +59 -14
- package/server/src/voice/realtime-provider.mjs +358 -45
- package/server/src/voice/realtime-session-runtime.mjs +282 -35
- package/server/src/voice/realtime-task-presentation.mjs +8 -2
- package/server/src/voice/realtime-turn-state.mjs +33 -2
- package/shared/backend/catalog.mjs +26 -2
- package/shared/backend/install.mjs +3 -1
- package/shared/backend/setup.mjs +43 -0
- package/shared/gateway/client-sdk.mjs +21 -6
- package/shared/gateway/setup.mjs +13 -1
- package/shared/gateway/websocket-auth.mjs +2 -1
- package/shared/protocol/gateway-client-protocol.mjs +14 -0
- package/shared/protocol/gateway-events.mjs +39 -1
- package/shared/realtime-legacy-environment.mjs +81 -0
- package/shared/realtime-model-catalog.mjs +68 -194
- package/shared/realtime-models/README.md +33 -0
- package/shared/realtime-models/dashscope.mjs +57 -0
- package/shared/realtime-models/google.mjs +10 -0
- package/shared/realtime-models/openai.mjs +24 -0
- package/shared/realtime-models/profile.mjs +38 -0
- package/shared/realtime-models/stepfun.mjs +10 -0
- package/shared/realtime-models/volcengine.mjs +12 -0
- package/shared/realtime-provider-catalog.mjs +23 -11
- package/shared/realtime-provider-definitions.mjs +168 -235
- package/shared/runtime-environment.mjs +23 -30
- package/shared/skill-library.mjs +49 -13
- package/shared/web-search-configuration.mjs +25 -2
- package/tui/package.json +2 -2
- package/tui/src/index.mjs +14 -9
- package/tui/src/runtime-configuration.mjs +2 -0
- package/tui/src/terminal-commands.mjs +40 -0
- package/tui/src/text-cli.mjs +10 -1
- package/web/dist/assets/index-Bc2Q04J9.css +1 -0
- package/web/dist/assets/index-bY4DFXKT.js +96 -0
- package/web/dist/index.html +2 -2
- package/web/dist/assets/index-BRaiI-dW.js +0 -91
- package/web/dist/assets/index-D9k8R2JY.css +0 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# GPT-Live 1(OpenAI Live API)
|
|
2
|
+
|
|
3
|
+
GPT-Live 1 负责全双工语音对话。本集成采用 **Client 委派模式**:Gateway 把委派请求交给已配置的后台 Agent,
|
|
4
|
+
再把进度、追问和结果回传给 Live 会话,不使用 OpenAI 托管的 Responses 委派。
|
|
5
|
+
|
|
6
|
+
## 配置
|
|
7
|
+
|
|
8
|
+
编辑 `qwenaudio config` 显示的用户配置文件:
|
|
9
|
+
|
|
10
|
+
```dotenv
|
|
11
|
+
QWEN_AUDIO_REALTIME_PROVIDER=openai
|
|
12
|
+
QWEN_AUDIO_REALTIME_API_KEY=your-openai-key
|
|
13
|
+
QWEN_AUDIO_REALTIME_MODEL=gpt-live-1
|
|
14
|
+
QWEN_AUDIO_REALTIME_URL=
|
|
15
|
+
QWEN_AUDIO_REALTIME_VOICE=
|
|
16
|
+
|
|
17
|
+
# 示例:选择已经安装并完成登录的后台 Agent。
|
|
18
|
+
AGENT_PROTOCOL=qoder
|
|
19
|
+
QWEN_AUDIO_AGENT_BACKEND_PERMISSION_MODE=native
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
先选择并配置一个[后台 Agent](../backends/overview.zh.md)。执行委派任务需要后台可用;选择 `none` 时,
|
|
23
|
+
仅保留 Live 模型自身的对话能力,不会自动切换为云端后台执行。
|
|
24
|
+
|
|
25
|
+
| 可选配置 | 默认值 | 说明 |
|
|
26
|
+
| --- | --- | --- |
|
|
27
|
+
| `QWEN_AUDIO_REALTIME_URL` | `wss://api.openai.com/v1/live/sessions` | Live API WebSocket 端点 |
|
|
28
|
+
| `QWEN_AUDIO_REALTIME_VOICE` | 空 | 使用服务默认音色,或填写支持的音色 |
|
|
29
|
+
|
|
30
|
+
必须显式选择 `gpt-live-1`,因为 `openai` 的默认模型是 `gpt-realtime-2.1`。
|
|
31
|
+
模型定义会选择内部 `openai-live` Adapter,用户无需另行配置协议。
|
|
32
|
+
手动编辑文件从 Realtime 切换时,应清空或替换地址和音色覆盖。
|
|
33
|
+
原有的 `GPT_LIVE_1_DELEGATION_MODEL` 配置不再使用。
|
|
34
|
+
|
|
35
|
+
桌面端选择 **语音前台 → OpenAI → GPT-Live 1** 即可配置。
|
|
36
|
+
终端 Gateway 修改文件后需重启;若是已安装的后台服务,执行 `qwenaudio gateway restart`。
|
|
37
|
+
|
|
38
|
+
### 可选时间参数
|
|
39
|
+
|
|
40
|
+
Live 连续传输音频与转写片段,不提供 Realtime 风格的轮次边界。这些参数控制本地字幕和播放分段,
|
|
41
|
+
不用于判断后台任务是否完成。单位为毫秒,限制在 100–10,000;非数字的值会被忽略。
|
|
42
|
+
|
|
43
|
+
| 参数 | 默认值 | 说明 |
|
|
44
|
+
| --- | --- | --- |
|
|
45
|
+
| `GPT_LIVE_1_OUTPUT_IDLE_MS` | `1500` | 输出安静多久后结束一段展示中的回答 |
|
|
46
|
+
| `GPT_LIVE_1_WORD_GAP_MS` | `600` | 打断后用于区分新回答的文字间隔 |
|
|
47
|
+
| `GPT_LIVE_1_INPUT_SEGMENT_GAP_MS` | `1200` | 用于区分用户语句的语音间隔 |
|
|
48
|
+
| `GPT_LIVE_1_INPUT_IDLE_MS` | `2000` | 输入安静多久后结束当前用户语句 |
|
|
49
|
+
|
|
50
|
+
## 任务执行与授权
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
语音请求 → GPT-Live 原生委派
|
|
54
|
+
→ Gateway 任务 → 已配置的后台 Agent
|
|
55
|
+
← 进度 / 权限请求 / 结果
|
|
56
|
+
→ Live 上下文更新或语音播报
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
- **原生委派替代此模型的 `spawn_thinking` 入口。**云端委派事件只有标识和时间位置,不包含任务正文;
|
|
60
|
+
Gateway 根据转写与对话上下文组织后台请求。缺失或不完整的输入不能成为授权依据。
|
|
61
|
+
- **Gateway 仍管理任务。**任务状态、取消、授权和持久化结果继续使用现有任务系统。
|
|
62
|
+
打断语音不等于取消后台执行。
|
|
63
|
+
- **通过客户端控件明确授权。**在桌面端或 WebUI 的权限卡片中操作,或在 TUI 使用
|
|
64
|
+
`/approve [permission_id]`、`/reject [permission_id]`。有多个待确认请求时需填写展示的权限 ID;
|
|
65
|
+
`/approve` 仅授权所选任务,不授予整个会话权限。决定直接交给 Gateway 和等待中的后台,
|
|
66
|
+
无需再次调用模型。本版说出或输入“同意”均不会批准权限请求。
|
|
67
|
+
切换到 GPT-Live 不会开启自动授权,也不会改变已配置的后台权限策略。
|
|
68
|
+
- **等待追问不等于执行完成。**桌面悬浮卡会显示“等待你的回答”,点击“回答问题”打开
|
|
69
|
+
对话面板填写;WebUI 可直接在任务下填写。停止工作使用“取消任务”,口头表达不会自动取消后台执行。
|
|
70
|
+
- **不向 GPT-Live 注册前台工具。**后台使用自己的工具及已配置的能力;Gateway 原有的前台搜索、
|
|
71
|
+
记忆、提醒、MCP/OpenAPI 和客户端操作工具不会自动转移到后台。
|
|
72
|
+
任务管理使用客户端控件,本集成不承诺对这些前台专属功能的语音控制。
|
|
73
|
+
|
|
74
|
+
卡片操作参见[任务与权限](../guides/tasks.zh.md),现有权限策略参见[后台权限模式](../configuration/backend.zh.md#后台权限模式)。
|
|
75
|
+
|
|
76
|
+
## 提示词结构
|
|
77
|
+
|
|
78
|
+
Live 的精简规则保存在 `config/frontend-agent/LIVE_PROMPT.md`,与工具调用式前台的
|
|
79
|
+
`PROMPT.md` 分开维护;两者复用相同的人设、已提供的记忆上下文和运行环境上下文。
|
|
80
|
+
Live 不包含调用其无法使用的前台工具的指令。需要自定义时,在
|
|
81
|
+
`QWEN_AUDIO_AGENT_FRONTEND_PROMPT_DIR` 下放置 `LIVE_PROMPT.md`;缺少此文件时使用内置
|
|
82
|
+
Live 规则,已存在但为空或不可读的文件则报错。
|
|
83
|
+
|
|
84
|
+
## 输入与结果回传
|
|
85
|
+
|
|
86
|
+
- **语音:**WebSocket 使用 Bearer 认证,上下行均为单声道 24 kHz PCM16。
|
|
87
|
+
近期文字历史在会话启动时传入。
|
|
88
|
+
- **文字和文件:**文字请求直接交给已配置的后台,简短文本摘要同步到 Live 上下文。
|
|
89
|
+
请把问题和相关图片、文件同次提交;附件按后台支持的能力传递,不走 GPT-Live 图像输入接口。
|
|
90
|
+
本集成暂不支持后续语音引用历史附件,Gateway 不会自动把全部历史文件交给后台。
|
|
91
|
+
- **进度与结果:**无需立即播报的进度使用 `session.thinking.append`,需要自然表达的内容使用
|
|
92
|
+
`session.commentary.append`。云端发起的任务保留对应委派 ID;本地发起的工作使用空委派 ID。
|
|
93
|
+
收到 append 回执只代表上下文被接收,不代表用户已经听到结果。
|
|
94
|
+
每次回传材料按上游长度限制做保守截断;完整结果保留在本地任务记录中。
|
|
95
|
+
- **自然插话:**Live 模型控制连续语音输出,已经生成的音频继续播放,不套用 Realtime 的语音起始清空逻辑。
|
|
96
|
+
文字输入和明确的停止操作可以要求模型停播,但不取消后台任务。
|
|
97
|
+
|
|
98
|
+
## 限制与验证边界
|
|
99
|
+
|
|
100
|
+
- 尚未实现口头授权。后台可能请求权限时,应使用具备权限确认控件的客户端。
|
|
101
|
+
- TUI 暂不支持后台结构化追问的表单答复,请在桌面端或 WebUI 任务卡片中填写。
|
|
102
|
+
- GPT-Live 不直接接收图片,本集成不协商实时视觉帧;后台能否理解图片取决于所选 Agent。
|
|
103
|
+
- 音频与转写时序受上游服务影响。本地轮次分段不是“用户已听到”或“操作已完成”的协议保证。
|
|
104
|
+
- Live 连接保持打开时,即使麦克风静音也可能产生服务费用;后台用量另计。
|
|
105
|
+
|
|
106
|
+
本地测试覆盖 Client 会话配置、委派与回传事件、任务隔离、明确授权,以及原有 Realtime 行为不受影响。
|
|
107
|
+
测试不替代账号可用性、模型行为、延迟与音色的线上验证。上游协议参见 OpenAI 的
|
|
108
|
+
[委派说明](https://developers.openai.com/api/docs/guides/live-delegation)。
|
|
109
|
+
|
|
110
|
+
## 继续阅读
|
|
111
|
+
|
|
112
|
+
- [OpenAI Realtime](openai-realtime.zh.md)
|
|
113
|
+
- [前台配置参考](../configuration/frontend.zh.md)
|
|
114
|
+
- [自定义 Provider](custom-provider.zh.md)
|
|
@@ -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
|
-
|
|
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
|
-
`
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
`
|
|
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
|
-
|
|
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,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# OpenAI Realtime
|
|
2
2
|
|
|
3
|
-
qwen-audio-agent can connect to OpenAI's
|
|
3
|
+
qwen-audio-agent can connect to OpenAI's Realtime WebSocket API as
|
|
4
4
|
a cloud voice frontend. Gateway still owns frontend tools, memory, reminders,
|
|
5
5
|
task delegation, and backend-Agent orchestration; the provider adapter only
|
|
6
6
|
translates the OpenAI GA Realtime wire shape into the shared runtime.
|
|
@@ -10,18 +10,26 @@ translates the OpenAI GA Realtime wire shape into the shared runtime.
|
|
|
10
10
|
Edit the user configuration file shown by `qwenaudio config`:
|
|
11
11
|
|
|
12
12
|
```dotenv
|
|
13
|
-
QWEN_AUDIO_REALTIME_PROVIDER=
|
|
14
|
-
|
|
13
|
+
QWEN_AUDIO_REALTIME_PROVIDER=openai
|
|
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
|
-
| `
|
|
20
|
-
| `
|
|
21
|
-
| `
|
|
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
|
+
OpenAI is one provider with multiple models. This model selects the internal
|
|
27
|
+
`openai-realtime` adapter; `gpt-live-1` selects `openai-live`. Users configure
|
|
28
|
+
the provider and model, not the adapter. Legacy provider values such as
|
|
29
|
+
`gpt-live` and `openai-realtime` retain the Realtime default and are saved as
|
|
30
|
+
`openai` with the corresponding model; see [older configuration](../configuration/frontend.md#older-configuration).
|
|
31
|
+
|
|
32
|
+
In Desktop, select **Voice frontend → OpenAI**, then **GPT Realtime 2.1**. Restart a
|
|
25
33
|
terminal Gateway after editing the file; for an installed service, run
|
|
26
34
|
`qwenaudio gateway restart`.
|
|
27
35
|
|
|
@@ -37,7 +45,7 @@ terminal Gateway after editing the file; for an installed service, run
|
|
|
37
45
|
- Response metadata correlation is enabled, so Gateway-created replies can be
|
|
38
46
|
distinguished from automatic server-side responses.
|
|
39
47
|
- The current built-in model profile supports text/audio input and text/audio
|
|
40
|
-
output. Live visual frames are not negotiated
|
|
48
|
+
output. Live visual frames are not negotiated by this adapter.
|
|
41
49
|
|
|
42
50
|
## Validation boundary
|
|
43
51
|
|
|
@@ -48,6 +56,7 @@ are governed by OpenAI's current Realtime API documentation.
|
|
|
48
56
|
|
|
49
57
|
## Read next
|
|
50
58
|
|
|
59
|
+
- [GPT-Live 1 (Live API)](gpt-live-1.md)
|
|
51
60
|
- [Google Gemini Live](google-live.md)
|
|
52
61
|
- [Frontend configuration reference](../configuration/frontend.md)
|
|
53
62
|
- [Custom Provider](custom-provider.md)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# OpenAI Realtime
|
|
2
2
|
|
|
3
|
-
qwen-audio-agent 可以把 OpenAI
|
|
3
|
+
qwen-audio-agent 可以把 OpenAI Realtime WebSocket API 作为云端语音前台。
|
|
4
4
|
Gateway 仍负责前台工具、记忆、提醒、任务委派和后台 Agent 编排;Provider Adapter
|
|
5
5
|
只把 OpenAI GA Realtime 协议转换成项目内统一的运行时事件。
|
|
6
6
|
|
|
@@ -9,18 +9,25 @@ Gateway 仍负责前台工具、记忆、提醒、任务委派和后台 Agent
|
|
|
9
9
|
编辑 `qwenaudio config` 显示的用户配置文件:
|
|
10
10
|
|
|
11
11
|
```dotenv
|
|
12
|
-
QWEN_AUDIO_REALTIME_PROVIDER=
|
|
13
|
-
|
|
12
|
+
QWEN_AUDIO_REALTIME_PROVIDER=openai
|
|
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
|
-
| `
|
|
19
|
-
| `
|
|
20
|
-
| `
|
|
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
|
+
OpenAI 是同一个供应商,可选择不同模型。本模型绑定内部 `openai-realtime` Adapter,
|
|
26
|
+
`gpt-live-1` 则绑定 `openai-live`;用户只配置供应商和模型,不配置 Adapter。
|
|
27
|
+
旧 Provider 值 `gpt-live`、`openai-realtime` 等保持 Realtime 默认模型,保存时统一为
|
|
28
|
+
`openai` 和对应模型,详见[旧配置排查](../configuration/frontend.zh.md#旧配置排查)。
|
|
29
|
+
|
|
30
|
+
桌面端选择 **语音前台 → OpenAI**,再选择 **GPT Realtime 2.1**。终端 Gateway 修改文件后需重启;
|
|
24
31
|
若是已安装的后台服务,执行 `qwenaudio gateway restart`。
|
|
25
32
|
|
|
26
33
|
## 集成边界
|
|
@@ -31,7 +38,7 @@ OPENAI_API_KEY=your-openai-key
|
|
|
31
38
|
Client 重采样。
|
|
32
39
|
- Gateway 会把自己的 function tools 注册给模型;本 Adapter 不启用 OpenAI 内置工具。
|
|
33
40
|
- 已启用响应元数据关联,Gateway 主动创建的回复可以和服务端自动回复区分开。
|
|
34
|
-
- 当前内置模型档案支持文本/音频输入和文本/音频输出;此
|
|
41
|
+
- 当前内置模型档案支持文本/音频输入和文本/音频输出;此 Adapter 不协商实时视觉帧。
|
|
35
42
|
|
|
36
43
|
## 验证边界
|
|
37
44
|
|
|
@@ -41,6 +48,7 @@ OPENAI_API_KEY=your-openai-key
|
|
|
41
48
|
|
|
42
49
|
## 继续阅读
|
|
43
50
|
|
|
51
|
+
- [GPT-Live 1(Live API)](gpt-live-1.zh.md)
|
|
44
52
|
- [Google Gemini Live](google-live.zh.md)
|
|
45
53
|
- [前台配置参考](../configuration/frontend.zh.md)
|
|
46
54
|
- [自定义 Provider](custom-provider.zh.md)
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# Qwen Audio 3.1 Live
|
|
2
|
+
|
|
3
|
+
Qwen Audio Live handles full-duplex spoken conversation and decides when to delegate
|
|
4
|
+
work. This integration uses **Client mode**: the Gateway executes delegated
|
|
5
|
+
work through the configured backend Agent and returns progress, questions, and
|
|
6
|
+
results. It does not use DashScope-hosted Responses execution.
|
|
7
|
+
|
|
8
|
+
## Configuration
|
|
9
|
+
|
|
10
|
+
Edit the user configuration file shown by `qwenaudio config`:
|
|
11
|
+
|
|
12
|
+
```dotenv
|
|
13
|
+
QWEN_AUDIO_REALTIME_PROVIDER=dashscope
|
|
14
|
+
QWEN_AUDIO_REALTIME_API_KEY=your-dashscope-key
|
|
15
|
+
QWEN_AUDIO_REALTIME_MODEL=qwen-audio-3.1-live
|
|
16
|
+
QWEN_AUDIO_REALTIME_URL=wss://<WorkspaceId>.cn-beijing.maas.aliyuncs.com/api-ws/v1/live?model=qwen-audio-3.1-live
|
|
17
|
+
QWEN_AUDIO_REALTIME_VOICE=
|
|
18
|
+
|
|
19
|
+
# Example: choose an installed and authenticated backend Agent.
|
|
20
|
+
AGENT_PROTOCOL=qoder
|
|
21
|
+
QWEN_AUDIO_AGENT_BACKEND_PERMISSION_MODE=native
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Replace `<WorkspaceId>` with the Beijing workspace that has access to Live,
|
|
25
|
+
and use its corresponding API key. Live needs this workspace-specific endpoint;
|
|
26
|
+
the public DashScope `/realtime` URL is not a substitute. The existing
|
|
27
|
+
`DASHSCOPE_WORKSPACE_ID` compatibility setting can construct the Live endpoint
|
|
28
|
+
when no explicit `QWEN_AUDIO_REALTIME_URL` is configured.
|
|
29
|
+
|
|
30
|
+
In Desktop, choose **Voice frontend → DashScope → Qwen Audio 3.1 Live**, then
|
|
31
|
+
fill in the workspace URL. The provider stays `dashscope`; protocol selection
|
|
32
|
+
is internal. When switching from Realtime, replace the URL and clear any
|
|
33
|
+
incompatible voice override. A terminal Gateway must be restarted after editing
|
|
34
|
+
the file; for an installed service, run `qwenaudio gateway restart`.
|
|
35
|
+
|
|
36
|
+
| Setting | This integration |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| Model selection | `qwen-audio-3.1-live` |
|
|
39
|
+
| Default voice | `yunshu` |
|
|
40
|
+
| Turn detection | `duplex` |
|
|
41
|
+
| Audio transport | Mono PCM16, 16 kHz input / 24 kHz output |
|
|
42
|
+
| Execution | Client delegation to the configured backend |
|
|
43
|
+
|
|
44
|
+
The service route remains `qwen-audio-3.1-live`. Following the official duplex
|
|
45
|
+
configuration, the adapter uses `qwen-audio-4.0-realtime-preview` for
|
|
46
|
+
`session.model`, with `turn_detection.type=duplex`. These are fixed protocol
|
|
47
|
+
settings, not a second model selector. Clear a Realtime voice override such as
|
|
48
|
+
`longanqian_v3.1` when switching; this Live configuration defaults to `yunshu`.
|
|
49
|
+
The upstream configuration is described in the official
|
|
50
|
+
[client-event reference](https://help.aliyun.com/zh/model-studio/qwen-audio-live-client-events).
|
|
51
|
+
|
|
52
|
+
Choose and configure a [backend Agent](../backends/overview.md) before requesting
|
|
53
|
+
work. With backend `none`, Live can converse but there is no automatic hosted
|
|
54
|
+
backend fallback.
|
|
55
|
+
|
|
56
|
+
## Tasks and permissions
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
Voice or text → Qwen Live → native delegation
|
|
60
|
+
→ Gateway Task → backend Agent
|
|
61
|
+
← progress / question / result
|
|
62
|
+
← Qwen Live ← update for the same delegation
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
- Native delegation replaces `spawn_thinking` for this model. Qwen supplies the
|
|
66
|
+
task summary, relevant context, and later supplements; the Gateway maps them
|
|
67
|
+
to existing tasks rather than creating a separate execution system.
|
|
68
|
+
- Task cards, cancellation, permissions, and persisted results remain managed
|
|
69
|
+
by the Gateway. Speech interruption does not cancel backend work.
|
|
70
|
+
- Approve or reject through Desktop/WebUI permission cards, or TUI
|
|
71
|
+
`/approve [permission_id]` and `/reject [permission_id]`. These actions reach
|
|
72
|
+
the waiting backend directly. Saying or typing “yes” is not permission consent.
|
|
73
|
+
Switching models does not enable automatic approval.
|
|
74
|
+
- Answer structured backend questions through the Desktop/WebUI task form.
|
|
75
|
+
Ordinary text questions do not create a form. TUI currently has no structured
|
|
76
|
+
question form; use another client when the backend requests one.
|
|
77
|
+
- This version does not register frontend tools with Qwen Live. This is an
|
|
78
|
+
integration choice, not a claim that the upstream API lacks function tools.
|
|
79
|
+
Frontend search, memory, reminder, MCP/OpenAPI, and client-action tools are
|
|
80
|
+
not automatically transferred to the backend. Use client controls to manage
|
|
81
|
+
tasks; the backend retains its own configured tools.
|
|
82
|
+
|
|
83
|
+
See [Work and Permissions](../guides/tasks.md) for controls and
|
|
84
|
+
[backend permission modes](../configuration/backend.md#backend-permission-modes)
|
|
85
|
+
for the existing authorization policies.
|
|
86
|
+
|
|
87
|
+
## Inputs and result delivery
|
|
88
|
+
|
|
89
|
+
- **Text** goes to the Live frontend as a real user message. The Gateway does
|
|
90
|
+
not also start a local task for the same text: execution starts only when
|
|
91
|
+
Live delegates it.
|
|
92
|
+
- **Audio timeline:** text-only requests and returned results also need the
|
|
93
|
+
service's audio clock to advance. When no real audio frames arrive, the
|
|
94
|
+
unmuted Provider sends 100 ms frames of zero-valued PCM. This synthetic silence does
|
|
95
|
+
not open or read the microphone.
|
|
96
|
+
- **Microphone mute and sleep:** retain the Live connection and send
|
|
97
|
+
`session.input_audio.mute`. After the matching `session.input_audio.muted`
|
|
98
|
+
receipt, stop all audio uploads, including synthetic silence; the service
|
|
99
|
+
maintains silent input. Until confirmed, only synthetic silence continues,
|
|
100
|
+
never real microphone audio. Resume with `session.input_audio.unmute` when
|
|
101
|
+
the input gates allow it: waking does not override microphone mute or input
|
|
102
|
+
suspension. Reconnecting during sleep restores mute without replaying old
|
|
103
|
+
audio. Only Qwen Live opts into this sleep protocol; other Providers keep
|
|
104
|
+
their existing behavior. Mute does not guarantee immediate result narration.
|
|
105
|
+
- **Images and files** remain in the Gateway's input registry. Live receives
|
|
106
|
+
textual attachment metadata, not image or file bytes. A delegation must retain
|
|
107
|
+
those explicit references for the Gateway to resolve the original inputs for
|
|
108
|
+
the backend. It does not infer attachments from filenames or attach all history.
|
|
109
|
+
- **Progress and permission state** use `session.thinking.append`, including
|
|
110
|
+
pending permission requests and their approved, denied, or cancelled outcomes.
|
|
111
|
+
These are context updates, not guaranteed spoken announcements; use the client
|
|
112
|
+
permission controls to respond. **Final task results** still use
|
|
113
|
+
`session.commentary.append`. Structured questions temporarily retain their
|
|
114
|
+
existing commentary path. A permission notice does not authorize work or
|
|
115
|
+
complete a task; resolving it requires explicit client action. Each task update
|
|
116
|
+
uses a delegation ID issued on the current connection. An
|
|
117
|
+
upstream receipt means accepted, not played to the user. The official
|
|
118
|
+
[server-event reference](https://help.aliyun.com/zh/model-studio/qwen-audio-live-server-events)
|
|
119
|
+
describes delegation and receipt events.
|
|
120
|
+
- **Known limitation:** live service tests have rejected subsequent updates for
|
|
121
|
+
the same delegation with `CONFLICT: Unknown Client call or stale Agent connection`
|
|
122
|
+
after accepting an intermediate commentary notice. Permission notices no longer
|
|
123
|
+
use that path; continuation after structured questions still needs validation.
|
|
124
|
+
Accepted results are also not guaranteed to be narrated promptly or
|
|
125
|
+
accurately; use the client's task state and actual result as the source of truth.
|
|
126
|
+
A separate test with no progress or result feedback ended the delegation with
|
|
127
|
+
`RequestTimeOut` after about 120 seconds, even with continuous audio uploads;
|
|
128
|
+
subsequent results were rejected. A live connection does not guarantee an
|
|
129
|
+
active delegation. This observation is not a fixed protocol timeout contract.
|
|
130
|
+
- **Reconnects** restore recent conversation as read-only prompt context.
|
|
131
|
+
Gateway task records survive independently, but old delegation IDs and results
|
|
132
|
+
are not replayed into the replacement Live connection. This adapter does not
|
|
133
|
+
send GPT Live-style null-ID task snapshots or unassociated proactive speech.
|
|
134
|
+
- **Natural interruptions** remain under the Live service's control. The
|
|
135
|
+
Gateway does not apply Realtime's speech-start audio-buffer clearing to this
|
|
136
|
+
integration. This does not imply that an interrupted backend task has stopped.
|
|
137
|
+
|
|
138
|
+
## Prompt and limits
|
|
139
|
+
|
|
140
|
+
The shared `config/frontend-agent/LIVE_PROMPT.md` supplies the Live policy;
|
|
141
|
+
assistant profile, supplied memory, and runtime context reuse the existing
|
|
142
|
+
composition. It does not inherit instructions to call unavailable frontend
|
|
143
|
+
tools. A custom `LIVE_PROMPT.md` in `QWEN_AUDIO_AGENT_FRONTEND_PROMPT_DIR`
|
|
144
|
+
overrides the packaged policy; a missing file falls back to the packaged one.
|
|
145
|
+
|
|
146
|
+
Session settings are sent when establishing the connection. The service rejects
|
|
147
|
+
instructions-only `session.update`, so this adapter declares `mutableSession: false`:
|
|
148
|
+
prompt, persona, and session-configuration changes take effect on a new Live
|
|
149
|
+
connection, not through an in-place refresh.
|
|
150
|
+
|
|
151
|
+
This adapter does not provide direct image/video input, oral authorization,
|
|
152
|
+
or hosted Responses mode. Backend attachment support depends on the chosen
|
|
153
|
+
Agent. The behavior described here reflects this integration's configuration;
|
|
154
|
+
account access, latency, speech behavior, and voices still require validation
|
|
155
|
+
against the selected workspace. Muting the microphone does not close the Live
|
|
156
|
+
connection or pause its billing; disconnect when finished. Backend usage is
|
|
157
|
+
separate.
|
|
158
|
+
|
|
159
|
+
## Read next
|
|
160
|
+
|
|
161
|
+
- [Qwen Audio Realtime](qwen-audio-realtime.md)
|
|
162
|
+
- [GPT Live](gpt-live-1.md)
|
|
163
|
+
- [Frontend configuration](../configuration/frontend.md)
|
|
164
|
+
- [Custom Provider](custom-provider.md)
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Qwen Audio 3.1 Live
|
|
2
|
+
|
|
3
|
+
Qwen Audio Live 负责全双工语音交流,并判断何时委派工作。本集成采用 **Client 模式**:
|
|
4
|
+
Gateway 通过已配置的后台 Agent 执行委派任务,再回传进度、追问与结果,
|
|
5
|
+
不使用百炼托管的 Responses 后台执行。
|
|
6
|
+
|
|
7
|
+
## 配置
|
|
8
|
+
|
|
9
|
+
编辑 `qwenaudio config` 显示的用户配置文件:
|
|
10
|
+
|
|
11
|
+
```dotenv
|
|
12
|
+
QWEN_AUDIO_REALTIME_PROVIDER=dashscope
|
|
13
|
+
QWEN_AUDIO_REALTIME_API_KEY=your-dashscope-key
|
|
14
|
+
QWEN_AUDIO_REALTIME_MODEL=qwen-audio-3.1-live
|
|
15
|
+
QWEN_AUDIO_REALTIME_URL=wss://<WorkspaceId>.cn-beijing.maas.aliyuncs.com/api-ws/v1/live?model=qwen-audio-3.1-live
|
|
16
|
+
QWEN_AUDIO_REALTIME_VOICE=
|
|
17
|
+
|
|
18
|
+
# 示例:选择已经安装并完成登录的后台 Agent。
|
|
19
|
+
AGENT_PROTOCOL=qoder
|
|
20
|
+
QWEN_AUDIO_AGENT_BACKEND_PERMISSION_MODE=native
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
将 `<WorkspaceId>` 替换为已开通 Live 的北京业务空间 ID,并使用该空间对应的 API Key。
|
|
24
|
+
Live 必须使用业务空间专属地址,不能沿用 DashScope 公共 `/realtime` 地址。
|
|
25
|
+
未显式配置 `QWEN_AUDIO_REALTIME_URL` 时,也可以沿用兼容配置
|
|
26
|
+
`DASHSCOPE_WORKSPACE_ID`,由框架生成 Live 地址。
|
|
27
|
+
|
|
28
|
+
桌面端选择 **语音前台 → DashScope → Qwen Audio 3.1 Live**,然后填写业务空间地址。
|
|
29
|
+
供应商仍为 `dashscope`,无需另选协议。从 Realtime 切换时,应替换地址并清除不兼容的音色覆盖。
|
|
30
|
+
终端 Gateway 修改文件后需重启;已安装的后台服务执行 `qwenaudio gateway restart`。
|
|
31
|
+
|
|
32
|
+
| 配置 | 本集成使用值 |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| 模型选择 | `qwen-audio-3.1-live` |
|
|
35
|
+
| 默认音色 | `yunshu` |
|
|
36
|
+
| 话轮检测 | `duplex` |
|
|
37
|
+
| 音频传输 | 单声道 PCM16,16 kHz 输入 / 24 kHz 输出 |
|
|
38
|
+
| 执行方式 | Client 委派给已配置的后台 |
|
|
39
|
+
|
|
40
|
+
服务路由仍为 `qwen-audio-3.1-live`。适配器采用官方双工配置:协议中的 `session.model`
|
|
41
|
+
为 `qwen-audio-4.0-realtime-preview`,`turn_detection.type=duplex`。这些是固定的协议参数,
|
|
42
|
+
不是第二套模型选择。切换时请清除 `longanqian_v3.1` 等 Realtime 音色覆盖,
|
|
43
|
+
本 Live 配置默认使用 `yunshu`。上游配置见官方
|
|
44
|
+
[客户端事件说明](https://help.aliyun.com/zh/model-studio/qwen-audio-live-client-events)。
|
|
45
|
+
|
|
46
|
+
请先选择并配置[后台 Agent](../backends/overview.zh.md)。后台设为 `none` 时,仅保留 Live
|
|
47
|
+
自身的对话能力,不会自动切换到云端后台执行。
|
|
48
|
+
|
|
49
|
+
## 任务与授权
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
语音或文字 → Qwen Live → 原生委派
|
|
53
|
+
→ Gateway 任务 → 后台 Agent
|
|
54
|
+
← 进度 / 追问 / 结果
|
|
55
|
+
← Qwen Live ← 同一委派的更新
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
- 此模型通过原生委派替代 `spawn_thinking`。Qwen 提供任务摘要、相关上下文与后续补充,
|
|
59
|
+
Gateway 将其映射到现有任务,不另建一套执行系统。
|
|
60
|
+
- 任务卡片、取消、授权及持久化结果仍由 Gateway 管理。打断语音不等于取消后台工作。
|
|
61
|
+
- 在桌面端 / WebUI 权限卡片中授权或拒绝,或使用 TUI 的 `/approve [permission_id]`、
|
|
62
|
+
`/reject [permission_id]`。操作直接到达等待中的后台;说出或输入“同意”不构成授权。
|
|
63
|
+
切换模型不会自动开启权限批准。
|
|
64
|
+
- 后台结构化追问在桌面端 / WebUI 任务表单中回答,普通文字问题不会生成表单。
|
|
65
|
+
TUI 暂无结构化追问表单,需要时请使用其他客户端。
|
|
66
|
+
- 本版不向 Qwen Live 注册前台工具,这是集成选择,不代表上游 API 不支持函数工具。
|
|
67
|
+
前台搜索、记忆、提醒、MCP/OpenAPI 与客户端操作工具不会自动转移给后台。
|
|
68
|
+
任务管理使用客户端控件,后台仍使用自身配置的工具。
|
|
69
|
+
|
|
70
|
+
操作说明见[任务与权限](../guides/tasks.zh.md),现有权限策略见
|
|
71
|
+
[后台权限模式](../configuration/backend.zh.md#后台权限模式)。
|
|
72
|
+
|
|
73
|
+
## 输入与结果回传
|
|
74
|
+
|
|
75
|
+
- **文字**作为真实用户消息发给 Live 前台,不同时在本地重复建任务;Live 发出委派后才开始执行。
|
|
76
|
+
- **音频时间线:**纯文字请求和结果回传也需要服务端音频时钟继续推进。没有真实音频帧时,
|
|
77
|
+
未静音的 Provider 补充每帧 100 毫秒的全零 PCM 静音;这是合成数据,不会开启或读取麦克风。
|
|
78
|
+
- **麦克风静音与休眠:**保持 Live 连接,发送 `session.input_audio.mute`;收到匹配的
|
|
79
|
+
`session.input_audio.muted` 回执后,停止上传音频,包括合成静音帧,由服务端维持静音输入。
|
|
80
|
+
未确认静音时仍保留合成静音帧,不发送真实录音。恢复输入时发送 `session.input_audio.unmute`;
|
|
81
|
+
唤醒不会越过手动静音或输入占用限制。休眠期间意外重连仍恢复静音状态,不回放旧录音。
|
|
82
|
+
该休眠协议目前仅由 Qwen Live 启用,其他 Provider 保持原行为。静音不保证任务结果立即播报。
|
|
83
|
+
- **图片与文件**保留在 Gateway 输入注册表中,Live 仅接收附件文字元数据,不接收原始内容。
|
|
84
|
+
委派必须保留明确的附件引用,Gateway 才能向后台提供原始输入;不会根据文件名猜测附件,
|
|
85
|
+
也不会自动附带全部历史文件。
|
|
86
|
+
- **进度与权限状态**通过 `session.thinking.append` 回传,包括权限申请以及批准、拒绝或取消的
|
|
87
|
+
处理结果。这些是上下文状态更新,不保证主动语音播报;请通过客户端权限控件处理请求。
|
|
88
|
+
**最终任务结果**仍通过 `session.commentary.append` 回传。结构化追问暂时保留原有的
|
|
89
|
+
`commentary` 路径。发送权限通知不代表授权或任务完成,只有客户端的明确操作才会处理请求。
|
|
90
|
+
每次任务更新都关联当前连接实际收到的委派 ID。
|
|
91
|
+
上游回执只代表接收成功,不代表用户已经听到。委派及回执格式见官方
|
|
92
|
+
[服务端事件说明](https://help.aliyun.com/zh/model-studio/qwen-audio-live-server-events)。
|
|
93
|
+
- **已知限制:**当前服务实测中,使用 `commentary` 发送中间通知后,同一委派的后续更新可能返回
|
|
94
|
+
`CONFLICT: Unknown Client call or stale Agent connection`。权限通知不再使用该路径,
|
|
95
|
+
结构化追问的续接仍需验证。已接收的结果也不保证立即、准确播报,请以客户端任务状态和实际结果为准。
|
|
96
|
+
另一次实测中,未回传任何进度或结果的委派约 120 秒后被服务端以 `RequestTimeOut` 结束;
|
|
97
|
+
持续上传音频也会发生,之后再回传结果被拒绝。连接存活不等于委派仍有效;该观察不代表固定的协议时限。
|
|
98
|
+
- **重新连接**时,近期对话作为只读提示词上下文恢复。Gateway 任务记录独立保留,
|
|
99
|
+
但不会向新 Live 连接回放旧委派 ID 和旧结果;也不会发送 GPT Live 式的空 ID 任务快照,
|
|
100
|
+
或无关联的主动播报。
|
|
101
|
+
- **自然插话**由 Live 服务控制,Gateway 不套用 Realtime 的语音起始清空音频缓存逻辑。
|
|
102
|
+
这不表示被打断的后台任务已停止。
|
|
103
|
+
|
|
104
|
+
## 提示词与限制
|
|
105
|
+
|
|
106
|
+
Live 规则复用 `config/frontend-agent/LIVE_PROMPT.md`;人设、已提供的记忆与运行环境上下文
|
|
107
|
+
沿用现有组合方式,不混入调用不可用前台工具的指令。在 `QWEN_AUDIO_AGENT_FRONTEND_PROMPT_DIR`
|
|
108
|
+
放置 `LIVE_PROMPT.md` 可覆盖内置规则;缺少文件时使用内置版本。
|
|
109
|
+
|
|
110
|
+
会话设置在建连时发送。服务不接受仅更新指令的 `session.update`,因此适配器声明
|
|
111
|
+
`mutableSession: false`:提示词、人设和会话配置变更在新 Live 连接中生效,不做连接内热更新。
|
|
112
|
+
|
|
113
|
+
本适配不提供直接图像 / 视频输入、口头授权或托管 Responses 模式。后台能否处理附件取决于
|
|
114
|
+
所选 Agent。以上行为说明基于当前集成配置;账号权限、延迟、语音行为及音色仍需在对应业务空间验证。
|
|
115
|
+
麦克风静音不会关闭 Live 连接,也不会暂停其计费;使用结束后请断开连接。后台用量另计。
|
|
116
|
+
|
|
117
|
+
## 继续阅读
|
|
118
|
+
|
|
119
|
+
- [Qwen Audio Realtime](qwen-audio-realtime.zh.md)
|
|
120
|
+
- [GPT Live](gpt-live-1.zh.md)
|
|
121
|
+
- [前台配置](../configuration/frontend.zh.md)
|
|
122
|
+
- [自定义 Provider](custom-provider.zh.md)
|