Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Problem Statement: The virtual agent Luma Virtual Agent would need to understand the user request /phrase and fetch the values/data information required to automatically process the request automatically from the user request without asking for the already provided 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 if the values are already fetched. provided 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

  1. Create an attribute username SourceCity to get the username who would like to book the Travel ticketsource city of the end-user.

    1. On Skill Builder--> Attribute tab, click on Create Attribute.

    2. Add attribute details such as Name and Data type as Text.

    3. Set the NLP Extraction Method to Value. This enables the Luma Virtual Agent toextract the information from the user phrase.

    4. Set the prompt message to be displayed to the end-user, like “Enter your name“Provide the Source city. “

    5. Click Save.

  2. Follow the above steps and create the below attributes:

    1. From City

    2. Destination

    3. Age

    4. Phone NUmber

    5. Mail

    6. Date of Travel

...

    1. Destination to get the Destination city from the end-user. Set the NLP Extraction Method to Value.

    2. 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.

    3. TravelOptions to accept the end-user flight selection from the available flight options for the search criteria.

    4. No of Travellers to get the number of passengers traveling for ticket booking

    5. PassengerName to get the name of the main Passenger traveling for ticket booking.

    6. PassengerAge to get the age of the main Passenger traveling for ticket booking.

    7. 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

  1. Define Integration to the target system TravelAPI with the “SearchFlight” operation.

    1. On the Tenant menu, click on Integration.

    2. Create an Application with the integration type as REST.

    3. Add an /wiki/spaces/DOC/pages/1625227940for the target system TravelAPI

    4. Configure the ‘SearchFlight’ /wiki/spaces/DOC/pages/1625227940

      1. Pass attributes SourceCity, Destination, and TravelDate to the operation.

      2. 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.

      3. Define the ‘Error Handling’rule to be executed when the integration returns an error.

        1. Click on Click here to add rule,

          1. Add rule if an error code such as 404, 405, 503 is received from the integration.

          2. Configure an error Message and set Execute to Exit.

      4. 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.

    5. Click Save to complete the configuration.

  2. 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.

Step 3: Build the skill

  1. On Skill Builder, click on the Create Skill.

  2. Add Skill details such as Name, Category, Description, KPI Metrics.

  3. On the Invocation Type,

    1. Select “User Phrase“.

    2. Add the Phrases that can be used to trigger the skill, such as “Book my Ticket”, “Book Flight”, “Book Tickets“, etc.

    3. 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:

      1. “Book flights from New York to Chicago”. Select “NewYork” and tag attribute SourceCity. Select “Chicago” and tag attribute Destination.

      2. “Book tickets to Chicago”. Select “Chicago” and tag attribute Destination.

      3. “Book tickets to New York on 2020-12-23”. Select “New York” and tag attribute Destination.

      4. “Book tickets from New York to Chicago on 2020-12-23”. Select “NewYork” and tag attribute SourceCity. Select “Chicago” and tag attribute Destination.

      5. 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.

  4. On Conversation Flow,

    1. The Tagged Attributes SourceCity and Destination should be already available in the conversation flow. If not available,

      1. Add Attribute “SourceCity”

      2. Add Attribute “Destination”

    2. Add Attribute “TravelDate”.

    3. Add the Integration operation SearchFlight to get the search for the available flights.

    4. Add AttributeTravelOptions” and override the attribute.

      1. Set the Prompt type to Quick Reply.

      2. Add a Message to prompt the end-user to select from the available flight options.

      3. 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.

      4. Click on Done to save the changes.

    5. Add AttributeNo of Travellers

    6. Add AttributePassengerName

    7. Add AttributePassengerAge

    8. Add AttributeEmailID

    9. Add the Integration operation BookTickets to book the selected flight with the passenger details.

    10. 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} ”.

  5. Click Save to finish building the skill.

  6. 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.

  7. Run Build and Publish to make the skill available in the Virtual Agent.

  8. 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.

Below is the sample skill definition. Note that the integration details should be replaced with your organization-specific instance details.

View file
nameLuma Training_Travel Booking Skill.zip

Additional Resources

Visit the below Wiki Documentation for more information on:

  1. Creating an Attribute on Create Global Attributes

  2. Tagging Attributes on Tag Attributes to User Phrases

  3. Configure a 3rd party Web service integration on REST Integrations

  4. Creating and Managing Skills is at Create Skills

  5. Override an Attribute on Create Skills → Override Attribute

  6. Using local attribute in skills on Use Variables in Skills

  7. Publishing Skill on Build and Publish

  8. Understanding Conversation logs on Conversation History.

  9. Using Transformation Functions: Random is at Transformation Function Random

  10. Provide permissions to users or groups at Permission Defining Rulesets on Using Rule Sets /wiki/spaces/DOC/pages/1676574776

  11. Test your Skill on Test your Bot

  12. Debugging skill on Debug Skills