Prepare the Skill Bot

For development and testing you can create a minimal skill.

After you confirm that the system is working as intended, you can create a more elaborate skill. The skill should handle user requests to chat with a human agent. It should also detect when a user is having trouble and offer to connect them with a human agent. The Oracle Digital Assistant documentation has instructions on how to accomplish these tasks.

Create a Chatbot Skill

Create a skill that has the system components for interacting with a live agent system.

The system components that you need are System.AgentInitiation and System.AgentConversation.

For the purposes of developing and testing your webhook, you can create a new skill and replace the placeholder BotML that the system generates with the BotML sample here.

  1. Log into Digital Assistant and create a skill with the name AgentFramework.
  2. Make a chatbot conversation available for transfer to a live agent.
    1. Go to the Settings page for the skill.
    2. Set the Enable Insights switch to On.

      Note that in previous versions of Oracle Digital Assistant you had to enable Skill Conversation within the Enable Conversation Logging section of the settings page.

  3. Modify the dialog flow. Replace the generated BotML with the following BotML:

    Note:

    The following dialog flow uses variables that are specific to the webhook that's in the example code on GitHub. You can tailor it to meet the needs of your own webhook and live agent system.
    metadata:
      platformVersion: "1.1"
    main: true
    name: AgentFramework
    context:
      variables:
        question: "string"
        myCustomProps: "string"
    
    states:
      setUserEmail:
        component: "System.SetVariable"
        properties:
          value: "CHANGE_TO_YOUR_EMAIL"
          variable: "profile.email"
        transitions: {}
        
      setUserFirstName:
        component: "System.SetVariable"
        properties:
          value: "CHANGE_TO_YOUR_FIRST_NAME"
          variable: "profile.firstName"
        transitions: {}
        
      setUserLastName:
        component: "System.SetVariable"
        properties:
          value: "CHANGE_TO_YOUR_LAST_NAME"
          variable: "profile.lastName"
        transitions: {}
        
      setCustomProperties:
        component: "System.SetVariable"
        properties:
          variable: "myCustomProps"
          value:
            Product: 
              - Name: "Product X"
                Serial: "CUSTOM_PRODUCT_SERIAL_NUMBER"
            Country: 
              - City: "MY_CITY"
                Code: "MY_COUNTRY"
            Profile: 
              - mobileNumber: "CHANGE_TO_YOUR_MOBILE_NUMBER"
                userName: "CHANGE_TO_ANY_USER_NAME"
    
      start:
        component: "System.Text"
        properties:     
          prompt: "How can I help you?"
          variable: "question"
        
      startContactAgent:
        component: "System.AgentInitiation"
        properties:
          subject: "${question}"
          agentChannel: "AgentFrameworkChannel"
          agentActions: "MyAction,Payments"
          waitingMessage: "Chat accepted, waiting for agent to join"
          rejectedMessage: "Apologies no agent is available at the moment"
          customProperties: "${myCustomProps.value}"
        transitions:
          actions:
            accepted: "agentConversation"
            rejected: "rejected"
            
      agentConversation:
        component: "System.AgentConversation"
        properties:
          agentChannel: "AgentFrameworkChannel"
          exitKeywords: "bye,thanks,thank you"
          conclusionMessage: "Agent left the conversation, we will redirect you back again to our automated bot."
        transitions:
          actions:
            MyAction: "agentRedirection"
            Payments: "agentRedirection"
          next: "exit"
          
      agentRedirection:
        component: "System.Output"
        properties:
          text: "Agent left conversation and redirected you to this state."
          keepTurn: false
        transitions:
          next: "exit"
          
      rejected:
        component: "System.Output"
        properties:
          text: "Agent Rejected chat request."
          keepTurn: true
          
      exit:
        component: "System.Output"
        properties:
          text: "End of Agent Handover demo."
        transitions:
          return: "start"

In particular, the states that you're interested in are the startContactAgent state and the agentConversation state. Both of these states have an agentChannel property. Record the value of the agentChannel property. In the sample BotML the value is AgentFrameworkChannel. You can change the value if you want. You need this value later when you create a webhook channel.