完成审查
AI Agent 任务完成度检查:用 Jev 区分做完、待验证与阻塞
Jev AI 独立教程 · 内容核对于 · Read in English
Agent 有时只是找到了下一步,却已经宣告任务完成。完成检查将原始目标与已完成工作、验证记录和已知缺口逐项对照,再让 Jev 输出有限的工作流状态,辅助决定能否向用户交付。
completion 预设使用合成的重复扣款任务。找到账单并说明退款计划,不等于退款已经发生。检查既要保留这个区别,也不能突破原本的审批要求。
读完你能做什么
- 提供原始目标和已经实际完成的工作证据。
- 区分尚未实现、尚未验证与真正阻塞。
- 继续工作时保留权限边界,并限制重复检查次数。
本文目录
先定义完成标准,再要求给出结论
从用户要求的结果出发。如果只要求诊断,有证据的解释就可能完成任务;如果要求退款,定位重复扣款只是其中一步。只看到 Agent 最后一句总结,审查者很难准确还原两者差别。
在工作开始前记录可观察的验收条件。软件任务可以是行为改变和相关检查通过;外部操作可以是经授权的结果及核实的回执。完成标准取决于授权范围,而不是 Agent 还能想到多少额外事情。
分开记录计划、尝试与已经完成的操作
预设要求 objective,以及 completed_work、verification、known_gaps 三个数组。已完成动作放进 completed_work,测试结果、回执或检查观察放进 verification,剩余任务与不确定性放进 known_gaps,即使总结语气很肯定,也不能省略缺口。
尽量由工具获取权威状态。声称测试通过弱于实际测试结果,声称已退款弱于支付系统记录。传入模型时去掉无关的回执隐私或客户信息,但保留审查必需的事实。
| 证据 | 如何看待 |
|---|---|
| 接下来我会退款 | 只是计划,不算已完成 |
| 退款请求超时 | 结果未知的尝试 |
| 服务商确认已授权退款完成 | 已观察的操作结果,仍按业务要求验证 |
| 仍需获得审批 | 待解决依赖,不能暗示已有权限 |
将四种结果映射到受控流程
done 表示目标已达成、已验证且没有重大缺口;verify_more 表示工作可能已经完成但还需检查;continue_work 表示还有必要任务未做;blocked 表示缺少访问权限、信息或授权,无法推进剩余工作。
结论只帮助分流,不会扩大任务权限。continue_work 不能授权用户没要求的支付。blocked 应在流程记录中对应明确缺失项。超时后重试之前先查外部状态,避免重复执行其实已经完成的操作。
说明性示例,非实时 API 结果
// 在校验原生响应后:
const status = result.answers.status.choice;
const transition = {
done: "prepare_final_status",
verify_more: "run_relevant_verification",
continue_work: "resume_authorized_work",
blocked: "report_missing_dependency",
}[status] ?? "human_review";
// 设置重试预算和人工升级路径,避免无限循环。同时检查过早结束与无谓继续
构造真正完成、只有计划、已实现但未测、有已知缺陷、缺审批等案例,并围绕原始目标标注。也要加入完全做好的任务:总要求继续的审查器,同样没有帮助。
分别统计错误的 done 和不必要的继续。出现分歧时检查证据,不要反复询问直到得到 done。只有新证据出现,才更新 state,并在有限次数内复核;标准无法解决的情况应允许人工处理。
完整请求与运行方法
在 OmniaKey 创建 API Key,并在终端或服务器环境中设置 OMNIAKEY_API_KEY。下面的 curl 示例需要支持 --fail-with-body 的 curl(7.76 或更新),JavaScript 示例需要 Node.js 20 或更新。请使用测试数据;调用使用自己的账户额度,当前价格与可用性以 OmniaKey 为准。
将 JavaScript 保存为 jev-example.mjs 后运行 node jev-example.mjs。不要把密钥写进前端代码或提交到 Git。示例保留英文输入以便与调试预设对照;中文业务数据需单独验证效果。
curl
curl --fail-with-body --max-time 25 'https://api.omniakey.com/v1/alpha/search' \
-H "Authorization: Bearer ${OMNIAKEY_API_KEY}" \
-H 'Content-Type: application/json' \
--data '{
"model": "jev-latest",
"state": {
"objective": "Resolve a customer'\''s duplicate-charge report",
"completed_work": [
"Matched both charges to the same order"
],
"verification": [
"Customer identity and charge records verified"
],
"known_gaps": [
"Refund has not been approved or issued"
]
},
"questions": {
"status": {
"type": "choice",
"instructions": "Compare the objective with completed work, verification, and known gaps. Do not treat a plan, attempted action, or unverified assertion as completed work.",
"criteria": {
"done": "The objective is achieved, verified, and has no material outstanding gaps.",
"verify_more": "Additional verification is required before claiming completion.",
"continue_work": "Implementation or other required work remains unfinished.",
"blocked": "Missing authority, access, or information prevents required remaining work."
}
}
}
}'展开 Node.js 完整示例
Node.js 20+
// Node.js 20+. Save as jev-example.mjs and run: node jev-example.mjs
// Set OMNIAKEY_API_KEY in the server/terminal environment first.
const key = process.env.OMNIAKEY_API_KEY;
if (!key) throw new Error("Set OMNIAKEY_API_KEY before running.");
const body = {
"model": "jev-latest",
"state": {
"objective": "Resolve a customer's duplicate-charge report",
"completed_work": [
"Matched both charges to the same order"
],
"verification": [
"Customer identity and charge records verified"
],
"known_gaps": [
"Refund has not been approved or issued"
]
},
"questions": {
"status": {
"type": "choice",
"instructions": "Compare the objective with completed work, verification, and known gaps. Do not treat a plan, attempted action, or unverified assertion as completed work.",
"criteria": {
"done": "The objective is achieved, verified, and has no material outstanding gaps.",
"verify_more": "Additional verification is required before claiming completion.",
"continue_work": "Implementation or other required work remains unfinished.",
"blocked": "Missing authority, access, or information prevents required remaining work."
}
}
}
};
const response = await fetch("https://api.omniakey.com/v1/alpha/search", {
method: "POST",
headers: {
Authorization: `Bearer ${key}`,
"Content-Type": "application/json",
},
body: JSON.stringify(body),
signal: AbortSignal.timeout(25_000),
});
if (!response.ok) {
const retryAfter = response.headers.get("retry-after");
throw new Error(`Jev HTTP ${response.status}; Retry-After: ${retryAfter ?? "not supplied"}`);
}
const result = await response.json();
console.log(JSON.stringify(result, null, 2));
// Inspect and validate the answer before connecting it to any external action.
下方是发送给 API 的原生 JSON。教程的调试入口会选中对应预设;预设输入与此原生请求不是同一个结构。使用自定义 Jev 时,直接粘贴下方 JSON。
复制原生 JSON 到调试台
Native JSON
{
"model": "jev-latest",
"state": {
"objective": "Resolve a customer's duplicate-charge report",
"completed_work": [
"Matched both charges to the same order"
],
"verification": [
"Customer identity and charge records verified"
],
"known_gaps": [
"Refund has not been approved or issued"
]
},
"questions": {
"status": {
"type": "choice",
"instructions": "Compare the objective with completed work, verification, and known gaps. Do not treat a plan, attempted action, or unverified assertion as completed work.",
"criteria": {
"done": "The objective is achieved, verified, and has no material outstanding gaps.",
"verify_more": "Additional verification is required before claiming completion.",
"continue_work": "Implementation or other required work remains unfinished.",
"blocked": "Missing authority, access, or information prevents required remaining work."
}
}
}
}如何解读结果
读取 answers.status.choice 与概率分布。预设里虽然调查了重复扣款,但仍记录退款缺口。这是检验过早宣告完成的案例,不是本页公布的模型准确率实测。
得到 done 后仍要核实独立验收条件。得到 verify_more 或 continue_work 时,应映射到具体检查或任务。本接口不会替你生成可靠的完整计划,也不会执行剩余工作。
请求失败时怎么办
- 请求格式错误(如 400)
- 核对 model、state、questions,以及各题目的 type、选项或范围。不要把 chat messages 结构发到此端点。
- 鉴权或账户拒绝(如 401、402、403)
- 核对 API Key、账户余额、模型访问权限与当前服务商政策。状态码本身不能唯一确定原因;在 OmniaKey 后台检查,避免把密钥贴进反馈。
- 限流(429)
- 读取 Retry-After(如有),降低并发并采用有上限的退避。示例不自动重试,重复请求可能额外计费。
- 5xx、网络错误或超时
- 检查服务状态和连接,再决定是否重试。本例 25 秒超时仅中止客户端等待,不保证上游停止处理或免计费。
- HTTP 成功但结果无法使用
- 检查响应结构、问题名与题目类型。缺少答案或未知选项应进入回退或人工检查,不要强制转换后直接执行。
接入前的验证
- 实现完成且相关验证通过。
- 结尾语气肯定,但实际只有计划。
- 请求超时,外部动作可能已完成。
- 继续调用模型也无法解决的真实授权阻塞。
- 任务已完成,不应附加无关改进。
常见问题
Jev 会自行检查仓库或支付系统吗?
本请求只评估你提交的 state。应由工具收集和验证相关证据。调试台不会连接你的仓库、执行测试或访问付款记录。
应该一直重试直到返回 done 吗?
不应该。没有新证据而换了一个答案,不代表任务完成。应设定重试预算,解决真实缺口,使用更新证据复核,并升级处理仍有分歧的情况。
依据与后续阅读
协议说明依据 OmniaKey 的 Jev 接入指南与鉴权文档核对。请求示例经过本地结构校验;本文不声称对每种业务场景完成了线上效果评测。本站不是模型开发者或 OmniaKey 官方网站。
用自己的任务试一次
先用测试输入查看原生请求与模型答案。有账户即可进入 OmniaKey 密钥管理;尚未注册时,按 OmniaKey 页面提示创建账户。