Extend a low-code UiPath agent with an API Workflow tool that queries the 5e SRD at runtime.
This lab builds part of UiPathfinder, an RPG Adventure system built on UiPath for a fictional Adventurer's Guild. It extends an agent built in the Getting Started with UiPath Agents lab. You build a live API connector that searches the 5e SRD (System Reference Document), then give your Monster Selector agent that connector as a tool. The agent uses it autonomously at runtime: deciding what to search for, calling the API, and selecting the best match from the results.
最后,您将拥有UiPathfinder.QuestParser :一个智能体,该智能体仅接收任务描述,决定搜索内容,调用脚本查询工具,并返回所选脚本的关键字段,而无需预填充列表。
如果没有工具,智能体将依赖于调用者来预取候选对象并将其作为数据传递。添加工具将改变:智能体在运行时决定搜索内容、调用 API 并对实时结果进行推理。这是大多数生产智能体工作流背后的模式;智能体的价值来自于它的获取和推理能力,而不仅仅是对交给的东西进行分类。
您将执行以下操作:
- Build a Monster Query API Workflow that calls the 5e SRD.
- 将其作为工具连接到 Monitor Selector 智能体。
- 更新智能体合同以反映新功能。
- 使用端到端工具对完整的智能体进行测试。
预计时间: 30-45 分钟
您要构建的内容
| 组件 | 详细信息 |
|---|---|
| API 工作流 | Accepts searchName (string), calls the Open5e 5e SRD API, returns monsterResults array |
智能体输入: questDescription | string;任务说明。智能体通过该工具获取自己的候选对象 |
智能体输出: monsterIndex | string; the API's key identifier for the selected monster, for example srd_goblin |
智能体输出: monsterName | string;所选模型的显示名称 |
智能体输出: monsterType | string; creature type (for example, beast, undead, dragon). The API returns this as an object, so the agent reads type.name |
智能体输出: monsterCr | string; challenge rating. The API returns a number, such as 0.25, which the agent renders as text |
智能体输出: monsterReasoning | string;智能体对选择此生物来执行任务的原因的解释 |
先决条件
- Studio Web - 在您的浏览器中运行;无需安装桌面。开始之前,请在 Chrome、Edge 或 Firefox 中打开Studio Web 。
- UiPath 帐户- 开始之前,请注册或登录UiPath Automation Cloud 。
- Node.js 18+ - 安装 UiPath CLI 所必需的。如有需要,请从nodejs.org安装。
- UiPath CLI v1.198.0+ - required to deploy the starter. Check with
uip --version; install or upgrade withnpm install -g @uipath/cli. - Studio Web 中的 Unattended Selector 智能体- 该实验室以UiPath 智能体入门中的智能体为基础构建。如果您完成了该实验,则表示您的智能体已就绪。如果没有,请部署入门版:
git clone https://github.com/cliff-simpkins/UiPath-Workshops.git
cd UiPath-Workshops/starters/monster-selector
uip login
uip solution upload .
git clone https://github.com/cliff-simpkins/UiPath-Workshops.git
cd UiPath-Workshops/starters/monster-selector
uip login
uip solution upload .
在开始第 1 步之前,打开Studio Web并确认Unattended 选取器显示在您的工作区中。