ai-robot-core/ai-service/tools/intent_hint.md

61 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
name: intent_hint
description: 轻量意图识别与路由建议工具,为策略路由提供软信号
triggers:
- 用户意图不明确或存在歧义
- 需要给 policy_router 提供软路由信号
- 用户表达复杂,可能涉及多个意图
- 需要判断应该进入哪种处理模式
anti_triggers:
- 已经明确进入固定模式/流程模式
- 已有确定的意图结果
- 用户问题简单明确,无需意图分析
- 已完成意图识别且上下文未变化
tools:
- intent_hint
---
## 使用指南
### 何时使用
当用户意图不明确、需要给 policy_router 提供软路由信号时使用。
### 何时不使用
当已经明确进入固定模式/流程模式,或已有确定意图结果时不重复调用。
### 参数说明
| 参数 | 类型 | 必填 | 说明 |
|-----|------|-----|------|
| message | string | 是 | 用户输入原文 |
| tenant_id | string | 是 | 租户 ID系统自动注入 |
| history | array | 否 | 会话历史(可选) |
| top_n | integer | 否 | 返回建议数量(可选) |
| context | object | 否 | 上下文字段(仅 routing_signal 字段会被消费) |
### 示例调用
```json
{
"message": "我想退款,但是也想先咨询下怎么处理",
"top_n": 3,
"context": {"order_status": "delivered", "channel": "web"}
}
```
### 结果解释
关注输出中的以下字段:
- `intent`: 识别出的意图
- `confidence`: 置信度
- `suggested_mode`: 建议的处理模式
**重要**: 该工具只提供建议,不做最终决策。
### 注意事项
1. tenant_id 由系统自动注入,模型不要填写
2. context 中只有 routing_signal 角色的字段会被消费
3. 该工具是轻量级的,不会执行复杂推理
4. 结果应作为参考,最终决策由 policy_router 做出