...
Create an attribute SourceCity to get the source city of the end-user.
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 “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 of datatype TIME, to store the date of travel from the end-user. The attribute will accept date and time values in yyyy-mm-dd format. For example, 2020-12-23, 2021-01-26 etc.
TravelOptions to accept the end-user flight selection from the available flight options for the search criteria.
No of Travellers to get the number 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.
...
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 /wiki/spaces/DOC/pages/1625227940for the target system TravelAPI
Configure the ‘SearchFlight’ Operation /wiki/spaces/DOC/pages/1625227940
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,
Add rule if an error code such as 404, 405, 503 is received from the integration.
Configure 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 operation “BookTickets“ to book the selected flight and 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 it to a local attribute BookingID.
...
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”, “Book Tickets“, etc.
Add more phrases and tag the attributes. This will train the Bot to automatically extract SourceCity, Destination, and TravelDate from the user’s input. For example:
“Book flights from New York to Chicago”. Select “NewYork” and tag attribute SourceCity. Select “Chicago” and tag attribute Destination.
“Book tickets to Chicago”. Select “Chicago” and tag attribute Destination.
“Book tickets to New York on 2020-12-23”. Select “New York” and tag attribute Destination.
“Book tickets from New York to Chicago on 2020-12-23”. Select “NewYork” and tag attribute SourceCity. Select “Chicago” and tag attribute Destination.
To train the Bot to extract information from the user’s input phrase, add as many phrases as you can. It is advised to add 20-25 phrases with various permutations and attribute tagging.
The Tagged Attributes SourceCity and Destination 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 a Message to prompt the end-user to select from the available flight options.
Assign the local attribute Flights (which holds the flight options received from integration SearchFlight)to the Quick Reply. 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 BookingID (defined in Step 2) to provide the booking id to the end-user in the information message. For example: “Your tickets are booked. Your 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 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.
Your skill is now ready to use. Go to Conversation History to view the list of conversations where the end-user requested the skill.
Download a sample skill definition. Note that the integration details should be replaced with your organization-specific instance details.
View file | ||
---|---|---|
|
Additional Resources
Visit the below Wiki Documentation for more information on:
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.
Provide permissions to users or groups at Permission /wiki/spaces/DOC/pages/1676574776
Test your Skill on Test your Bot
Debugging skill on Debug Skills