From 78d9e6b504881c009fd7eac176dca424a2fe1707 Mon Sep 17 00:00:00 2001 From: William Wong Date: Mon, 10 Feb 2025 21:22:04 +0000 Subject: [PATCH 1/6] Add payload --- docs/STARTER_PROMPTS.md | 53 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 docs/STARTER_PROMPTS.md diff --git a/docs/STARTER_PROMPTS.md b/docs/STARTER_PROMPTS.md new file mode 100644 index 0000000000..d278081dda --- /dev/null +++ b/docs/STARTER_PROMPTS.md @@ -0,0 +1,53 @@ +# Starter Prompts + +Starter prompts are a special message that would send during greeting. It can consist of: + +- An optional image +- An optional name of the bot +- An optional description about the bot (supports Markdown) +- Up to 6 buttons with predefined message to assist customers to jumpstart the conversation + - An optional icon for each button + - A title for each button (plain text, required) + - The message to send or put in the send box when clicked (plain text, required) + +```json +{ + "type": "event", + "name": "StarterPrompts", // Should we name this "greeting" event? And should it be camelCase, PascalCase, kebab-case? + "entities": [ + { + "@context": "https://schema.org", + "@id": "", + "@type": "Message", + "type": "https://schema.org/Message", + + "sender": { + "@type": "Person", + "description": "I can help you with anything around you. Just let me know.", + "image": "https://.../bot.svg", // Could be data URI of an image. + "name": "Secretary Bot" + }, + "potentialActions": [ + { + "@type": "SendAction", + "image": "https://.../clock.svg", // Could be data URI of an image. + "name": "Check time", + "object": { + "@type": "Message", + "text": "What time is it now?" + } + }, + { + "@type": "SendAction", + "image": "https://.../cloud.svg", // Could be data URI of an image. + "name": "Check weather", + "object": { + "@type": "Message", + "text": "Do I need to bring an umbrella?" + } + } + ] + } + ] +} +``` From 2ca8990969e25f85be2c57c0d7e2875c5671e46d Mon Sep 17 00:00:00 2001 From: William Wong Date: Mon, 10 Feb 2025 21:25:52 +0000 Subject: [PATCH 2/6] Clarify text format --- docs/STARTER_PROMPTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/STARTER_PROMPTS.md b/docs/STARTER_PROMPTS.md index d278081dda..53b272c7ff 100644 --- a/docs/STARTER_PROMPTS.md +++ b/docs/STARTER_PROMPTS.md @@ -3,7 +3,7 @@ Starter prompts are a special message that would send during greeting. It can consist of: - An optional image -- An optional name of the bot +- An optional name of the bot (plain text) - An optional description about the bot (supports Markdown) - Up to 6 buttons with predefined message to assist customers to jumpstart the conversation - An optional icon for each button From 43ee40004fc6dbe72f5218102390fd8e7f405934 Mon Sep 17 00:00:00 2001 From: William Wong Date: Tue, 11 Feb 2025 14:22:15 -0800 Subject: [PATCH 3/6] Update STARTER_PROMPTS.md --- docs/STARTER_PROMPTS.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/STARTER_PROMPTS.md b/docs/STARTER_PROMPTS.md index 53b272c7ff..b8a32cf6db 100644 --- a/docs/STARTER_PROMPTS.md +++ b/docs/STARTER_PROMPTS.md @@ -5,10 +5,10 @@ Starter prompts are a special message that would send during greeting. It can co - An optional image - An optional name of the bot (plain text) - An optional description about the bot (supports Markdown) -- Up to 6 buttons with predefined message to assist customers to jumpstart the conversation - - An optional icon for each button +- 1 to 6 buttons with predefined message to assist customers to jumpstart the conversation - A title for each button (plain text, required) - The message to send or put in the send box when clicked (plain text, required) + - Notes: if the Starter prompts has no prompt buttons, service should not send Starter Prompts activity. Web Chat should ignore Starter Prompts activity without any buttons ```json { @@ -30,7 +30,6 @@ Starter prompts are a special message that would send during greeting. It can co "potentialActions": [ { "@type": "SendAction", - "image": "https://.../clock.svg", // Could be data URI of an image. "name": "Check time", "object": { "@type": "Message", @@ -39,7 +38,6 @@ Starter prompts are a special message that would send during greeting. It can co }, { "@type": "SendAction", - "image": "https://.../cloud.svg", // Could be data URI of an image. "name": "Check weather", "object": { "@type": "Message", From 7a0ff56253d4fac3ace52c56e7dc32d8a2f7d7e4 Mon Sep 17 00:00:00 2001 From: William Wong Date: Tue, 11 Feb 2025 14:40:03 -0800 Subject: [PATCH 4/6] Update STARTER_PROMPTS.md --- docs/STARTER_PROMPTS.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/STARTER_PROMPTS.md b/docs/STARTER_PROMPTS.md index b8a32cf6db..28355aaa5a 100644 --- a/docs/STARTER_PROMPTS.md +++ b/docs/STARTER_PROMPTS.md @@ -10,6 +10,15 @@ Starter prompts are a special message that would send during greeting. It can co - The message to send or put in the send box when clicked (plain text, required) - Notes: if the Starter prompts has no prompt buttons, service should not send Starter Prompts activity. Web Chat should ignore Starter Prompts activity without any buttons +## UX design choices + +- Buttons will show as a 3x2 grid when width of Web Chat is >= 500px. If it is <= 499px, buttons will show as a 1x3 grid with "show more" +- If there is a "Starter Prompts" activity being sent in the conversation, the "View prompts" button will always show on lower right, just above the send box + - If suggested actions are shown, it will be show on top of the "View prompts" button +- Clicking on the "View prompts" button will pop up a modal dialog to select multiple buttons + +## Payload + ```json { "type": "event", From 20a2c6b500b637974f38a516dd62b388015c83b6 Mon Sep 17 00:00:00 2001 From: William Wong Date: Tue, 11 Feb 2025 14:47:25 -0800 Subject: [PATCH 5/6] Update STARTER_PROMPTS.md --- docs/STARTER_PROMPTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/STARTER_PROMPTS.md b/docs/STARTER_PROMPTS.md index 28355aaa5a..274e434079 100644 --- a/docs/STARTER_PROMPTS.md +++ b/docs/STARTER_PROMPTS.md @@ -30,6 +30,7 @@ Starter prompts are a special message that would send during greeting. It can co "@type": "Message", "type": "https://schema.org/Message", + "keywords": ["WelcomeMessage"], // What name should we put in? Pre-chat message, Starter Prompts, greeting, welcome? "sender": { "@type": "Person", "description": "I can help you with anything around you. Just let me know.", From ba4df3fe11c96216e6dabaf9b2067cfd05fc7b9b Mon Sep 17 00:00:00 2001 From: William Wong Date: Tue, 11 Feb 2025 14:55:40 -0800 Subject: [PATCH 6/6] Update STARTER_PROMPTS.md --- docs/STARTER_PROMPTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/STARTER_PROMPTS.md b/docs/STARTER_PROMPTS.md index 274e434079..c8ce5fdee0 100644 --- a/docs/STARTER_PROMPTS.md +++ b/docs/STARTER_PROMPTS.md @@ -4,7 +4,7 @@ Starter prompts are a special message that would send during greeting. It can co - An optional image - An optional name of the bot (plain text) -- An optional description about the bot (supports Markdown) +- An optional description about the bot (Markdown) - 1 to 6 buttons with predefined message to assist customers to jumpstart the conversation - A title for each button (plain text, required) - The message to send or put in the send box when clicked (plain text, required)