getting-started
latest
false
入门开发者指南
重要 :
请注意,此内容已使用机器翻译进行了本地化。
新发布内容的本地化可能需要 1-2 周的时间才能完成。
构建智能体
使用 Autopilot 生成智能体配置,然后查看并优化系统提示词、输入和输出。
在 Studio Web 中创建一个智能体项目,并让 Autopilot 根据简单的语言描述生成其系统提示词、输入架构和输出架构。然后,根据本实验室其余部分所依赖的输入和输出检查生成的配置。
步骤 1 - 打开 Studio Web
打开 Studio Web,并在您的云端工作区中启动一个新的智能体项目。
- 登录到UiPath Automation Cloud 。
- 从左侧导航栏中打开Studio Web 。此时将打开您的云端工作区,显示现有的解决方案和“新建”按钮。
- 打开新建旁边的下拉菜单。
- 从项目类型列表中选择“智能体” 。
步骤 2 - 使用 Autopilot 生成智能体
Studio Web 中的 Autopilot 可以使用简单的语言描述配置智能体。您可以描述需求,Autopilot 会提出系统提示词、输入架构和输出架构。
-
选择自主式作为智能体类型。
-
在“您的智能体应该做什么?”页面中。字段中,粘贴以下说明:
Build an autonomous agent that classifies quests for a fantasy RPG Adventurer's Guild. Keep it simple: build the system prompt and input/output schemas only. You do not need to add any tools, contexts, or escalations.
Given a quest description, the agent should consider the quest, what monster the party is likely to face while completing the quest, and then classify the quest's difficulty as one of four tiers:
- Trivial: simple errands anyone can handle (e.g., deliver a letter, clear rats from a cellar)
- Standard: moderate quests requiring some adventuring skill (e.g., escort a merchant caravan, hunt a wyvern, drive back the kobolds)
- Heroic: difficult quests requiring significant adventuring expertise (e.g., slay an adult dragon, infiltrate a thieves' guild)
- Legendary: extreme quests requiring top-tier heroes to complete (e.g., defeat a lich, slay an ancient dragon)
Return the tier and a brief, two-sentence reasoning. Use these exact field names:
- Input: questDescription (string, required)
- Outputs: tier (string, restricted to exactly "Trivial", "Standard", "Heroic", or "Legendary", so the agent can't return any other value) and reasoning (string)
Build an autonomous agent that classifies quests for a fantasy RPG Adventurer's Guild. Keep it simple: build the system prompt and input/output schemas only. You do not need to add any tools, contexts, or escalations.
Given a quest description, the agent should consider the quest, what monster the party is likely to face while completing the quest, and then classify the quest's difficulty as one of four tiers:
- Trivial: simple errands anyone can handle (e.g., deliver a letter, clear rats from a cellar)
- Standard: moderate quests requiring some adventuring skill (e.g., escort a merchant caravan, hunt a wyvern, drive back the kobolds)
- Heroic: difficult quests requiring significant adventuring expertise (e.g., slay an adult dragon, infiltrate a thieves' guild)
- Legendary: extreme quests requiring top-tier heroes to complete (e.g., defeat a lich, slay an ancient dragon)
Return the tier and a brief, two-sentence reasoning. Use these exact field names:
- Input: questDescription (string, required)
- Outputs: tier (string, restricted to exactly "Trivial", "Standard", "Heroic", or "Legendary", so the agent can't return any other value) and reasoning (string)
-
选择“生成智能体” 。
-
查看“Autopilot”窗口中的建议。Autopilot 会根据您提供的提示构建和配置智能体。
-
接受建议以创建智能体。
提示词特意采用结构化设计,每个部分各尽其能:
- 预先排除。指示 Autopilot 不要添加工具、上下文或升级可最大限度地精简智能体,因此智能体的每个部分均可满足您的需求。
- 列表形式显示“层级”。每行一个层次,每个层次都包含示例,这为 Autopilot 提供了清晰的边界,可以复制到系统提示词中。
- 精确的字段名称各占一行。Autopilot 在架构中逐字使用这些名称,您稍后构建的评估集取决于这些名称。
- 带有原因的约束条件。将
tier限制为四个值,并说明原因,可以阻止智能体创造第 5 层级,例如“适中”。
重要提示:
Autopilot 是非确定性的,因此您生成的配置可能与屏幕截图不同。在智能体画布加载成功并包含questDescription输入以及tier和reasoning输出后继续。如果画布显示错误或加载失败,请刷新页面并重复此步骤。
步骤 3 - 查看智能体画布
检查 Autopilot 是否构建了本实验室其余部分所依赖的输入、输出和层级值,并更正任何缺失或多余的内容。
- 当智能体画布打开时,选择智能体节点以打开其“属性”面板。您还可以使用画布右上角的扳手图标打开属性。
- 在生成的配置中检查以下内容:
- 已列出输入-
questDescription(字符串)。 - 输出- 列出
tier(字符串)和reasoning(字符串)。 - 系统提示- 描述四个层,并为每个层提供一个示例。
- 已列出输入-
- 打开数据管理器(左侧栏的剪贴板图标)。
- 选择
tier输出。 - 检查这四个值是否准确为
Trivial、Standard、Heroic和Legendary。根据 Autopilot 生成架构的方式,这些值会显示为允许值的列表或在字段说明中显示。两者均可。 - 如果列表或说明中缺少或添加了层级,请对其进行编辑。
优化系统提示词(可选)
Autopilot 根据您的描述生成有效系统提示词,但其用词每次运行都有所不同。如果您想要获得与本实验室中的预期输出相符的一致结果,请将“属性”面板中的系统提示词替换为以下内容:
You are a quest intake classifier for an adventurer's guild in a fantasy RPG world.
Classify the incoming quest description into exactly one difficulty tier:
- Trivial: simple errands anyone can handle (for example, deliver a letter, clear rats from a cellar)
- Standard: moderate quests requiring some adventuring skill (for example, escort a merchant caravan, hunt a wyvern, drive back the kobolds)
- Heroic: difficult quests requiring significant adventuring expertise (for example, slay an adult dragon, infiltrate a thieves' guild)
- Legendary: extreme quests requiring top-tier heroes to complete (for example, defeat a lich, slay an ancient dragon)
Consider the quest and the creatures the adventurers are likely to face. If no monster is stated, infer only a reasonable threat from the description and say when it is uncertain.
Return the tier and a brief, two-sentence reasoning.
- `tier` must be exactly one of "Trivial", "Standard", "Heroic", or "Legendary"; never return another value.
- `reasoning` must be exactly two concise sentences and mention both the quest's challenge and the likely monster or threat.
- Never add markdown, extra keys, or extra text.
Final reminder: make one consistent tier decision and return exactly two sentences of reasoning.
You are a quest intake classifier for an adventurer's guild in a fantasy RPG world.
Classify the incoming quest description into exactly one difficulty tier:
- Trivial: simple errands anyone can handle (for example, deliver a letter, clear rats from a cellar)
- Standard: moderate quests requiring some adventuring skill (for example, escort a merchant caravan, hunt a wyvern, drive back the kobolds)
- Heroic: difficult quests requiring significant adventuring expertise (for example, slay an adult dragon, infiltrate a thieves' guild)
- Legendary: extreme quests requiring top-tier heroes to complete (for example, defeat a lich, slay an ancient dragon)
Consider the quest and the creatures the adventurers are likely to face. If no monster is stated, infer only a reasonable threat from the description and say when it is uncertain.
Return the tier and a brief, two-sentence reasoning.
- `tier` must be exactly one of "Trivial", "Standard", "Heroic", or "Legendary"; never return another value.
- `reasoning` must be exactly two concise sentences and mention both the quest's challenge and the likely monster or threat.
- Never add markdown, extra keys, or extra text.
Final reminder: make one consistent tier decision and return exactly two sentences of reasoning.
智能体配置后,您可以根据下一部分中的实际任务描述对其进行测试。