Skip to content
Open
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 29 additions & 10 deletions msteams-platform/bots/how-to/conversations/prompt-suggestions.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Suggested actions help users continue conversations with your bot.

:::column-end:::

:::row-end:::
:::row-end:::

## Prompt starters

Expand All @@ -47,7 +47,20 @@ Suggested actions help users continue conversations with your bot.
>
> * Prompt starters are only supported for one-on-one chat bots.

To enable prompt starters, define the `commands` property in your bot's app manifest. Each command contains a `title` and `description`. The `title` is the prompt and the `description` describes what the users accomplish. When the user selects on a prompt starter, the `title` of the prompt is populated in the compose box. To define `commands` in your app manifest, you can either use **Developer Portal** or add them manually in the app manifest.
To enable prompt starters, define the `commands` property in your bot's app manifest. Each command now contains four fields, a `title`, `description`, `type`, and `prompt`.
- The `title` field is the text shown in the prompt starter. When selected, this text is populated into the compose box.
- The `description` field describes what the users accomplish.
- The `type` field indicates whether the bot command is a basic command or a prompt.
Set `type` to **prompt** and provide the text in the prompt field.
- The `prompt`field defines the text to populate in the compose box, when the command is a prompt type.

>[!NOTE]
>
>If you're building an agent, you must set `type` to **prompt** and provide a valid prompt value. If the `prompt` field is empty, the app manifest fails validation during submission.

## Define `commands` in app manifest

To define `commands` in your app manifest, you can either use **Developer Portal** or add them manually in the app manifest.

# [Developer Portal](#tab/developer-portal)

Expand All @@ -70,7 +83,7 @@ To create prompt starters using Developer Portal:
* **Command**: Appears as the prompt for your bot.
* **Description**: A brief explanation of the purpose of the command.

1. Select the personal scope and then select **Add**. This defines where the command menu must appear.
1. Select the personal scope and then select **Add**. This step defines where the command menu must appear.

:::image type="content" source="~/assets/images/tdp/bot-command.png" alt-text="Screenshot shows how to add a command, description, and scopes for your bot.":::

Expand Down Expand Up @@ -102,19 +115,25 @@ The manifest example code for prompt starters is as follows:
"commands":[
{
"title":"Help",
"description":"Displays this help message"
"description":"Displays this help message",
},
{
"title":"Search Flights",
"description":"Search flights from Seattle to Phoenix May 2-5 departing after 3pm"
"description":"Search flights from Seattle to Phoenix May 2-5 departing after 3pm",
"type": "prompt",
"prompt": "Search flights from Seattle to Phoenix May 2-5 departing after 3pm. Please show me the best options."
},
{
"title":"Search Hotels",
"description":"Search hotels in Portland tonight"
"description":"Search hotels in Portland tonight",
"type": "prompt",
"prompt": "Search hotels in Portland for tonight. Please show me available options with good ratings."
},
{
"title":"Best Time to Fly",
"description":"Best time to fly to London for a 5 day trip this summer"
"description":"Best time to fly to London for a 5 day trip this summer",
"type": "prompt",
"prompt": "What is the best time to fly to London for a 5 day trip? I'm looking for good weather and reasonable prices."
}
]
}
Expand All @@ -130,7 +149,7 @@ The manifest example code for prompt starters is as follows:
> [!NOTE]
> If you remove any commands from your manifest, you must redeploy your app to implement the changes. In general, any changes to the manifest require you to redeploy your app.

The following illustrates an example of prompt suggestions:
The following image illustrates an example of prompt suggestions:

# [Desktop](#tab/desktop)

Expand All @@ -142,7 +161,7 @@ The following illustrates an example of prompt suggestions:

---

Prompt starters reappear in the **View Prompts** flyout above the compose box during a conversation and enables users to review the prompts while interacting with your bot.
Prompt starters reappear in the **View Prompts** flyout above the compose box during a conversation and enable users to review the prompts while interacting with your bot.

:::image type="content" source="~/assets/images/bots/prompt-starter-desktop-reappear.png" alt-text="Screenshot that shows the Prompt Starter reappear during the conversation." lightbox="~/assets/images/bots/prompt-starter-desktop-reappear.png":::

Expand All @@ -153,7 +172,7 @@ You must handle menu commands in your bot code as you handle any message from us
Bots in a group or channel respond only when they're @mentioned in a message. Every message received by a bot when in a group or channel scope contains its name in the message text. Before handling the command being returned, your message parsing must handle the message received by a bot with its name.

> [!NOTE]
> Handle the commands in code, they are sent to your bot as a regular message. You must handle them as you would handle any other message from your users. The commands in code insert pre-configured text into the text box. The user must then send that text as they do for any other message.
> Handle the commands in code, they're sent to your bot as a regular message. You must handle them as you would handle any other message from your users. The commands in code insert preconfigured text into the text box. The user must then send that text as they do for any other message.

# [C#](#tab/dotnet)

Expand Down