(Updated via BpDeleteTranslateTags script) |
|||
Line 1: | Line 1: | ||
− | + | ||
− | = How to Create an Amazon Lex Bot = | + | = How to Create an Amazon Lex Bot = |
Bright Pattern Contact Center integrates with Amazon Lex, a platform for building, testing, and deploying chatbots from the AWS Management Console. Lex provides both automatic speech recognition (ASR) and natural language understanding (NLU) technologies, enabling chatbots to recognize customers’ speech and text input, understand intent, and transcribe speech input. Integration with Lex lets your contact center access Lex through chat scenarios and provide bot assistance from within chat interactions. | Bright Pattern Contact Center integrates with Amazon Lex, a platform for building, testing, and deploying chatbots from the AWS Management Console. Lex provides both automatic speech recognition (ASR) and natural language understanding (NLU) technologies, enabling chatbots to recognize customers’ speech and text input, understand intent, and transcribe speech input. Integration with Lex lets your contact center access Lex through chat scenarios and provide bot assistance from within chat interactions. | ||
− | |||
In this article, you will learn how to create a basic Amazon Lex bot that can be used as a conversational bot with your [[5.3:Contact-center-administrator-guide/WebChatConfiguration | configured chat service]]. | In this article, you will learn how to create a basic Amazon Lex bot that can be used as a conversational bot with your [[5.3:Contact-center-administrator-guide/WebChatConfiguration | configured chat service]]. | ||
Line 9: | Line 8: | ||
− | |||
[[File:BPChat-Ex-1.PNG|thumb|450px|center|Chat showing an integrated Lex bot and suggestions for the agent]] | [[File:BPChat-Ex-1.PNG|thumb|450px|center|Chat showing an integrated Lex bot and suggestions for the agent]] | ||
− | == Procedure == | + | == Procedure == |
This procedure will walk you through the process of setting up your first Amazon Lex bot. For a deeper understanding of Amazon Lex and other AWS resources, refer to [https://docs.aws.amazon.com/lex/latest/dg/what-is.html AWS’s Amazon Lex Developer Guide]. | This procedure will walk you through the process of setting up your first Amazon Lex bot. For a deeper understanding of Amazon Lex and other AWS resources, refer to [https://docs.aws.amazon.com/lex/latest/dg/what-is.html AWS’s Amazon Lex Developer Guide]. | ||
− | === Step 1: Create an AWS account === | + | === Step 1: Create an AWS account === |
# If you haven’t already done so, [https://docs.aws.amazon.com/lex/latest/dg/gs-account.html set up an AWS account]. | # If you haven’t already done so, [https://docs.aws.amazon.com/lex/latest/dg/gs-account.html set up an AWS account]. | ||
− | === Step 2: Create an IAM user, grant administrative permissions, and save credentials === | + | === Step 2: Create an IAM user, grant administrative permissions, and save credentials === |
Our integration accounts require access keys to connect to and use your Amazon Lex bot. Access keys are created and managed in AWS Identity and Access Management (IAM) services. | Our integration accounts require access keys to connect to and use your Amazon Lex bot. Access keys are created and managed in AWS Identity and Access Management (IAM) services. | ||
− | |||
To get an access key, you need to: | To get an access key, you need to: | ||
# Go to your [https://console.aws.amazon.com/iam/ AWS Management Console > IAM Dashboard]. If you don't know where it is, search AWS Services for "IAM."<br /><br /> | # Go to your [https://console.aws.amazon.com/iam/ AWS Management Console > IAM Dashboard]. If you don't know where it is, search AWS Services for "IAM."<br /><br /> | ||
Line 27: | Line 24: | ||
# Copy the '''access key ID''' (e.g., AKIAIOSFODNN7EXAMPLE) and the '''secret access key''' (e.g., wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY). Save this for when you set up an [[5.3:Tutorials-for-admins/SetupanAWSLexIntegrationAccount | AWS Lex bot/chat suggestions integration account]].<br /><br /> | # Copy the '''access key ID''' (e.g., AKIAIOSFODNN7EXAMPLE) and the '''secret access key''' (e.g., wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY). Save this for when you set up an [[5.3:Tutorials-for-admins/SetupanAWSLexIntegrationAccount | AWS Lex bot/chat suggestions integration account]].<br /><br /> | ||
− | |||
For more information, see [https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html Managing Access Keys for IAM Users]. | For more information, see [https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html Managing Access Keys for IAM Users]. | ||
− | === Step 3: Add Lex as a service and create a sample bot === | + | === Step 3: Add Lex as a service and create a sample bot === |
# Sign in to the AWS Management Console and open the [https://console.aws.amazon.com/lex/ Amazon Lex console].<br /><br /> | # Sign in to the AWS Management Console and open the [https://console.aws.amazon.com/lex/ Amazon Lex console].<br /><br /> | ||
# On the ''Create your bot'' page, you can create a custom bot or create a ready-to-use one with a sample template. For the sake of this example procedure, select the '''Book Trip''' sample.<br /><br /> | # On the ''Create your bot'' page, you can create a custom bot or create a ready-to-use one with a sample template. For the sake of this example procedure, select the '''Book Trip''' sample.<br /><br /> | ||
Line 36: | Line 32: | ||
− | |||
[[File:Lex-1.PNG|thumb|800px|center|Amazon Lex Create Your Bot page]] | [[File:Lex-1.PNG|thumb|800px|center|Amazon Lex Create Your Bot page]] | ||
− | === Step 4: Review the bot workspace === | + | === Step 4: Review the bot workspace === |
The bot workspace will open. Notice that there are four tabs at the top: Editor, Settings, Channels, and Monitoring. In this exercise, we will be focusing on the '''Editor''' tab only. You can come back to the other tabs later. | The bot workspace will open. Notice that there are four tabs at the top: Editor, Settings, Channels, and Monitoring. In this exercise, we will be focusing on the '''Editor''' tab only. You can come back to the other tabs later. | ||
− | |||
[[File:Lex-2.PNG|thumb|800px|center|Amazon Lex Editor properties]] | [[File:Lex-2.PNG|thumb|800px|center|Amazon Lex Editor properties]] | ||
− | |||
The Editor tab includes the properties for every intent. | The Editor tab includes the properties for every intent. | ||
− | === Step 5: Edit intent properties === | + | === Step 5: Edit intent properties === |
''Intents'' are actions triggered by keywords entered by your customer. You can think of intents as what customers want to do. For example, the first intent included in our sample Lex bot is "BookCar," which is what the customer wants to do (book a car) and what the bot recognizes it needs to do based on the customer's text input. | ''Intents'' are actions triggered by keywords entered by your customer. You can think of intents as what customers want to do. For example, the first intent included in our sample Lex bot is "BookCar," which is what the customer wants to do (book a car) and what the bot recognizes it needs to do based on the customer's text input. | ||
− | ==== Properties ==== | + | ==== Properties ==== |
* '''Sample utterances''' - Phrases (i.e., keywords) that trigger the intent (e.g., "Reserve a car" or "make a car reservation" or "book a car")<br /><br /> | * '''Sample utterances''' - Phrases (i.e., keywords) that trigger the intent (e.g., "Reserve a car" or "make a car reservation" or "book a car")<br /><br /> | ||
* '''Lambda initialization and validation''' - AWS Lambda Function that validates the customer's input<br /><br /> | * '''Lambda initialization and validation''' - AWS Lambda Function that validates the customer's input<br /><br /> | ||
Line 64: | Line 57: | ||
* '''Response''' - Message(s) or response cards that close the intent or invoke a different one | * '''Response''' - Message(s) or response cards that close the intent or invoke a different one | ||
− | === Step 6: Save and build === | + | === Step 6: Save and build === |
# For this example procedure, leave everything on the Editor tab as-is.<br /><br /> | # For this example procedure, leave everything on the Editor tab as-is.<br /><br /> | ||
# If you did change something, be sure to click '''Save''' at the bottom.<br /><br /> | # If you did change something, be sure to click '''Save''' at the bottom.<br /><br /> | ||
#Click '''Build''' at the top of the page. This builds the bot with the configured intents. | #Click '''Build''' at the top of the page. This builds the bot with the configured intents. | ||
− | === Step 7: Test it === | + | === Step 7: Test it === |
Once the build is complete, you can test the bot in the chat window. | Once the build is complete, you can test the bot in the chat window. | ||
− | |||
# On the right side of the screen, click '''Test chatbot''' to pop out the chat window.<br /><br /> | # On the right side of the screen, click '''Test chatbot''' to pop out the chat window.<br /><br /> | ||
# Try typing a request such as, “I want to book a trip.” See what happens. | # Try typing a request such as, “I want to book a trip.” See what happens. | ||
− | |||
[[File:Lex-9.PNG|thumb|650px|center|Test chat that invokes the BookCar intent]] | [[File:Lex-9.PNG|thumb|650px|center|Test chat that invokes the BookCar intent]] | ||
− | === Step 8: Publish your bot === | + | === Step 8: Publish your bot === |
# At the top of the page, click '''Publish'''.<br /><br /> | # At the top of the page, click '''Publish'''.<br /><br /> | ||
# In the ''Publish'' dialog that opens, choose or create a new alias (e.g., “TripBooker”) for this bot. The ''alias'' is used to point to the specific version of the bot. Having multiple aliases for the same bot allows you to keep and access different intents and properties for the same bot.<br /><br /> | # In the ''Publish'' dialog that opens, choose or create a new alias (e.g., “TripBooker”) for this bot. The ''alias'' is used to point to the specific version of the bot. Having multiple aliases for the same bot allows you to keep and access different intents and properties for the same bot.<br /><br /> | ||
Line 87: | Line 78: | ||
− | |||
[[File:Lex-3.PNG|thumb|800px|center|Publish this version (alias) of the Amazon Lex bot]] | [[File:Lex-3.PNG|thumb|800px|center|Publish this version (alias) of the Amazon Lex bot]] | ||
− | == Next Steps == | + | == Next Steps == |
You have now set up a very basic Amazon Lex bot that can be integrated with Bright Pattern Contact Center. You may now: | You have now set up a very basic Amazon Lex bot that can be integrated with Bright Pattern Contact Center. You may now: | ||
* Read AWS documentation, explore Amazon Lex intents and slot types, and edit as desired | * Read AWS documentation, explore Amazon Lex intents and slot types, and edit as desired | ||
Line 97: | Line 87: | ||
* Edit a [[Scenario-builder-reference-guide/HowtoCreateChatScenarioThatUsesBots | chat scenario that uses your bot]] | * Edit a [[Scenario-builder-reference-guide/HowtoCreateChatScenarioThatUsesBots | chat scenario that uses your bot]] | ||
* [[Tutorials-for-admins/AI/HowtoIntegrateBotswithChat | Configure web chat to work with bots]] | * [[Tutorials-for-admins/AI/HowtoIntegrateBotswithChat | Configure web chat to work with bots]] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 04:04, 29 May 2024
How to Create an Amazon Lex Bot
Bright Pattern Contact Center integrates with Amazon Lex, a platform for building, testing, and deploying chatbots from the AWS Management Console. Lex provides both automatic speech recognition (ASR) and natural language understanding (NLU) technologies, enabling chatbots to recognize customers’ speech and text input, understand intent, and transcribe speech input. Integration with Lex lets your contact center access Lex through chat scenarios and provide bot assistance from within chat interactions.
In this article, you will learn how to create a basic Amazon Lex bot that can be used as a conversational bot with your configured chat service.
Please note that Bright Pattern only supports version 1 Amazon Lex bots at this time.
Procedure
This procedure will walk you through the process of setting up your first Amazon Lex bot. For a deeper understanding of Amazon Lex and other AWS resources, refer to AWS’s Amazon Lex Developer Guide.
Step 1: Create an AWS account
- If you haven’t already done so, set up an AWS account.
Step 2: Create an IAM user, grant administrative permissions, and save credentials
Our integration accounts require access keys to connect to and use your Amazon Lex bot. Access keys are created and managed in AWS Identity and Access Management (IAM) services.
To get an access key, you need to:
- Go to your AWS Management Console > IAM Dashboard. If you don't know where it is, search AWS Services for "IAM."
- From the IAM root menu, click Users and then click Add user to create an IAM user and grant administrative permissions. Adding a user creates credentials that are used to access AWS.
- Copy the access key ID (e.g., AKIAIOSFODNN7EXAMPLE) and the secret access key (e.g., wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY). Save this for when you set up an AWS Lex bot/chat suggestions integration account.
For more information, see Managing Access Keys for IAM Users.
Step 3: Add Lex as a service and create a sample bot
- Sign in to the AWS Management Console and open the Amazon Lex console.
- On the Create your bot page, you can create a custom bot or create a ready-to-use one with a sample template. For the sake of this example procedure, select the Book Trip sample.
- The Create Your Bot page will open. That is where you develop your Amazon Lex bot.
Step 4: Review the bot workspace
The bot workspace will open. Notice that there are four tabs at the top: Editor, Settings, Channels, and Monitoring. In this exercise, we will be focusing on the Editor tab only. You can come back to the other tabs later.
The Editor tab includes the properties for every intent.
Step 5: Edit intent properties
Intents are actions triggered by keywords entered by your customer. You can think of intents as what customers want to do. For example, the first intent included in our sample Lex bot is "BookCar," which is what the customer wants to do (book a car) and what the bot recognizes it needs to do based on the customer's text input.
Properties
- Sample utterances - Phrases (i.e., keywords) that trigger the intent (e.g., "Reserve a car" or "make a car reservation" or "book a car")
- Lambda initialization and validation - AWS Lambda Function that validates the customer's input
- Slots - Data the customer must provide in order to fulfill the intent action (e.g., slot "PickUpCity" collects customer data about the city in which the car will be picked up)
- Confirmation prompt - Questions that confirm the intent actions and prompt the customer to input data (e.g., "Okay, I have you down for a car to be picked up in {PickUpCity}. Should I continue booking the car?")
- Fulfillment - AWS's business logic required to fulfill the customer's intent
- AWS Lamda Function - The function used as a code hook for your Amazon Lex bot; this can perform initialization and validation, fulfillment, or both
- Return parameters to client - Sends the intent information to the client application (i.e., Bright Pattern scenario) for intent fulfillment
- AWS Lamda Function - The function used as a code hook for your Amazon Lex bot; this can perform initialization and validation, fulfillment, or both
- Response - Message(s) or response cards that close the intent or invoke a different one
Step 6: Save and build
- For this example procedure, leave everything on the Editor tab as-is.
- If you did change something, be sure to click Save at the bottom.
- Click Build at the top of the page. This builds the bot with the configured intents.
Step 7: Test it
Once the build is complete, you can test the bot in the chat window.
- On the right side of the screen, click Test chatbot to pop out the chat window.
- Try typing a request such as, “I want to book a trip.” See what happens.
Step 8: Publish your bot
- At the top of the page, click Publish.
- In the Publish dialog that opens, choose or create a new alias (e.g., “TripBooker”) for this bot. The alias is used to point to the specific version of the bot. Having multiple aliases for the same bot allows you to keep and access different intents and properties for the same bot.
- Click Publish again.
Next Steps
You have now set up a very basic Amazon Lex bot that can be integrated with Bright Pattern Contact Center. You may now:
- Read AWS documentation, explore Amazon Lex intents and slot types, and edit as desired
- Create an AWS Lex bot/chat suggestions integration account
- Edit a chat scenario that uses your bot
- Configure web chat to work with bots
< Previous | Next >