- Restructured the navigation in mkdocs.yml to improve organization, introducing subcategories for assistant creation and component libraries. - Added new documentation for workflow configuration options, detailing setup and best practices. - Introduced new sections for voice recognition and generation, outlining configuration items and recommendations for optimal performance.
69 lines
2.2 KiB
Markdown
69 lines
2.2 KiB
Markdown
# 工作流配置选项(TODO 版本)
|
||
|
||
本文档是工作流配置页的第一版草稿,后续会根据实际能力继续细化。
|
||
|
||
## 配置目标
|
||
|
||
- 将多步骤对话拆分为可编排节点
|
||
- 为不同分支定义独立提示词和工具权限
|
||
- 在会话中按条件切换节点并透传上下文
|
||
|
||
## 基础配置项(建议)
|
||
|
||
| 配置项 | 说明 | 建议值 |
|
||
|---|---|---|
|
||
| 工作流名称 | 用于区分业务流程 | 简洁、业务语义明确 |
|
||
| 入口节点 | 用户进入后的首个节点 | 固定单入口 |
|
||
| 全局提示词 | 对所有节点生效的共性约束 | 保持简短,避免与节点提示词冲突 |
|
||
| 节点提示词 | 当前节点的任务说明 | 单一职责,明确输入/输出 |
|
||
| 节点工具白名单 | 当前节点可调用工具集合 | 最小权限原则 |
|
||
| 节点超时 | 节点等待超时处理 | 3-10 秒 |
|
||
| 失败回退节点 | 异常时兜底节点 | 建议统一到人工或澄清节点 |
|
||
|
||
## 节点建议类型
|
||
|
||
- 意图识别节点:判断用户诉求并路由
|
||
- 信息收集节点:收集订单号、手机号等关键信息
|
||
- 处理节点:执行查询、计算、调用工具
|
||
- 回复节点:组织最终答复
|
||
- 结束节点:输出结束语并关闭会话
|
||
|
||
## 配置示例
|
||
|
||
```yaml
|
||
workflow:
|
||
name: "订单咨询流程"
|
||
entry: "intent_router"
|
||
global_prompt: "优先给出可执行步骤,必要时先澄清信息。"
|
||
nodes:
|
||
- id: "intent_router"
|
||
type: "router"
|
||
prompt: "识别用户意图:查订单、退款、投诉"
|
||
next:
|
||
- when: "intent == query_order"
|
||
to: "collect_order_id"
|
||
- when: "intent == refund"
|
||
to: "refund_policy"
|
||
- id: "collect_order_id"
|
||
type: "collect"
|
||
prompt: "请用户提供订单号"
|
||
tools: ["query_order"]
|
||
fallback: "human_handoff"
|
||
- id: "human_handoff"
|
||
type: "end"
|
||
prompt: "转人工处理"
|
||
```
|
||
|
||
## 已知限制(当前)
|
||
|
||
- 不支持在文档中完整定义所有表达式语法
|
||
- 不同执行引擎的节点字段可能存在差异
|
||
- 可视化编排与 YAML 字段暂未完全一一对应
|
||
|
||
## 后续计划
|
||
|
||
- 补充节点字段的完整 Schema
|
||
- 补充路由条件表达式规范
|
||
- 增加“调试与回放”章节
|
||
|