工具参数正确性
工具参数正确性评估器
分类 | 详情 | |
|---|---|---|
基础信息 | 评估器名称 | 工具参数正确性 |
效果说明 | 功能概述 | 判断生成的调用是否从问题中提取了完全正确的参数。 |
评估方式 | LLM评估 | |
评估目标 | 文本、工具调用 | |
应用场景 | 适用于Agent工具调用链路验证,如API参数填充、数据库查询构造、函数调用生成等场景,确保从用户输入中提取的参数名称、类型、值均准确无误。 | |
评分标准 | 1.0分 | 参数提取完全正确,所有必需参数均已识别,参数名称、类型、值与问题要求完全一致,无遗漏或错误。 |
0.0分 | 参数提取存在错误,包括必需参数遗漏、参数名称/类型/值错误,或包含无关参数。 | |
评估器参数说明:
参数类型 | 参数名称 | 是否必填 | 参数说明 |
|---|---|---|---|
输入参数 | context | 是 | 用户原始输入的完整上下文,包含需要提取参数的自然语言描述或指令。 |
tools_called | 是 | Agent实际生成的工具调用内容,包括工具名称及提取的参数键值对。 | |
tool_list | 是 | 可用的工具定义列表,包含各工具的名称、描述、参数Schema及必填项要求。 | |
输出参数 | score | 是 | 评估得分(0.0/1.0)。 |
reason | 是 | 评分理由说明。 |
输入格式示例:
{
"context": ["用户昨天预订了北京到上海的航班,航班号是CA1830,起飞时间是2026-02-01 08:00。"],
"tools_called": [
{
"name": "book_flight",
"arguments": {
"departure": "北京",
"destination": "上海",
"flight_number": "CA1830",
"departure_time": "2026-02-01T08:00:00"
}
}
],
"tool_list": [
{
"name": "book_flight",
"description": "预订航班的工具",
"input_parameters": {
"type": "object",
"properties": {
"departure": {"type": "string"},
"destination": {"type": "string"},
"flight_number": {"type": "string"},
"departure_time": {"type": "string", "format": "date-time"}
},
"required": ["departure", "destination", "flight_number", "departure_time"]
}
}
]
} 输出格式示例:
{
"score": 1.0,
"reason": "所有参数均符合工具定义,名称、类型完全匹配,且所有值均来自历史上下文,无虚构内容,符合零幻觉要求。"
} 
