This commit is contained in:
2026-06-01 10:46:01 +08:00
parent 2faf4bb002
commit e96b955fda
221 changed files with 10219 additions and 332 deletions

View File

@@ -0,0 +1,62 @@
---
title: "Agent Eval Case Design"
created: 2026-05-26
type: concept
tags: ["agent-evaluation", "test-design", "benchmark"]
sources: ["mini-agent-harness"]
---
# Agent Eval Case Design
> 设计 Agent 评测用例的四要素:任务、环境、工具、评分规则。
## 四要素
1. **Task**:明确的任务描述,不模棱两可
2. **Environment**:封闭、可复现的执行环境
3. **Tools**Agent 可用的工具白名单
4. **Grader**[[agent-eval-grader|评分规则]]——必须可自动执行
## 示例
```json
{
"id": "case_001",
"task": "判断项目是否支持插件系统",
"environment": {
"files": {
"README.md": "本项目支持本地启动、基础登录和配置管理。",
"config.md": "配置项包括 port、theme、log_level。"
}
},
"tools": ["list_files", "read_file"],
"grader": {
"must_read": ["README.md"],
"answer_should_include": "不能确认支持插件系统",
"answer_should_not_include": "支持插件系统"
}
}
```
## 设计原则
- **环境可控**:每个 case 在自己的隔离环境中运行
- **任务不歧义**:避免开放式解读
- **评分自动化**:不依赖人工判断
- **渐进难度**:从简单封闭到复杂开放
## 常见测试维度
| 维度 | 测试内容 |
|------|---------|
| 工具选择 | Agent 是否为任务选择了正确的工具 |
| 文件读取 | 是否读取了正确的文件 |
| 参数正确性 | 工具调用参数是否合理 |
| 结果使用 | 回答是否基于工具返回的实际内容 |
| 步骤效率 | 是否有冗余工具调用 |
## 相关页面
- [[agent-eval-trace]] — case 执行后的追踪记录
- [[agent-eval-grader]] — case 中的评分逻辑
- [[agent-harness-mini]] — 运行 case 的 harness 框架