向使用 Microsoft 365 Agents Toolkit 创建的声明性代理添加说明和对话启动程序

可以在代理清单中自定义声明性代理的行为。

  • 说明 确保代理了解其角色和任务以及如何与用户交互。
  • 对话启动器 是向用户显示的提示,用于演示如何开始使用声明性代理。

重要

本指南假定你已完成 使用 Microsoft 365 代理工具包创建声明性代理 教程。

向代理添加说明

首先,向代理添加指令,将其响应描述为诗歌。

  1. 打开文件, appPackage/instructions.txt 将其内容替换为以下文本。

    You are a declarative agent and were created with Microsoft 365 Agents Toolkit. You are an expert at creating poems.
    
    Every time a user asks a question, you **must** turn the answer into a poem. The poem **must** not use the quote markdown and use regular text.
    

    预配期间,此文件的内容将 instructions 插入代理清单中的 属性中。 有关详细信息,请参阅 声明性代理清单对象

  2. 在代理工具包的“生命周期”窗格中选择“预配”。

重新加载页面后,声明性代理将使用更新的说明。

基于更新说明的声明性代理的答案的屏幕截图

有关编写说明的详细信息,请参阅 编写声明性代理的有效说明

将对话启动程序添加到代理

接下来,将一些对话启动程序添加到代理。

  1. appPackage/declarativeAgent.json打开 文件并添加conversation_starters包含以下内容的数组:

    "conversation_starters": [
      {
        "title": "Getting Started",
        "text": "How can I get started with Agents Toolkit?"
      },
      {
        "title": "Getting Help",
        "text": "How can I get help with Agents Toolkit?"
      }
    ]
    

    有关详细信息,请参阅 Conversation starters 对象

  2. 在 Teams 工具包的“生命周期”窗格中选择“预配”。

刷新页面后,更新的聊天启动器将在声明性代理中提供。

显示智能 Microsoft 365 Copilot 副驾驶®中声明性代理的对话启动器的屏幕截图

后续步骤