Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Problem Statement: The Luma Virtual Agent would need to understand the user request and fetch the 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 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 provided by the end-user.

Approach: The Skill definition will 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 enters any value, it will be identified as a value for the prompt and the prompt will be skipped automatically.

Let's understand how to build a skill Book my Tickets in Luma Virtual Agent that 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:

Step 1: Define Attribute

  1. Create an attribute SourceCity to get the travel source city for the travel

    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 to extract the information from the user phrase.

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

    5. Click Save.

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

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

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

    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 count 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 instance to the Azure environment.

    4. Configure the ‘SearchFlight’ Operation

      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 and add the rule.

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

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

  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”, etc.

    3. Add more phrases and tag the attributes. For example:

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

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

      3. Add as many phrases as you can. It helps to train the bot to understand the user request better.

  4. On Conversation Flow,

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

      1. Add Attribute “SourceCity”,

      2. Add Attribute “Destination”.

      3. Add Attribute “TravelDate”.

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

    3. Add AttributeTravelOptions” and override the attribute

      1. Set the Prompt type to Quick Reply.

      2. Add Message to prompt to required flight from the available flight options.

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

      4. Click on Done to save the changes.

    4. Add AttributeNo of Travellers”.

    5. Add AttributePassengerName”.

    6. Add AttributePassengerAge”.

    7. Add AttributeEmailID”.

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

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

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

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

  11. Test your Skill on Test your Bot

  12. Debugging skill on Debug Skills

  • No labels