activities
latest
false
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。
UiPath logo, featuring letters U and I in white

Integration Service 活动

上次更新日期 2025年10月29日

交互智能体

描述

此活动支持使用 Snowflake Cortex 智能体作为 Maestro 编排的自动化流程的参与者。

创建 Snowflake 智能体

Snowflake 提供了用于创建 Cortex 智能体的无代码体验。保存后,即可在 Maestro 中使用。无代码体验包括测试提示和评估智能体输出的功能。Cortex 智能体将以与 Snowflake 仪表板中的用户提示相同的方式回复 Maestro。在大多数 Maestro 场景中,您将提示智能体以 JSON 结构的形式生成输出。例如{"sku1": "9735A45", "sku2": "1735A50"}。

如何使用活动

要在 Maestro 智能体流程中使用此活动,请按照以下步骤操作:

  1. 在画布中添加服务任务元素,然后打开任务的“属性”面板。
  2. 将服务任务命名为Snowflake Hello World
  3. 实施部分的操作下拉列表中,选择启动并等待外部智能体
  4. 选择“Snowflake Cortex”连接器。
  5. 选择现有连接或新建连接。有关更多信息,请参阅Snowflake Cortex 身份验证
  6. “活动”中,选择“Interact Agent”

  7. “数据库”中,选择一个数据库,例如SNOWFLAKE_INTELLIGENCE
  8. “架构”中,选择一个架构,例如AGENTS
  9. “智能体名称”中,选择之前在 Snowflake 中创建的智能体。
  10. “提示词”中,输入“您可以执行什么操作?”。确保在提示词中添加引号。
    docs image
  11. 将开始事件连接到画布中的服务任务,然后将服务任务连接到结束事件节点。

  12. 选择“调试”以运行此流程。成功运行后,请查看全局变量并查找来自来源“ Snowflake Hello World”的{:} 响应 。记下回复的结构。

    例如,以下是智能体对“你可以做什么?”提示的响应:

    {
      "type": "text",
      "text": "\nI can help you analyze and optimize your manufacturing, inventory, order fulfillment, and sales forecasting processes. Here’s what I can do:\n\n- Query and analyze your inventory, orders, production forecasts, and sales forecasts using advanced SQL queries.\n- Answer questions about current inventory levels, order statuses, and customer orders.\n- Help you determine if current or future orders can be fulfilled based on available or forecasted inventory.\n- Provide insights into upcoming production and expected sales for specific products or SKUs.\n- Generate tables and visualizations (bar, line, and pie charts) to help you understand trends and patterns in your data.\n- Assist with business analytics, SaaS metrics, and research methodology for data-driven decision-making.\n\nYou don’t need to know SQL—just ask your business questions, and I’ll use the appropriate tools to get you answers!\n"
    }{
      "type": "text",
      "text": "\nI can help you analyze and optimize your manufacturing, inventory, order fulfillment, and sales forecasting processes. Here’s what I can do:\n\n- Query and analyze your inventory, orders, production forecasts, and sales forecasts using advanced SQL queries.\n- Answer questions about current inventory levels, order statuses, and customer orders.\n- Help you determine if current or future orders can be fulfilled based on available or forecasted inventory.\n- Provide insights into upcoming production and expected sales for specific products or SKUs.\n- Generate tables and visualizations (bar, line, and pie charts) to help you understand trends and patterns in your data.\n- Assist with business analytics, SaaS metrics, and research methodology for data-driven decision-making.\n\nYou don’t need to know SQL—just ask your business questions, and I’ll use the appropriate tools to get you answers!\n"
    }

智能体的输出必须分配给流程变量,以便影响 Maestro 流程的进度,例如,根据布尔值评估做出决策,或使用分类任务的答案。

  1. 在设计模式下,从设计画布中选择智能体。

  2. 选择(“属性” >“属性”)

  3. 在“输出”下,选择“新增” ,然后添加一个名为 agent_reponse 的 字符串 类型变量。

  4. 对于“值” ,选择“Snowflake Hello World” > “响应” > “智能体操作文本(字符串)” 。这表示回复的文本组件。

提示:在实践中,指定您选择的智能体的结构化输出,然后使用表达式编辑器在 Maestro 中评估输出,以按照流程所需的类型提取所需的输出的特定部分。

故障排除和调整

除了建立连接外,您还应该在 Snowflake 工作区和 Maestro 中测试提示词。这可确保您获得所需的输出,这些输出最适合 Maestro 使用,分配给变量,并传递给流程中的其他参与者。

我们建议将详细提示保留在 Snowflake 中智能体的系统提示中。Maestro 在运行时向智能体提供的用户提示应该简明扼要。其作用主要是指示智能体执行特定任务并生成预期的一致输出所需的相关变量。

针对人类的输出(例如升级原因)可以轻松地作为自然文本传递给人类。API/机器人操作的预期输出必须经过严格撰写。以下是智能体生成特定输出的用户提示示例。使用 Studio 中的 C# 表达式编辑器根据需要添加变量。
"What is the quantity on inventory of Order ID " + vars.orderId_1 + "respond only with a JSON object with the quantity in the key Order_Quantity. No explanations, only JSON""What is the quantity on inventory of Order ID " + vars.orderId_1 + "respond only with a JSON object with the quantity in the key Order_Quantity. No explanations, only JSON"

智能体将回复:

{"Order_Quantity":"100"}{"Order_Quantity":"100"}
然后,您可以使用js:JSON.parse(variable of type string)函数将类型为string智能体响应转换为JSON 。请特别注意您向智能体发出的请求和实际响应中所包含的类型。即使响应的类型看起来像JSON ,它实际上可能是string类型。
  • 描述
  • 创建 Snowflake 智能体
  • 如何使用活动
  • 故障排除和调整

此页面有帮助吗?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath Logo
信任与安全
© 2005-2025 UiPath。保留所有权利。