yao-decision
它能做什么
这项技能把一种情境交给决策模型,模型以固定的类别、评分或概率作答。适合希望得到一致、便于排序的答案,而不是自由文本的团队。
适用场景
- ✓当你需要把收到的工单分派给正确部门的时候。
- ✓当你希望按照固定量表为内容评级,例如从差到优的时候。
- ✓当你想估算某件事发生的可能性,并附上可信度的时候。
技能链接
https://github.com/YaoApp/yao/blob/main/tools/skills/yao-decision/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请把这条客户消息归类为账单、技术或销售,并告诉我它是否紧急。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会描述情境,并列出需要回答的问题。决策模型会针对每个问题返回一个选项、一个评分或一个概率,并附上可信度。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Decision Tools
Use these tools when you need structured, typed decisions rather than free-form LLM text. Decision models return machine-readable answers with probabilities and confidence scores.
decision_decide
Send a state (context) and one or more typed questions to a decision model.
Question Types
| Type | Purpose | Criteria | Answer Fields |
|---|---|---|---|
choice |
Classify into one of N options | {option: description} map |
choice, probabilities, confidence |
score |
Rate on a scale | [level_labels] array |
score, legend, probabilities, confidence |
noul |
Estimate a probability (0-1) | (none) | noul |
Basic usage (choice + noul):
tai tool decision_decide --state "Customer says: my billing is wrong, I was charged twice" --questions '{"department":{"type":"choice","instructions":"Route to the right department","criteria":{"billing":"Payment issues","technical":"Product bugs","sales":"Purchase inquiries"}},"is_urgent":{"type":"noul","instructions":"Is this urgent?"}}'
With score question:
tai tool decision_decide --state "The agent resolved the issue in 2 minutes with a clear explanation" --questions '{"quality":{"type":"score","instructions":"Rate the support quality","criteria":["Poor","Below average","Average","Good","Excellent"]}}'
With explicit provider:
tai tool decision_decide --state "some context" --questions '{"q1":{"type":"noul","instructions":"Is this positive?"}}' --provider t862699292876.typesafe
With model override:
tai tool decision_decide --state "some context" --questions '{"q1":{"type":"noul","instructions":"Is this positive?"}}' --model jev-latest
Batch decisions (multiple states, same questions):
tai tool decision_decide --states '["Customer A says billing is wrong","Customer B loves the product","Customer C wants a refund"]' --questions '{"sentiment":{"type":"choice","instructions":"Classify sentiment","criteria":{"positive":"Happy","negative":"Unhappy","neutral":"Neither"}}}'
Reading from files:
tai tool decision_decide --state_file customer_message.txt --questions_file routing_questions.json
| Parameter | Type | Required | Description |
|---|---|---|---|
| state | string/object/array | yes* | The context for the decision (*mutually exclusive with states) |
| questions | JSON object | yes | Map of question_id to question definition |
| model | string | no | Model name override (default: provider's configured model) |
| provider | string | no | Provider connector ID (default: decision role or first available) |
| timeout | integer | no | Timeout in seconds (default: 60) |
| states | array | no* | Array of state items for batch decisions (*mutually exclusive with state) |
| state_file | string | no | Read state from file (tai CLI only) |
| questions_file | string | no | Read questions from JSON file (tai CLI only) |
Response Format
Single state:
{
"answers": {
"department": {
"type": "choice",
"choice": "billing",
"probabilities": {"billing": 0.92, "technical": 0.05, "sales": 0.03},
"confidence": 0.89
},
"is_urgent": {
"type": "noul",
"noul": 0.73
}
},
"model": "jev-1.13.0",
"usage": {"input_tokens": 245, "output_tokens": 38}
}
Note:
modelin the response is the resolved concrete model ID (e.g.jev-1.13.0), not the alias you requested (e.g.jev-latest).
Batch states:
{
"results": [
{"state_index": 0, "answers": {...}, "model": "jev-1.13.0", "usage": {...}},
{"state_index": 1, "answers": {...}, "model": "jev-1.13.0", "usage": {...}},
{"state_index": 2, "error": "timed out after 60s"}
]
}
decision_providers
List available decision providers and their models.
tai tool decision_providers
| Parameter | Type | Required | Description |
|---|---|---|---|
| capability | string | no | Filter by capability (default: decision) |
Returns a list of providers with available models, connector IDs, and availability status.
Constraints
stateandstatesare mutually exclusive; provide one or the other.- Each question must have
type(choice/score/noul) andinstructions. criteriais required forchoice(map) andscore(array);noulmust not have criteria.- Batch states must not contain empty strings or null v
常见问题
它会给出哪种答案?
从指定选项中选择一个、量表上的评分,或介于 0 和 1 之间的概率。
为什么不直接要求纯文本答案?
结构化的答案更容易排序、比较和检查。
我可以选择模型吗?
可以。可以明确设置特定的服务商。
详情
作者的原始描述
Typed decision expert. ALWAYS invoke this skill when you need structured classification, scoring, or probability estimation — routing tickets, grading content, detecting intent, or any task requiring typed answers with calibrated confidence.
repo: YaoApp/yao
热度
- GitHub 星标
- 8.3k
- 排名
- #12473
- 许可证
- —
- 更新时间
- 2026/10/19
评论
- …