Exercise - Add conversation starters

Completed

Update the declarative agent to include conversation starters that provide users with sample prompts to help them understand the types of questions they can ask.

In Visual Studio Code:

  1. In the appPackage folder, open the declarativeAgent.json file.

  2. Add the following code snippet to the file:

    "conversation_starters": [
        {
            "title": "Product information",
            "text": "Tell me about Eagle Air"
        },
        {
            "title": "Returns policy",
            "text": "What is the returns policy?"
        },
        {
            "title": "Product information",
            "text": "Can you provide information on a specific product?"
        },
        {
            "title": "Product troubleshooting",
            "text": "I'm having trouble with a product. Can you help me troubleshoot the issue?"
        },
        {
            "title": "Repair information",
            "text": "Can you provide information on how to get a product repaired?"
        },
        {
            "title": "Contact support",
            "text": "How can I contact support for help?"
        }
    ]
    
  3. Save your changes.

The declarativeAgent.json file should look like this:

{
  "$schema": "https://developer.microsoft.com/json-schemas/copilot/declarative-agent/v1.3/schema.json",
  "version": "v1.3",
  "name": "Product support",
  "description": "Product support agent that can help answer customer queries about Contoso Electronics products",
  "instructions": "$[file('instruction.txt')]",
  "capabilities": [
    {
      "name": "OneDriveAndSharePoint",
      "items_by_url": [
        {
          "url": "https://{tenant}-my.sharepoint.com/personal/{user}/Documents/Products"
        }
      ]
    }
  ],
  "conversation_starters": [
    {
      "title": "Product information",
      "text": "Tell me about Eagle Air"
    },
    {
      "title": "Returns policy",
      "text": "What is the returns policy?"
    },
    {
      "title": "Product information",
      "text": "Can you provide information on a specific product?"
    },
    {
      "title": "Product troubleshooting",
      "text": "I'm having trouble with a product. Can you help me troubleshoot the issue?"
    },
    {
      "title": "Repair information",
      "text": "Can you provide information on how to get a product repaired?"
    },
    {
      "title": "Contact support",
      "text": "How can I contact support for help?"
    }
  ]
}

Next, upload your changes and start a debug session.

In Visual Studio Code:

  1. In the Activity Bar, open the Microsoft 365 Agents Toolkit extension.
  2. In the Lifecycle section, select Provision.
  3. Wait for the upload to complete.
  4. In the Activity Bar, switch to the Run and Debug view.
  5. Select the Start Debugging button next to the configuration’s dropdown, or press F5. A new browser window is launched and navigates to Microsoft 365 Copilot.

Next, test your declarative agent in Microsoft 365 and validate the results.

Continuing in the web browser:

  1. In Microsoft 365 Copilot, select the icon in the top right to expand the Copilot side panel.
  2. Find Product support in the list of agents and select it to enter the immersive experience to chat directly with the agent. Notice that the conversation starters you defined in the manifest display in the user interface.

Screenshot of Microsoft Edge showing the Product support declarative agent in the immersive experience with custom conversation starters.

Close the browser to stop the debug session in Visual Studio Code.