Problem Statement: The virtual agent Luma Virtual Agent would need to understand the user request /phrase and fetch the values/data information required to process the request automatically from the user request without asking for the information that was already given..
Opportunity: Make the Virtual Agent more intelligent enough to understand the Phrases and identify the possible values for the next prompts by extracting the values. The Bot must extract and assign the values to the prompts on its own and skip the prompts in case the values are already fetchedprovided by the end-user.
Approach: The Skill definition will now have an option to associate attributes to the User Phrases to define where the Bot can expect values for the prompts. The Virtual Agent will train itself to identify any value which is entered in the Phrase by the User and associate it with the Global Attribute. Next time when the User user enters any value, it will be identified as a value for the prompt and the prompt will be skipped automatically.
LetLet's understand how to build a skill Book my Tickets in Luma Virtual Agent Builder skill that resets the AD User Passwordthat would extract the information from the user phrase using entity Extraction to Search and book the flight tickets.
The following are the steps to configure the skill:
Table of Contents |
---|
Step 1: Define Attribute
Create an attribute username SourceCity to get the username who would like to book the Travel tickettravel source city for the travel
On Skill Builder--> Attribute tab, click on Create Attribute.
Add attribute details such as Name and Data type as Text.
Set the NLP Extraction Method to Value. This enables the Luma Virtual Agent toextract the information from the user phrase.
Set the prompt message to be displayed to the end-user, like “Enter your name. “Click Save“Provide the Source city“
Click Save.
Follow the above steps and create the below attributes:
Destination to get the Destination city from the end-user. Set the NLP Extraction Method to Value.
TravelDate to store the date of travel from the end-user. Set the NLP Extraction Method to Pattern. Add validation to accept a date in a valid format, such as dd/mm/yyyy.
TravelOptions to accept the end-user flight selection from the available flight options for the search criteria.
No of Travellers to get the count of passengers traveling for ticket booking
PassengerName to get the name of the main Passenger traveling for ticket booking.
PassengerAge to get the age of the main Passenger traveling for ticket booking.
EmailID to get the email id of the Passenger traveling for ticket booking. Add validation to accept a valid email address.
Step 2: Create an Integration
Define Integration to the target system TravelAPI with the “SearchFlight” operation.
On the tenant menu, click on Integration.
Create an Application with the integration type as REST.
Add an instance to the Azure environment.
Configure the ‘SearchFlight’ Operation
Pass attributes SourceCity, Destination, and TravelDate to the operation.
Fetch the available flight options received as a response from the web service and assign the values to a local attribute Flights of datatype List.
Define the ‘Error Handling’rule to be executed when the integration returns an error.
Click on Click here to add rule and add the rule.
If an error code such as 404, 405, 503 is received from the integration,
Add an error Message and set Execute to Exit.
Similarly, add the ‘No Data Handling’ rule to be executed when no flights are found for the search criteria. Add a Message and set Execute to Exit.
Click Save to complete the configuration.
Follow the above steps and create the below attributes:
From City
Destination
Age
Phone NUmber
Mail
Date of Travel
...
the operation “BookTickets“ to book the selected flight with the passenger details. Pass the attributes TravelOptions, No of Travellers, PassengerName, PassengerAge, and EmailID. Fetch the Booking ID received as a response from the web service and assign the value to a local attribute BookingID.
Step 3: Build the skill
On Skill Builder, click on the Create Skill.
Add Skill details such as Name, Category, Description, KPI Metrics.
On the Invocation Type,
Select “User Phrase“.
Add the Phrases that can be used to trigger the skill, such as “Book my Ticket”, “Book Flight”, etc.
Add more phrases and tag the attributes. For example:
“Search flights from New York to Chicago”. Select “NewYork” and tag attribute SourceCity. Select “Chicago” and tag attribute Destination.
“Book tickets from New York to Chicago on 25/12/2020”. Select “NewYork” and tag attribute SourceCity. Select “Chicago” and tag attribute Destination. Select 25/12/2020 and tag attribute TravelDate.
Add as many phrases as you can. It helps to train the bot to understand the user request better.
The Tagged Attributes SourceCity, Destination, and TravelDate should be already available in the conversation flow. If not available,
Add Attribute “SourceCity”,
Add Attribute “Destination”.
Add Attribute “TravelDate”.
Add the Integration operation SearchFlight to get the search for the available flights.
Add Attribute “TravelOptions” and override the attribute
Set the Prompt type to Quick Reply.
Add Message to prompt to required flight from the available flight options.
Assign the local attribute Flights which holds the flight options received from integration SearchFlight to the Quick Reply Button and Payload. Use syntax @{local.Flights} to refer to the value in the local attribute.
Click on Done to save the changes.
Add Attribute “No of Travellers”.
Add Attribute “PassengerName”.
Add Attribute “PassengerAge”.
Add Attribute “EmailID”.
Add the Integration operation BookTickets to book the selected flight with the passenger details.
Add Information Message to be displayed to the end-user. Use the local attribute, (defined in Step 2) BookingID, to provide the booking id to the end-user in the information message. For example: “Your tickets are booked. You travel Itinerary number is @{local.BookingID} ”.
Click Save to finish building the skill.
The next step is to add permission to the skill. Click on Permission and the Users or Groups who should be able to execute the Skill.
Run Build and Publish to make the skill available in the Virtual Agent.
Once the skill is Published, Go to the Test Widget to test the skill. Click on Debug Logs and execute the skill to view the runtime Skill execution logs.
...
Creating an Attribute on Create Global Attributes
Tagging Attributes on Tag Attributes to User Phrases
Configure a 3rd party Web service integration on REST Integrations
Creating and Managing Skills is at Create Skills
Override an Attribute on Create Skills → Override Attribute
Using local attribute in skills on Use Variables in Skills
Publishing Skill on Build and Publish
Understanding Conversation logs on Conversation History.
Using Transformation Functions: Random is at Transformation Function Random
Provide permissions to users or groups at PermissionDefining Rulesets on Using Rule Sets
Test your Skill on Test your Bot
Debugging skill on Debug Skills