Skip to content

Commit 81594a6

Browse files
committed
Updated README.md
1 parent 05f8156 commit 81594a6

File tree

2 files changed

+29
-13
lines changed

2 files changed

+29
-13
lines changed

README.md

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Code samples related to [Building Better Bots](https://aws.amazon.com/blogs/ai/b
33

44
# CoffeeBot
55

6-
CoffeeBot is a transactional chat bot that can help one order a mocha (relies on AWS Mobile Hub and Android).
6+
CoffeeBot is a transactional chat bot that can help one order a coffee.
77

88
Consider this conversation:
99
> User: May I have a mocha?
@@ -26,18 +26,17 @@ Consider this conversation:
2626
2727
> CoffeeBot: Great! Your mocha will be available for pickup soon. Thanks for using CoffeeBot!
2828
29-
Let's build this voice bot, an Android App that talks to you using Amazon Polly and Amazon Lex.
30-
You'll need the following in addition to your AWS account:
31-
- Android development environment ([download](https://developer.android.com/sdk))
32-
- To test voice (you can use the simulator for text)
33-
- An Android device
34-
- A USB cable for USB debugging ([more info for Amazon Fire tablets](https://developer.amazon.com/public/solutions/devices/fire-tablets/app-development/setting-up-your-development-environment-for-fire-tablets))
3529

36-
37-
First, we'll create the Amazon Lex bot. Then, we'll add some Lambda Functions to bring it to life. Finally, we'll put it all together with Mobile Hub and the Lex Android SDK.
30+
First, we'll create the Amazon Lex bot. Then, we'll add some Lambda Functions to bring it to life. Lastly, as an optional step, create an Android application with the Mobile Hub and the Lex Android SDK.
3831

3932
## Amazon Lex bot
33+
Amazon Lex is a service for building conversational interfaces into any application using voice and text.
34+
35+
We will be creating a custom bot in the console and applying the necessary intents and custom slots in order to understand the coffee order.
36+
4037
#### 1. Create bot
38+
First, we'll create the bot.
39+
4140
1. From the Amazon Lex console, create a Custom bot with these settings (you can see these in the "Settings" tab later)
4241
- Bot name: `CoffeeBot`
4342
- To work independently in a shared environment, use your initials in the name (e.g., `CoffeeBotXXX`)
@@ -49,9 +48,9 @@ First, we'll create the Amazon Lex bot. Then, we'll add some Lambda Functions t
4948

5049
![Error Handling](/images/error_handling.png)
5150

52-
- Prompts: (one prompt) `Sorry, but I didn't understand that. Would you try again, please?`
53-
- Maximum number of retries: `2`
54-
- Hang-up phrase: (one phrase) `Sorry, I could not understand. Goodbye.`
51+
- Prompts: (one prompt) `Sorry, but I didn't understand that. Would you try again, please?`
52+
- Maximum number of retries: `2`
53+
- Hang-up phrase: (one phrase) `Sorry, I could not understand. Goodbye.`
5554

5655
#### 2. Create Order Beverage Intent
5756

@@ -89,6 +88,8 @@ Slot type name | Description | Values (each entry on a separate line)
8988
`cafeBeverageTemp` | | `kids`; `hot`; `iced`
9089

9190
#### 4. Add Slots to the Intent
91+
From the intent page of your cafeOrderBeverageIntent, locate "Slots" midway down the page.
92+
9293
Add the following entries to the list of Slots, choosing the Slot Types created above. Click "Save Intent".
9394

9495
Required | Name | Slot type | Prompt
@@ -99,9 +100,16 @@ Required | Name | Slot type | Prompt
99100
 | `BeverageTemp` | `cafeBeverageTemp` | `Would you like that iced or hot?`
100101

101102
#### 5. Test
102-
Build the app and test some of the Utterances in the Test Bot dialog at the bottom right of the Amazon Lex Console. For example, if you say `May I have a chai?`, does Lex correctly map `chai` to the `BeverageType` slot?
103+
104+
![Build](/images/build.png)
105+
106+
Click the build icon in the upper right hand corner to build the app. This can take a few minutes.
107+
108+
Once built, a new panel will appear on the right of the Amazon Lex Console where you can test some of the Utterances in the Test Bot dialog. For example, if you say `May I have a chai?`, does Lex correctly map `chai` to the `BeverageType` slot?
103109

104110
## Lambda Function
111+
Now that we've tested that our application works, let's add more logic to validate our choices and handle the processing of the order.
112+
105113
1. Create the `cafeOrderCoffee` function by saving `cafeOrderCoffee_lambda.js` as a Node.js 6.10 function
106114
- To work independently in a shared environment, use your initials in the function name (e.g., `cafeOrderCoffeeXXX`)
107115
- You can get the function source [here](https://github.com/awslabs/amz-ai-building-better-bots/blob/master/src/index.js)
@@ -125,6 +133,14 @@ Build the app and test some of the Utterances in the Test Bot dialog at the bott
125133
1. Test using the Amazon Lex Console; do you see any responses when you ask `May I have a mocha?`
126134

127135
## Android App
136+
Now, let's build this voice bot through an Android App that talks to you using Amazon Polly and Amazon Lex.
137+
You'll need the following in addition to your AWS account:
138+
- Android development environment ([download](https://developer.android.com/sdk))
139+
- To test voice (you can use the simulator for text)
140+
- An Android device
141+
- A USB cable for USB debugging ([more info for Amazon Fire tablets](https://developer.amazon.com/public/solutions/devices/fire-tablets/app-development/setting-up-your-development-environment-for-fire-tablets))
142+
143+
128144
1. From the Mobile Hub console, create a new project called `CoffeeBot`.
129145
1. Add the "Conversational Bots" feature to the project. When prompted, import `CoffeeBot`. Mobile Hub takes care of a number of important details behind the scenes. A new Amazon Cognito Federated Identity Pool is created for this new app along with roles so that the users can interact with Lex (using voice and text).
130146
1. Source code for the new app is immediately available for download.

images/build.png

5.31 KB
Loading

0 commit comments

Comments
 (0)