article by Frank Nimphius, August 2019

 

Oracle Digital Assistant orchestrates multiple different skills to a common chatbot user experience. For each user message, Oracle Digital Assistant forwards the request to the skill that fits the best. If in doubt, a smart dialog is displayed for the user to disambiguate the request. 

In addition, there are requirements for skills that call other skills directly, which can be done using the System.CommonResponse component as documented in the Oracle Digital Assistant product documentation

The image below shows a Pizza Digital Assistant for users to create, track and manage pizza orders. The digital assistant has two skills

  • FNCRCPizzaBot: This skill handles all pizza related interactions. The skill can be invoked by a user typing "I like to order pizza" 
  • FNFinancialBot: This skill allows users to check their account balance from within the Pizza Digital Assistant. The skill can be invoked by a user typing "How much money do I have in my account?"

Each skill in Oracle Digital Assistant is associated with an invocation name.

So instead of sending a message "How much money do I have in my account?", I could also send a message "Ask <invocation name> how much money do I have in my account?". The difference with using the invocation name in the message is that routing now has it easier to identify the skill to invoke. Of course, bot users usually don't know about invocation names so would not use the second option. For a skill calling a skill, knowing and using the invocation name however becomes a benefit as we will see later.

First, lets have a look at the demo. 

A user orders a pizza by sending the message "I like to order pizza". The router in Oracle Digital Assistant looks at the message and identifies the FNCRCPizzaBot to be the skill best suited to handle the request. Within the pizza order flow in the FNCRCPizzaBot skill, a dialog is displayed asking the user for his appetite. If the appetite is big, the cost for a large pizza is likely. So maybe the user wants to check if he can afford a large pizza. 

Pressing the "Good idea!" dialog option now sends a message to Oracle Digital Assistant that the router identifies as a request for the "Balance" intent in the FNDigitalBank skill (Note that the names displayed to the user can be customized to sound less technical. For this article, technical is about the right level though). So when clicking "Yes" the user gets directed to the FNDigitalBank skill.

Once completed with the "Balance" intent, the user gets redirected back to the pizza order skill. While this all looks good you may wonder how the dialog asking to switch to FNDigitalBank can be suppressed. And indeed, there is a configuration setting  on the Digital Assistant settings that allows you to suppress the displaying.

By default the value for the "Interrupt Prompt Confidence Threshold is set to 1.01, which means it is always shown. Setting the value to 0.7 (as shown in the image above) tells Oracle Digital Assistant to not show the dialog if the confidence in the routing is high. With this the pizza order conversation looks as shown in the image below

Configuring a Skill to Call a Skill

In this example, it is the pizza skill that calls the financial skill. So the configuration is added to the the dialog flow of the FNCRCPizzaBot skill. The image below shows this configuration 

The two things to notice are the "system.textReceived" action, which ensures the action item's payload is sent to the digital assistant for routing, and the system.text variable that gets the message payload set (see the highlighted code below). 

OrderPizza:
    component: "System.CommonResponse"
    properties:
      processUserMessage: true
      keepTurn: false
      metadata: 
        responseItems:                
        – type: "text"  
          text: "Big appetite? How about checking your account balance first?" 
          actions: 
          – label: "Good idea!"
            type: "postback"
            payload:
              action: "system.textReceived"
              variables:
                system.text: "Ask FNDigitalBank how much money do I have?"

The text message that gets send to Oracle Digital Assistant or routing is  "how much money do I have?". However, to ensure that the request really gets handled by the "FNDigitalBank" skill, the message is extended to contain an explicit routing call: Ask FNDigitalBank how much money do I have?

Avoiding Dependencies

As discussed in a separate Oracle TechExchange article, custom skill parameters that use the "da." prefix in their name are exposed on the Digital Assistant configuration. The settings panel shown in the image below is from the FNCRCPizzaBot. It has a custom skill parameter defined with the name da.financeBot. 

The BotML dialog flow is changed to use the custom skill parameter instead of the "FNDigitalBank" skill. This cuts the dependency between the two skills. 

 

Notice the folowing BotML string that now references the custom skill parameter.

variables:
    system.text: "Ask ${system.config.da.financeBot} how much money do I have?"

 

In the FNPizzaOrderDA digital assistant, the custom skill parameter is displayed on the skill configuration screen (shown in the image below)

The digital assistant designer, the person who combined the FNCRCPizzaBot and the FNFinancialBot to a single digital assistant solution, configured the da.financeBot parameter with the invocation name of the financial skill to invoke: "FNDigitalBank"

Best Practices

The following practices can be considered best practices when implementing skills that call another skill

  • Avoid inter-skill dependencies. Skills should be developed as modules that don't know of each other and that make no assumption about the names of variables or other skills in the same digital assistant. To avoid inter-skill dependencies, use custom skill parameters that use the "da." prefix. 
  • Use explicit routing when calling skills from a skill. Explicit routing provides better results! So when implementing calls to other skills in a skill, ensure you use explicit routing. To avoid hard-coding of skill invocation names in BotML, use custom skill properties as shown in this article. 

Related Content

Oracle Digital Assistant Documentation

TechExchange Quick-Tip: How to remote-control skill bots in Oracle Digital Assistant through parameterization

TechExchange Quick-Tip: Follow Best Practices By Keeping External Configurations Out of Your Dialog Flow

Author