Add Mermaid diagram support and update architecture documentation

- Included a new JavaScript file for Mermaid configuration to ensure consistent diagram sizing across documentation.
- Enhanced architecture documentation to reflect the updated pipeline engine structure, including VAD, ASR, TD, LLM, and TTS components.
- Updated various sections to clarify the integration of external services and tools within the architecture.
- Improved styling for Mermaid diagrams to enhance visual consistency and usability.
This commit is contained in:
Xin Wang
2026-03-05 11:01:56 +08:00
parent 4748f3b5f1
commit ac9b0047ee
7 changed files with 275 additions and 80 deletions

View File

@@ -102,16 +102,16 @@ RAS 支持两种引擎架构,适用于不同场景。
### 管线式引擎 (Pipeline)
将语音交互拆分为三个独立环节:
将语音交互拆分为多个环节,包含 **VAD声音活动检测**、**ASR语音识别**、**TD回合检测**、**LLM大语言模型**、**TTS语音合成**。外部服务可选 **OpenAI**、**SiliconFlow**、**DashScope**、**本地模型**。LLM 与实时交互引擎均可连接**工具**Webhook、客户端工具、内建工具
```
用户语音 → [ASR] → 文本 → [LLM] → 回复 → [TTS] → 助手语音
用户语音 → [VAD] → [ASR] → [TD] → 文本 → [LLM] → 回复 → [TTS] → 助手语音
```
**优点:**
- 灵活选择各环节供应商
- 可独立优化每个环节
- 灵活选择各环节供应商OpenAI、SiliconFlow、DashScope、本地模型
- 可独立优化 VAD、ASR、TD、LLM、TTS 每个环节
- 成本可控
**缺点:**
@@ -119,9 +119,9 @@ RAS 支持两种引擎架构,适用于不同场景。
- 延迟较高(累加延迟)
- 需要协调多个服务
### 多模态引擎 (Multimodal)
### 实时交互引擎与多模态 (Realtime / Multimodal)
使用端到端模型直接处理:
实时交互引擎可连接 **OpenAI Realtime**、**Gemini Live**、**Doubao 实时交互引擎** 等,同样可连接工具。使用端到端模型直接处理:
```
用户语音 → [Realtime Model] → 助手语音
@@ -191,11 +191,13 @@ sequenceDiagram
### 工具类型
管线式引擎中的 LLM 与实时交互引擎均可连接**工具**,包括:
| 类型 | 说明 | 示例 |
|------|------|------|
| **Webhook** | 调用外部 HTTP API | 查询订单、预约日程 |
| **客户端** | 由客户端执行的操作 | 打开页面、显示表单 |
| **内** | 平台提供的工具 | 代码执行、计算器 |
| **客户端工具** | 由客户端执行的操作 | 打开页面、显示表单 |
| **内建工具** | 平台提供的工具 | 代码执行、计算器 |
### 工具调用流程