- 概述
- 开始使用
- 概念
- 使用 UiPath CLI
- 操作指南
- CI/CD 方法
- 命令参考
- 迁移
- 参考与支持
uip 智能体调试
使用示例输入对 Studio Web 运行低代码智能体,并使用“uip agentDebug”流式传输结果。
uip agent debug 使用您提供的输入,针对 Studio Web 端到端运行低代码智能体,轮询直到运行完成且流式传输状态发生变化。需要登录。
项目必须使用 project.uiproj 清单文件 — 仍使用旧版 project.json 布局的项目会快速失败,并显示转换指令(uip solution pack/publish 等打包命令仍接受 project.json;仅适用于 Studio 网页的命令,例如需要使用较新的清单文件)。
大纲
uip agent debug <project-path> [-i <json>] [--attachment <field=path>]... [--poll-interval <ms>] [--timeout <seconds>] [--login-validity <minutes>]
uip agent debug <project-path> [-i <json>] [--attachment <field=path>]... [--poll-interval <ms>] [--timeout <seconds>] [--login-validity <minutes>]
参数
<project-path>(必填) — 智能体项目目录的路径(包含agent.json)。
选项
| 标记 | 默认 | 用途 |
|---|---|---|
-i, --inputs <json> | {} | JSON 对象形式的输入参数,例如'{"input":"hello"}' 。必须解析为普通对象。对于“作业附件”字段,请传递现有的 Orchestrator 附件引用{"ID": "<attachment-id>"} ,或使用--attachment上传本地文件。 |
--attachment <field=path> | — | 将本地文件上传到agent.json的作业附件输入字段中。可重复。该字段必须在inputSchema中声明为{"$ref": "#/definitions/job-attachment"} 。仅当架构为作业附件数组时重复同一字段。路径从当前工作目录开始解析,而不是从智能体项目目录开始解析。Data.Attachments返回上传的附件 ID。 |
--poll-interval <ms> | 2000 | 轮询间隔(以毫秒为单位)。 |
--timeout <seconds> | 600 秒(10 分钟) | 等待运行完成的最长秒数。 |
--login-validity <minutes> | 10 | 要继续操作,在令牌过期之前剩余的最短分钟数。 |
示例
uip agent debug ./my-agent -i '{"input":"hello"}'
uip agent debug ./my-agent --timeout 120 --poll-interval 5000
# Upload a local PDF into the job-attachment input field fileIn
uip agent debug ./my-agent --attachment fileIn=./invoice.pdf -i '{"question":"What is the total?"}'
uip agent debug ./my-agent -i '{"input":"hello"}'
uip agent debug ./my-agent --timeout 120 --poll-interval 5000
# Upload a local PDF into the job-attachment input field fileIn
uip agent debug ./my-agent --attachment fileIn=./invoice.pdf -i '{"question":"What is the total?"}'
--inputs中同时存在的字段的--attachment值会覆盖--inputs值,并且该命令会记录警告。既没有--attachment也没有--inputs值的必填作业附件输入也会产生警告。
数据形状(--输出 json)
成功( Code: "AgentDebug" ):
{
"Code": "AgentDebug",
"Data": {
"JobKey": "a1b2c3d4-0000-0000-0000-000000000401",
"TraceId": "b2c3d4e5-0000-0000-0000-000000000001",
"State": "Successful",
"Output": { "content": "hi there" }
},
"Instructions": "Debug run completed: Successful"
}
{
"Code": "AgentDebug",
"Data": {
"JobKey": "a1b2c3d4-0000-0000-0000-000000000401",
"TraceId": "b2c3d4e5-0000-0000-0000-000000000001",
"State": "Successful",
"Output": { "content": "hi there" }
},
"Instructions": "Debug run completed: Successful"
}
Output 仅当运行生成一个时才存在;仅当服务返回额外诊断信息时,才存在 Info。
当运行使用--attachment上传文件时, Data.Attachments会列出每个上传的内容:
{
"Code": "AgentDebug",
"Data": {
"JobKey": "a1b2c3d4-0000-0000-0000-000000000401",
"TraceId": "b2c3d4e5-0000-0000-0000-000000000001",
"State": "Successful",
"Output": { "answer": "1,234.00 USD" },
"Attachments": [
{
"Field": "fileIn",
"AttachmentId": "c3d4e5f6-0000-0000-0000-000000000002",
"FileName": "invoice.pdf",
"MimeType": "application/pdf",
"Size": 48213
}
]
}
}
{
"Code": "AgentDebug",
"Data": {
"JobKey": "a1b2c3d4-0000-0000-0000-000000000401",
"TraceId": "b2c3d4e5-0000-0000-0000-000000000001",
"State": "Successful",
"Output": { "answer": "1,234.00 USD" },
"Attachments": [
{
"Field": "fileIn",
"AttachmentId": "c3d4e5f6-0000-0000-0000-000000000002",
"FileName": "invoice.pdf",
"MimeType": "application/pdf",
"Size": 48213
}
]
}
}
要在以后的运行中重复使用已上传的文件而不再次上传,请在--inputs中传递其引用,例如'{"fileIn":{"ID":"c3d4e5f6-0000-0000-0000-000000000002"}}' 。
附件错误— 在上传或运行任何内容之前, --attachment值无效( field=path格式错误、字段不是作业附件输入的字段、路径缺失、为空或目录路径)失败,原因是Retry: "RetryWillNotFix" 。当 Orchestrator 拒绝上传时,不会启动任何调试作业。
不成功的最终状态— 相同的Code: "AgentDebug" ,但作为失败返回(退出代码1 ), Message: "Debug run <state>."和Instructions指向uip traces spans get <TraceId>以检查运行。
项目清单文件不兼容:
{
"Result": "Failure",
"ErrorCode": "invalid_argument",
"Message": "...",
"Instructions": "Convert the listed project(s) to a project.uiproj manifest before debugging: scaffold the accepted layout with 'uip api-workflow init <name>' inside the solution and move Workflow.json (plus entry-points.json and bindings_v2.json) into it, then remove the project.json-based entry from the .uipx. Note that 'uip solution pack' and 'uip solution publish' accept project.json — only Studio Web-bound commands require project.uiproj."
}
{
"Result": "Failure",
"ErrorCode": "invalid_argument",
"Message": "...",
"Instructions": "Convert the listed project(s) to a project.uiproj manifest before debugging: scaffold the accepted layout with 'uip api-workflow init <name>' inside the solution and move Workflow.json (plus entry-points.json and bindings_v2.json) into it, then remove the project.json-based entry from the .uipx. Note that 'uip solution pack' and 'uip solution publish' accept project.json — only Studio Web-bound commands require project.uiproj."
}
相关内容
uip agent validate— 首先运行以确认项目格式正确;上传失败说明中建议。uip traces spans get— 在处于不成功状态后检查调试运行的追踪。