验证智能体配置,部署到 Studio Web,并在调试面板中运行端到端测试。
智能体在本地验证后,您就可以将其上传到 Studio Web 并运行实时测试。
步骤 7 - 上传到 Studio Web
将解决方案从解决方案目录上传到 Studio Web:
uip solution upload .
uip solution upload .
成功上传后,系统会返回"Status": "Uploaded successfully"以及SolutionId和DesignerUrl ,您可以直接在浏览器中打开该 。现在,您的智能体作为可编辑项目存在于 Studio Web 中。
上传与部署uip solution upload将解决方案作为可编辑的源项目发送到 Studio Web:这是开发和测试的正确目标。当您准备好在生产环境中运行智能体时,您可以使用uip solution pack + uip solution publish构建版本控制的包,并将其部署到 Orchestrator。此实验室使用上传功能。
步骤 8 - 在 Studio Web 中测试智能体
-
登录到UiPath Automation Cloud ,然后从侧边导航栏中打开Studio Web 。
-
在项目列表中找到您的DesignerSelector项目,然后选中该项目以打开该项目。
-
Studio Web 在 Agent Builder 中打开智能体。确认您可以看到:
- 右侧面板中的系统提示词
questDescription和monsters列为输入monsterIndex列为输出
-
在顶部工具栏中选择“调试” 。在输入面板中,粘贴以下 JSON:
{ "questDescription": "A wealthy merchant's caravan has been attacked near the harbor. Eyewitnesses report tentacles, hypnotic powers, and strange psychic disturbances for miles around.", "monsters": [ {"index": "aboleth", "name": "Aboleth"}, {"index": "kraken", "name": "Kraken"}, {"index": "giant-octopus", "name": "Giant Octopus"}, {"index": "sea-hag", "name": "Sea Hag"}, {"index": "dryad", "name": "Dryad"} ] }{ "questDescription": "A wealthy merchant's caravan has been attacked near the harbor. Eyewitnesses report tentacles, hypnotic powers, and strange psychic disturbances for miles around.", "monsters": [ {"index": "aboleth", "name": "Aboleth"}, {"index": "kraken", "name": "Kraken"}, {"index": "giant-octopus", "name": "Giant Octopus"}, {"index": "sea-hag", "name": "Sea Hag"}, {"index": "dryad", "name": "Dryad"} ] } -
选择保存并调试,运行智能体。
-
在“输出”面板中查看结果。验证
monsterIndex是否包含"aboleth"或"kraken"— 对于有触手的思维控制水生杀器,两者都是防御性的选择。如果看到"giant-octopus",则提示词可能需要收紧。
智能体具有非确定性。即使使用temperature: 0 ,模型也可能在每次运行中生成不同的输出。目标是合理的选择,而不是特定的字符串。使用接下来的两个示例来了解智能体的推理方式;一致的错误答案是优化提示的信号。
请尝试以下额外输入:
"questDescription": "Clear out the moon-worshipping coven abducting village children under the full moon"其中包含候选对象"sea-hag"、"night-hag"、"green-hag"、"dryad";应返回 HA 变体"questDescription": "Slay the beast terrorizing the northern kingdoms with fire and ancient cruelty"其中包含候选对象"ancient-red-dragon"、"young-red-dragon"、"hell-hound"、"salamander";应返回"ancient-red-dragon"
您构建的内容
您使用 UiPath CLI 构建并发布了低代码智能体:
- 从终端构建了解决方案和智能体项目。
- 通过直接编辑
agent.json和entry-points.json,配置系统提示词、输入架构和输出架构。 - 在上传前在本地验证项目。
- 已上传到 Studio Web 并运行实时测试。
本实验中的按键命令:
| 命令 | 操作 |
|---|---|
uip solution init <name> | 新建解决方案(可部署容器) |
uip agent init <path> | 构建新的低代码智能体项目,并将其注册到该解决方案 |
uip agent validate <path> | 上传前在本地验证智能体架构 |
uip solution upload . | 将解决方案作为可编辑项目上传到 Studio Web |
后续操作
- Adding Tools to Your UiPath Agent - extend Monster Selector with a tool that calls the 5e SRD API directly, removing the
monsters[]input and letting the agent decide what to search for. - 编排模式 (未来的实验室) :您的智能体可从 UiPath 流项目、API 工作流和其他智能体调用。
- UiPath 智能体文档- 有关低代码和编码智能体功能的完整参考。
- UiPath Community - 论坛、操作方法和开发者讨论
下次,请跳至末尾。现在,您已经了解了每个命令的作用,您的编码智能体可以在单个提示下运行整个序列。安装 UiPath 技能(步骤 2)后,技能将携带 CLI 知识,您的提示只需提供他们无法知道的信息:智能体名称、输入、输出和系统提示。
“创建一个名为 [AgentName] 的低代码 UiPath 智能体。输入架构:[列出每个字段的名称、类型和说明]。输出架构:[列出每个字段]。系统提示词:“[您的提示词]”。验证并上传。”
例如,要重新创建您在本实验室中构建的 Unattended Selector 智能体,请执行以下操作:
"Create a low-code UiPath agent named MonsterSelector. Input schema: questDescription (string, "Description of the quest") and monsters (array, "Candidate monsters from the 5e SRD API"). Output schema: monsterIndex (string, "The index slug of the chosen monster"). System prompt: 'You are an RPG game master helping to select the most thematically appropriate monster for a quest. Given a quest description and a list of candidate monsters (each with a name and an index slug), pick the ONE monster whose lore, environment, or threat level best fits the quest. Return ONLY the index slug of your chosen monster. Do not return the full object or any commentary - just the string slug. If multiple candidates fit, favor the most iconic or thematically resonant choice.' Validate and upload."