DA as an Agent

Live help lets your customer representatives (agents) serve your customers in real time through typed conversations. With Oracle B2C Service and Oracle Fusion Service, you can turn a digital assistant into an automated agent that participates in live-help chats in much the same way that human agents do.

In cases where the digital assistant can't assist the customer, it can transfer the conversation to a live agent. This automated agent will be available 24 hours a day, 7 days a week, even when all human agents are busy.

With live help, you might find that your agents spend the bulk of their time on tasks that an automated agent can easily handle, such as answering a frequently-asked question or tracking a package. To minimize the number of chats that your agents must handle, and to reduce customer wait times, consider first routing your chat sessions to a digital assistant. The digital assistant can deal with the easy tasks, and, for the more complex ones, gather essential details before transferring the chat session to a human agent. Your agents will thus provide more value to your company by only spending their time where they can add the most value.

Supported Chat Services for DA as Agent

Oracle Digital Assistant supports integration with the following chat services:

  • Oracle B2C Service Version 19C and later. Starting with Version 20A, the service supports Oracle Inlay Toolkit inlays. Starting with Version 23A, it supports Web Chat for Service, which is based on the Oracle Web SDK that is available for other types of digital assistants.

  • Oracle Fusion Service version 23A and later. Your Digital Assistant instance must be paired with a subscription to a Fusion-based Oracle Cloud Applications service.

The Digital Assistant as Agent Framework in Action

Here's a high-level overview of how live help interacts with a digital-assistant agent:

  1. A user initiates a chat, which is routed to a digital-assistant agent. This is a special automated agent that's actually the digital assistant.

  2. The user converses with the digital assistant instead of a human agent.

  3. If the digital assistant discerns that the user needs to speak with a human agent, it can transfer the conversation to an agent who's assigned to handle such transfers.

How the Digital Assistant as Agent Framework Works

These steps describe how a user requests a chat, how the service determines whether to route the chat request to a digital assistant, and what can happen after the chat request is routed to the digital assistant.

  1. A user submits a chat request from the live help launch page

  2. To determine where to route the chat request, the service completes these steps:

    1. It uses rule processing to decide which queue to route the chat request to.

    2. It looks up the agents that are assigned to the queue, and then routes the chat request to an available agent. It could be a human agent or a digital assistant agent.

    You'll learn how to configure this setup in Task 2: Configure the Service.

  3. If the agent is a digital-assistant agent, then the conversation is routed to the digital assistant that's associated with the agent's DA-as-Agent channel. Otherwise, it's routed to a human agent. When the conversation is routed to a digital assistant, the subject is passed as the initial utterance. The other values that the user entered on the live help launch page are passed in a customFields array as described in Access Contact and Chat Launch Page Information.

    You'll learn how to associate a digital assistant with an agent's DA-as-Agent channel in Task 3: Sign Your Digital Assistant into the Service.

  4. The service opens a chat that's connected to the agent or digital assistant and the user can start the conversation.

  5. If the agent is a digital-assistant agent, it can transfer the conversation to a human agent, just like a human agent can transfer a conversation to another human agent. When this happens, the service uses rule processing to decide which queue to route the transferred chat request to.

    You'll learn how to transfer the conversation to a human agent in Enable Transfer to a Human Agent. You'll learn how to set up the rules for this transfer in Task 2: Configure the Service.

DA-as-Agent Template

Oracle Digital Assistant offers the CX Service Template for Oracle B2C Service.

This template contains several skills and integrates with Oracle B2C Service Knowledge Foundation. It also has an example of using custom metrics to count the number of times users wanted to transfer, when users chose not to wait, and when no agents were available. See the Oracle Digital Assistant CXS Overview Power Point slides for instructions.

Basic Steps for Creating a Digital-Assistant Agent

The DA as Agent channel, along with the System.AgentTransfer component, lets you integrate a digital assistant with Oracle B2C Service and Oracle Fusion Service chats. Here are the basic steps. We'll go into the details later.

  1. Build a DA-as-Agent digital assistant: You build your digital assistant similar to how you build one for a messaging platform. For the cases where the customer needs to chat with a human, you use the System.AgentTransfer component to transfer the conversation to an agent.
  2. Configure the service: You'll need to configure your Oracle B2C Service or Oracle Fusion Service to integrate with Oracle Digital Assistant, such as creating a digital-assistant agent, queue, and rules.
  3. Sign your digital assistant into the service: In Oracle Digital Assistant, you create a DA as Agent channel that associates your digital assistant with the digital-assistant agent. When you enable the channel, the digital assistant is signed in as the digital-assistant agent, and is ready to handle chat requests.

After you publish your digital assistant, you'll want to periodically run Retrainer reports to see if you need to improve intent resolution for any intents. See Apply the Retrainer.

You also might want to look at the overview report on the skill's Insights Insights icon page to compare the number of conversations that were handled by the skill against the number that were transferred to an agent. The number of conversations that resolved to system.RequestAgent, system.Unsatisfactory, and other intents that transition to agent transfer are good escalation indicators.

Task 1: Build a DA-as-Agent Digital Assistant

Build the skills that you need for the DA-as-agent digital assistant, optionally publish them, and then add them to the digital assistant that will act as a digital-assistant agent. Typically, you'll need just one skill, but you can have more.

You can build your digital assistant from scratch, or you can clone the CX Service template as described in the Oracle Digital Assistant CXS Overview Power Point slides.

When you build your digital assistant, consider these scenarios:

  • The customer isn't sure what they can do with an automated assistant: Create a help skill or add a help state to an existing skill. Then, do one of the following:

    • Single-Skill Digital Assistant: In the skill, go to Settings > Digital Assistant and set Help State to the name of the skill's help state. Note that the automated agent conversation sample sets this to welcome.

    • Multiple-Skill Digital Assistant: In the digital assistant, go to Settings > Configurations and set these conversation parameters to point to the appropriate state in the help skill.

      • Digital Assistant Custom Help Skill

      • Digital Assistant Custom Help State

  • The customer wants something that a digital assistant isn't set up to handle: Do one of the following:

    • Single-Skill Digital Assistant: In the skill's System.Intent state, add an unresolvedIntent action that handles requests that are out of scope for the skill.

      Also add an intent and action that transfers to a System.AgentTransfer state. If you are using a clone of an automated agent conversation skill, then the dialog flow does this already.

    • Multiple-Skill Digital Assistant: In the digital assistant, go to Settings > Configurations and set these conversation parameters to point to the state that starts the dialog flow for handling out-of-scope requests.

      • Digital Assistant Custom UnresolvedIntent Skill

      • Digital Assistant Custom UnresolvedIntent State

Build the Skill

To build a DA-as-Agent skill can clone the DA-as-Agent Template or one from scratch, as described here. Then you'll configure the skill, add intents and entities as required, and make any necessary changes to the dialog flow. Last, you'll train and, optionally, publish the skill.

Create and Configure the Skill

Here are the steps for creating a skill for use in a DA-as-Agent digital assistant.

  1. Click icon to open the side menu to open the side menu, and then click Development > Skills.
  2. Click New Skill .
  3. Give it a display name that will make sense to someone who is conversing with the digital assistant through the service. The digital assistant uses this value in some automated messages and prompts. For example: You are at <skill-display-name>. Here are some things you can do.
  4. Complete the dialog, and then click Create.
  5. In the left navigation bar, click Settings Settings icon, and then click General.
  6. Set the Training Model to Trainer Tm.
  7. Switch Enable Insights to On.

    You can use insights to analyze and retrain your skill, as described in Review Conversation Trends Insights.

  8. Click the Digital Assistant tab.
  9. Enter an invocation that will make sense to a customer. This value is copied to the digital assistant's interaction model for the skill and is used in automated digital-assistant prompts and responses. For example:
    You are at <skill-display-name>. Here are some things you can do:
    <skill-invocation-name-from-DA> <skill-one-sentence-description> 
    1. <skill-example-utterance-set-in-DA>
    2. <skill-example-utterance-set-in-DA>
    ...
Add Intents and Entities

Add the necessary intents and entities for your skill.

Tip:

If you would like your digital-assistant agent to be able to handle "small talk", then pull the Digital Assistant Template from the skill store, and take a look at its skill named Common Skill Template. It has intents and a dialog flow that handles questions like "Are you a bot?", "Can I ask you out?", "Do you know the time?", "Are you into football?", and "Do you tell jokes".

If your DA-as-agent skill is a basic question-and-answer skill, then you can use answer intents to handle the questions and answers. For Oracle B2C Service, you also can use System.KnowledgeSearch components to address questions and answers. For knowledge search examples, see Use the System.KnowledgeSearch Component. Note that you must create a knowledge search integration to use this component.

After you create your intents click Train. You can't test or publish a skill if it hasn't been trained.

To test your intents, click Test Utterances, and then enter test utterances in the Quick Test section to verify that the model is resolving to the desired intents. You should enter utterances from the intents as well as utterances that are not in any intents. The dialog shows the confidence level for each matched intent. If the resolution isn't what you intended, consider adding the utterance to the desired intent or revising the intent that was incorrectly matched. You also can click Go to Test Cases to create or import batch tests. To learn more see Intent Training and Testing.

Access Contact and Chat Launch Page Information

When users are signed into the service or have provided their first name, last name, and email address on the chat launch page, then the profile.firstName, profile.lastName, and profile.email variables will contain the user information. For Oracle B2C Service, the profile.locale variable is set to the interface language code. For Oracle Fusion Service the locale is based on language that the user selected on the chat launch site, or, if none was selected, the browser's locale.

In addition, the profile.contactInfo variable contains some chat-request info, such as the customer's question (subject) and the product ID and category ID, if applicable. Also, if the chat launch page contains any custom fields, then the values that the customer enters into those fields are passed to the digital assistant in the profile.contactInfo.customFields array. To learn about customizing the fields that are on the Oracle B2C Service chat launch page, see Overview of Chat on the Customer Portal in Using Oracle B2C Service.

The profile.contactInfo variable is available only for instances of Oracle Digital Assistant that were provisioned on Oracle Cloud Infrastructure (sometimes referred to as the Generation 2 cloud infrastructure).

Here's the structure of the profile.contactInfo for Oracle B2C Service:

{
  "question": <string>,
  "productId": <number>,
  "orgId": <number>,
  "categoryId": <number>,
  "browser": <string>,
  "ipAddress": <string>,
  "userAgent": <string>,
  "sessionId": <string>,
  "operatingSystem": <string>,
  "customFields": [
    {
      "name": <string-name-of-custom-field>,
      "id": <ID-of-custom-field>,
      "value": <field-value> 
    },
    ...
  ]
}

Here's some example data:

{
   "question":"Do you deliver",
   "productId":7,
   "customFields":[
      {
         "name":"ODA Text",
         "id":44,
         "value":"N/A"
      
},
      {
         "name":"ODA YN",
         "id":45,
         "value":"1"
      
},
      {
         "name":"ODA Nbr",
         "id":46,
         "value":"1"
      
},
      {
         "name":"ODA Date",
         "id":47,
         "value":"2020,2,17"
      
},
      {
         "name":"ODA Menu",
         "id":48,
         "value":"12"
      
},
      {
         "name":"ODA DateTime",
         "id":49,
         "value":"2004,11,18,17,18"
      
}
   
],
   "browser":"FireFox 68.0",
   "ipAddress":"123.45.67.89",
   "userAgent":"Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Firefox/68.0",
   "sessionId":"HI6unnBo",
   "operatingSystem":"Windows 10",
   "orgId":-1,
   "categoryId":-1
}

Here's an example of extracting and displaying contact info:

context:
  variables:
    contactInfo: "map"
  ...
  setContactInfo:
    component: "System.SetVariable"
    properties:
      variable: "contactInfo"
      value: "${profile.contactInfo.value}"
    transitions:
      next: "echoQuestion"
  echoQuestion:
    component: "System.Output"
    properties:
      text: "Your question was: ${contactInfo.value.question}"
      keepTurn: true
    transitions:
      next: "showText"
  showText:
    component: "System.Output"
    properties:
      text: "You entered: <#list contactInfo.value.customFields as p><#if p.name=='VIP Status'>${p.value}</#if></#list>"
      keepTurn: true
    transitions:
      return: done

Here's the structure of the profile.contactInfo for Oracle Fusion Service:

{
  "question": <string>,
  "productId": <number>,
  "orgId": <number>,
  "categoryId": <number>,
  "browser": <string>,
  "ipAddress": <string>,
  "userAgent": <string>,
  "sessionId": <string>,
  "operatingSystem": <string>,
  "customFields": [
    {
      "name": "<custom-field-name>",
      "type": "<data-type>",
      "value": "<field-value>",
      "menuItemLabel": "<label-string>"
    },
    ...
  ]
}
Enable Transfer to a Human Agent

If you want the skill to transfer the chat session to a human agent, such as when the user wants something that the skill isn't built to handle, add a state that uses the System.AgentTransfer component. Then add some dialog flow to transition to that state as necessary.

Here's an example of a dialog flow that transfers to an agent when the customer asks to speak to an agent. Note that this example just illustrates how to use the System.AgentTransfer component. If you'd like to get the wait time before attempting the transfer, see Get Agent Availability and Wait Time. If you would like the skill to track how many times an agent was needed and why, see Creating Dimensions that Track Skill Usage.

metadata:
  platformVersion: "1.1"
main: true
name: "AutomatedAgentConversation"
context:
  variables:
    iResult: "nlpresult"
    someVariable: "string"
states:
  #
  # Note that even though Answer intents don't have actions, you must have a System.Intent state even if 
  # you have no other types of intents. Answer intents output the answer and restart the conversation.
  #
  intent:
    component: "System.Intent"
    properties:
      variable: "iResult"
    transitions:
      actions:
        ...
        system.Unsatisfactory Response: "transferToAgent"
        system.Request Agent: "transferToAgent"
        ...
  
  #
  # This state tries to transfer the user to another agent when the user explicitly requests for it.
  #
  transferToAgent:
    component: "System.AgentTransfer"
    properties:
      maxWaitSeconds: "300"
      waitingMessage: "I'm transferring you to a human agent. Hold tight."
      rejectedMessage: "I wasn't able to transfer you to a human agent. Please try again later."
      errorMessage: "We're unable to transfer you to a human agent because there was a system error."
    transitions:
      actions:
        accepted: "reset"
        rejected: "handleRejected"
        error: "offerMoreHelp"
      next: "reset"
  #
  # This state is called when an agent transfer is rejected. 
  # It lets the customer know they can ask for something else.
  # 
  handleRejected:
    component: "System.Output"
    properties:
      text: "Meanwhile, let me know if there's anything else I can help you with."
    transitions:
      return: "handleRejected"
  
  #
  # This state is called when an agent transfer encounters a system error. 
  # It lets the customer know they can ask for something else.
  #
  offerMoreHelp:
    component: "System.Output"
    properties:
      text: > 
        You can ask me another question if there's something 
        else that I can help you with.
    transitions:
      return: "offerMoreHelp"
      
  #
  # This state ends the conversation with a return transition for insights purposes, 
  # after the user has been transferred to another agent.
  #
  reset:
    component: "System.SetVariable"
    properties:
      variable: "someVariable"
      value: "x"
    transitions:
      return: "reset"
Note

Be careful to not transition to the agent transfer state when there is a developer-introduced bug or an issue with the System.AgentTransfer component. Otherwise the flow might end up in an endless loop. For example, don't have the DefaultTransition error transition go to the System.AgentTransfer state.

See System.AgentTransfer for details about the properties and actions.

Pass Information to the Service

When you transfer a conversation from a digital assistant to a live agent, you'll most likely want to pass some information to the service, such as values for an escalation rule. You use the customProperties object to pass this information.

Here's the structure for Oracle B2C Service:


      customProperties:
        - name: 
          value: 
          type:

The type property is required for custom fields, otherwise, it's optional.

For Oracle B2C Service, the name can be FIRST_NAME, LAST_NAME, EMAIL, QUESTION, PRODUCT_ID, CATEGORY_ID, CONTACT_ID, INCIDENT_ID, and any custom field of type Incident that has Chat Display enabled in the Visibility settings.

For custom fields, use the field's column name (lower case) preceded by c$. The type can be BOOLEAN, DATE, DATETIME, INTEGER, LONG, STRING, and DECIMAL. The default is STRING. For DATE and DATETIME, use the format yyyy-MM-dd'T'HH:mm:ssXXX. For BOOLEAN, use 1 for true, and 0 for false.

Here's the structure for Oracle Fusion Service:


      customProperties:
        - name: 
          value:

For Oracle Fusion Service, the name can be FIRST_NAME, LAST_NAME, EMAIL, QUESTION, PRODUCT_ID, CATEGORY_ID, CONTACT_ID, INCIDENT_ID, and any field from an Oracle Fusion Cloud Applications (Fusion) object. Note that when you add a custom field to a Oracle Fusion Service object using Application Composer, the _c suffix is added to the name automatically.

Here's an example customProperties setting for Oracle Fusion Service:

  doTransfer:
    component: "System.AgentTransfer"
    properties:
      maxWaitSeconds: "300"
      allowTransferIf: "agentSessionsAreAvailable"
      # Example of passing a custom property to Oracle Fusion
                                Service      
      customProperties:
        # This is a checkbox custom field in the Universal Work Object.
        # Checkboxes take the value of Y (selected) or N (unselected).
        - name: "TriagedByODA_c"
          value: "Y"
      acceptedMessage: "The conversation has been transferred to a live agent."
      waitingMessage: "I'm transferring you to a human. Hold tight"
      rejectedMessage: "Looks like no one is available. Please try later"
      errorMessage: "We're unable to transfer you to a live agent because there was a system error."
    transitions:
      actions:
        accepted: "reset"
        rejected: "handleRejected"
        error: "offerMoreHelp"
      next: "reset"

Tip:

For Oracle Fusion Service, the rules evaluation stops at the first rule where all conditions are met. When you configure your rules, ensure that the transferred conversation isn't routed back to the digital assistant agent. In the doTransfer example, the custom property TriagedByODA_c is set to Y, and the rules can use this custom property to ensure that when it is set to Y, the conversation isn't routed to the digital assistant agent. (For Oracle B2C Service, the Transition State and stop configuration determines the routing.)

To learn about Oracle B2C Service custom fields, see Overview of Custom Fields in Using Oracle B2C Service. For information about Oracle Fusion Service custom property fields, see "Fields" in Configuring Applications Using Application Composer.

Configure When to Attempt Agent Transfer

The System.AgentTransfer component has two properties that let you configure when to attempt transferring to an agent – maxEngagementsInQueue and allowTransferIf.

The maxEngagementsInQueue property lets you set the maximum number allowed for engagements waiting in the destination queue. When the chat request is sent, the service responds with the current number of engagements waiting in the queue. If this value exceeds maxEngagementsInQueue, then the rejected action occurs. If you don't include this property, then there's no engagement limit.

You use the allowTransferIf property to specify when to transfer based on available agents. The options are:

  • agentsAreRequestingNewEngagements: (default) For Oracle B2C Service agents who must pull chats (request new engagements), this is the most restrictive set of conditions, and the user doesn't have to wait too long before they speak to an agent. The skill attempts to transfer the conversation only if there are agents who have requested new engagements. In all other cases, this option has the same behavior as agentSessionsAreAvailable.
  • agentSessionsAreAvailable: The skill attempts to transfer the conversation if any of the available agents have not reached the maximum number of chats that they are allowed to have at one time. The user may have to wait if the agents are involved in long-running conversations or are doing some post-chat follow-up.
  • agentsAreAvailable: The skill attempts to transfer the conversation if there are any agents online regardless of whether they have reached their maximum number of chats or are requesting new engagements. With this option, the users may have long waits.

If the specified conditions aren't met, then the rejected action occurs.

Get Agent Availability and Wait Time

If all available agents are busy when a user wants to speak to an agent, then it's possible that the user might have a long wait. Rather than simply transferring the conversation and leaving the user stuck for an unknown amount of time, you can use the System.AgentTransferCondition component to find out the estimated wait time, display that time, and give the user the opportunity to cancel their request for transfer.

You use the component's properties to specify the transfer conditions and the name of the context map variable to put the status information in. The component returns an action that indicates whether the conditions were met. See System.AgentTransferCondition for details about the status information and the actions.

Here's an example of a dialog flow that invokes the component, displays the wait time, and gives the user the opportunity to cancel their transfer request.

The askIfWillWait state uses a resource bundle entry to form the wait time message so that the message makes sense whether the time is more or less than a minute and whether a number is 0, one or more.

There are some experts online. But it might take {minutes, plural,
     =-1 {}
     =0 {}
     =1 {1 minute and }
     other {# minutes and }
}{seconds, plural,
     =-1 {a while}
     =0 {{minutes, plural,
          =0 {a very short wait time}
          other {0 seconds}
        }}
     =1 {1 second}
     other {# seconds}
} for one to join. Are you willing to wait?

Note that this example uses System.SetCustomMetrics to track if agents were available, and, if so, how many users chose to wait and how many canceled the transfer request.

  ############################
  # Agent Transfer
  ############################  

  # See if there are any agents available 
  
  evaluateAgentTransferCondition:
    component: "System.AgentTransferCondition"
    properties:
      maxWaitSeconds: 300
      maxEngagementsInQueue: 20
      allowTransferIf: "agentsAreAvailable"
      agentStatusVariable: "agentStatus"
    transitions:
      actions:
        conditionsMet: "askIfWillWait"
        conditionsNotMet: "setInsightsCustomMetricsConditionsNotMet"
        error: "handleTransferError"
      next: "done"
      
  # Measure when agents aren't available

  setInsightsCustomMetricsConditionsNotMet:
    component: "System.SetCustomMetrics"
    properties:
      dimensions: 
      - name: "Agent Transfer Choice"
        value: "No agents available for new chats"
    transitions:
      next: "handleRejected"      
                  
  askIfWillWait:
    component: "System.CommonResponse"
    properties:
      processUserMessage: true
      metadata:
        responseItems:
          - type: "text"
            text:  "${rb('promptTextForTransferDecision','minutes,seconds',agentStatus.value.expectedWaitMinutes,agentStatus.value.expectedWaitSeconds)}"
            separateBubbles: true
            actions:
              - label: "Yes, I'll wait"
                type: "postback"
                keyword: "yes"
                payload:
                  action: "yes"
                name: "Yes"
              - label: "No, nevermind"
                keyword: "no"
                type: "postback"
                payload:
                  action: "no"
                name: "No"
    transitions:
      actions:
        yes: "setInsightsCustomMetricsAgentTransferInitiated"
        no: "setInsightsCustomMetricsAgentTransferCancelled"
        textReceived: "intent"
      next: "handleCancelled"
      
  # Measure when user chooses to wait for transfer

  setInsightsCustomMetricsAgentTransferInitiated:
    component: "System.SetCustomMetrics"
    properties:
      dimensions: 
      - name: "Agent Transfer Choice"
        value: "User chose to wait"
    transitions:
      next: "transferToAgent"        
      
  # Measure when user chooses to not wait for transfer

  setInsightsCustomMetricsAgentTransferCancelled:
    component: "System.SetCustomMetrics"
    properties:
      dimensions: 
      - name: "Agent Transfer Choice"
        value: "User didn't want to wait"
    transitions:
      next: "handleCancelled"
      
  # Perform the actual transfer
  #
  # The maxWaitSeconds, maxEngagementsInQueue, allowTransferIf,
  # and customProperties, if any, should match those used for 
  # System.AgentTransferCondition 
  
  transferToAgent:
    component: "System.AgentTransfer"
    properties:
      maxWaitSeconds: 300
      maxEngagementsInQueue: 20
      allowTransferIf: "agentsAreAvailable"
    transitions:
      actions:
        accepted: "done"
        rejected: "handleRejected"
        error: "handleTransferError"
      next: "handleTransferError"
     
  ############################
  # All done
  ############################
                  
  done:
    component: "System.Output"
    properties:
      text: "Let me know if you need help on anything else."
    transitions:
      return: "done"  
      
  handleRejected:
    component: "System.CommonResponse"
    properties:
      keepTurn: true
      metadata:
        responseItems:        
        - type: "text"
          text: > 
            Unfortunately, none of my colleagues are currently available to assist with this.
            Still, we’d love to see this through for you. 
            Please feel free to reach us through email@example.com.
    transitions:
      next: "done"
      
  handleCancelled:
    component: "System.CommonResponse"
    properties:
      keepTurn: true
      metadata:
        responseItems:        
        - type: "text" 
          text: "OK. Maybe some other time. Please feel free to reach us through email@example.com."
    transitions:
      next: "done"
      
  handleTransferError:
    component: "System.CommonResponse"
    properties:
      keepTurn: true
      metadata:
        responseItems:        
        - type: "text" 
          text: "Unfortunately, we can't transfer you at this time. Please try again later."
    transitions:
      next: "done"
      
  ############################
  # Global error handler
  ############################
  
  globalErrorHandler:
    component: "System.Output"
    properties:
     text: "Sorry, we were unable to do the action that you requested." 
    transitions:
      next: "done"
Create an Incident Report

You can create an incident report (or service request) for Oracle B2C Service or Oracle Fusion Service from any skill.

To create an incident report from your skill:

  1. Go to Settings > Additional Services > Customer Service Integration and create an integration with the needed service.

    You only need to do this once per instance.

  2. Add the incident creation component to your flow. For the Visual Flow Designer, see Incident Creation. For YAML, see System.IncidentCreation.

    If you have created a Oracle Fusion Service integration and have selected Allow only signed-in users to create service request as the authentication type, you also need to do the following:

    1. Set the Incident Creation component's Requires Authentication setting to True.
    2. Add an OAuth Account Link component to the dialog flow to handle user authentication. For the Visual Flow Designer, see OAuth Account Link. For YAML, see System.OAuthAccountLink.

Tip:

After creating and configuring the Incident Creation component, click Validate in the page's banner to validate the skill. Among other things, this validation will ensure that you have entered a service name in the Incident Creation component that matches the name you have given to the customer service integration that you created.
How the UI Components Display in the Service Chat

The default chat that's accessed through the service's customer portal is limited to text and images. For example, instead of cards and buttons, it just displays text, and the user has to type the choice or button label instead of just clicking on it.

To display more than just text for the UI components that are in the dialog flow, you can use one of the following options:

If your chat client is the default chat that's accessed through the service's customer portal, then ensure that you set the Enable Auto Numbering on Postback Actions to true on the Settings > Configuration page for the digital assistant so that the user can respond to the UI component by typing in a number instead of the exact text. If you don't set it to true, then use keywords for response items to minimize what the user has to enter. In this example, autonumbering is set to true whenever the client is Twilio or Oracle B2C Service chat.

${(system.channelType=='twilio'||system.channelType=='osvc' )?then('true','false')}

Tip:

When you use the digital assistant preview or the skill preview, if you set the channel to Twilio SMS, it will render the conversation similar to the default chat.

Here's a comparison of how the UI components are displayed for the different clients.

Component/Property Web Chat for Service Inlay Default Chat
HTML tags Supported Supported Supported
Postback actions Supported Displayed as clickable buttons. The share action is ignored. Displayed as non-clickable text. The location, call and share actions are ignored.
System.CommonResponse Supported Supported, except that users can't upload attachments. Supported, but the items and action labels always display vertically. Choices and buttons are displayed as non-clickable text.

For a response item of type attachment, the footerText value doesn't display.

System.List Supported Supported. Supported, but the options display as non-clickable text and the footerText value doesn't display.

This table illustrates how different component configurations display in the default chat and Inlays.

Example Component Configuration Inlay Default Chat
  actionList:
    component: "System.List"
    properties: 
      prompt: "System.List Choose an option for setting the transition action"
      options: 
      - label: "Action 1"
        value: "action1" 
      - label: "Action 2"
        value: "action2" 
      - label: "Action 3"
        value: "action3" 
      autoNumberPostbackActions: false
      footerText: "Footer"
    transitions:
      actions:
        action1: "output1"
        action2: "output2"
        action3: "output3"
Description of rich-text-list-inlay.png follows
Description of rich-text-list-default.png follows
  cardResponseHorizontal:
    component: "System.CommonResponse"
    properties:
      processUserMessage: true
      keepTurn: true
      metadata: 
        responseItems:         
        - type: "cards"
          cardLayout: "horizontal"
          footerText: "Footer Text: Cards with Values: Horizontal"
          cards:
          - title: "${myvalues.name}"
            description: "${myvalues.description}"
            imageUrl: "${myvalues.image}"
            cardUrl: "http://www.oracle.com"
            name: "ValuesCard"
            iteratorVariable: "myvalues"
            actions: 
            - label: "I Want This One"
              type: "postback"
              payload: 
                action: "itemPicked"  
                variables: 
                  user.horizontalVariable: "${myvalues.name}"   
        globalActions:
          - label: "Cancel"
            type: "postback"
            payload:
              action: "cancel"
          - label: "Send Location"
            type: "location"
Description of rich-text-card-inlay.png follows
Description of rich-text-card-default.png follows
  cardActionResponse:
    component: "System.CommonResponse"
    properties:
      processUserMessage: true
      keepTurn: true
      metadata: 
        responseItems:         
        - type: "cards" 
          cardLayout: "vertical"
          footerText: "Footer text for cards."
          cards:
          - title: "Card with Actions"
            description: "This is a card with actions"
            cardUrl: "http://www.oracle.com"
            name: "ActionsCard"
            actions: 
            - label: "share"
              type: "share"
              payload: 
                action: "share"
            - label: "location"
              type: "location"
              payload: 
                action: "location"
            - label: "url"
              type: "url"
              payload: 
                action: "url"
                url: "http://www.oracle.com"
            - label: "call"
              type: "call"
              payload: 
                action: "call"
                phoneNumber: "808 888 1212"
            - label: "ok"
              type: "postback"
              payload: 
                action: "ok"  
                variables: 
                  user.someVariable: "ok"
            - label: "not ok"
              type: "postback"
              payload: 
                action: "notok"  
                variables: 
                  user.someVariable: "not ok" 
    transitions: {}
Description of rich-text-actions-inlay.png follows
Description of rich-text-actions-default.png follows

Note that you can wrap the payload URLs in HTML tags. For example <a href="http://www.oracle.com">Click Here</a>.

Train the Skill

After you build the skill, you must train it so that you can use it in the DA-as-agent digital assistant.

  1. Go to Settings > General and ensure that the training model is Trainer Tm.

    When you use answer intents, you should always use Trainer Tm, even in development environments.

  2. Click Train.
  3. (Optional) If you don't intend to make anymore changes to this version of the skill, in the title bar, click the down arrow and select Publish.
You can now use the skill in the DA-as-agent digital assistant.

Configure the DA-as-Agent Digital Assistant

If you aren't using the CX Service template, follow these steps to create a digital assistant that acts as an automated Oracle B2C Service or Oracle Fusion Service agent:

  1. Click icon to open the side menu to open the side menu, and then click Development > Digital Assistants.

  2. Click New Digital Assistant.

  3. Complete the dialog and click Create.

  4. When the digital assistant opens, it displays the Skills Skills icon page.

  5. Click + Add Skill, select the skill that you built for this digital assistant, and then click Close.

  6. Click Settings Settings icon, and then click General.

  7. Switch Enable Insights to On.

  8. Set the digital assistant's Training Model to Trainer Tm.

  9. (Optional) Make these changes to your digital assistant in the Settings > Configurations tab.

    • Flow Information in Selection: ${system.routingToIntent}

    • Nothing to Exit Prompt: Goodbye. Let me know if there's anything else I can help you with.

  10. (Optional) If the digital assistant has more than one skill, then you can customize the digital-assistant behavior when user utterances match the digital assistant's help and unresolvedIntent intents. Go to the Configuration tab on the Settings page, and then specify the custom skill and state to navigate to for help or unresolvedIntent (or both). See Specify States for a Digital Assistant's System Intents.

  11. Click Train to train the digital assistant.
  12. (Optional) To test the digital assistant, click Preview Preview icon.

    Note that when the dialog flow transitions to a state that transfers from a skill to an agent, Preview stops responding. Click Reset when that happens.

After you put your digital assistant into production, you'll want to periodically run Retrainer reports to see if you need to improve intent resolution for any intents. See Apply the Retrainer.

Task 2: Configure the Service

Before you can use your digital assistant as a digital agent, you'll need to configure the service. The configuration steps depend on the target service:

Configure Oracle B2C Service

To configure Oracle B2C Service for a digital-assistant agent, an administrator must configure a profile, a queue, an agent, and some rules.

The administrator can set up a Oracle B2C Service queue, profile, and chat rules to route the request to a digital-assistant agent similar to the way routing is set up for a virtual assistant, which is described at Route Chats to a Virtual Assistant in Using Oracle B2C Service.

The high-level steps to complete the configuration are:

  1. Configure a Queue, Profile, and Agent for the Digital-Assistant Agent
  2. Add Chat Rules
  3. (Optional) Pass the Initial Utterance to the Digital Assistant.

After you configure Oracle B2C Service, you associate the digital-assistant agent with the DA-as-Agent digital assistant by creating a channel as described in Task 3: Sign Your Digital Assistant into the Service.

Configure a Queue, Profile, and Agent for the Digital-Assistant Agent

You'll need a dedicated queue, profile, and agent to enable a digital assistant to sign into Oracle B2C Service as an agent. Ask your Oracle B2C Service administrator to complete the following configurations in the Service Console.

Create a Digital-Assistant Queue

When used with chat rules and profiles, queues enable automatic sorting of incoming chats. Create a queue that you'll use to route chat sessions to the digital-assistant agent that's associated with the digital-assistant profile.

  1. In the Service Console console, click the Navigation Navigation icon icon, and then select the first Configuration menu item.


    Configuration selected from menu.

    The Configuration menu appears in the Navigation pane.

  2. Expand Application Appearance, and then double-click Customizable Menus.
  3. Expand System Menus, and then select Chat Queues.
  4. On the Home tab, click New.
  5. Click the New Chat Queue label and change its name, such as Digital Assistant Agent.


    Description of da-agent-queue.png follows

  6. On the Home tab, click Save & Close.
Create a Digital-Assistant Profile

You use profiles to manage account permissions and to assign agents to queues. Create a dedicated profile for the digital-assistant agent.

  1. In the Configuration menu in the Service Console, expand Staff Management, double-click Profiles, and then click New.
  2. Name the profile. For example: Digital Assistant.
  3. In the Interfaces section, enable Access for the interface and add a navigation set.
  4. In the Home tab, click Permissions.
  5. Click the Service tab.
  6. In the Chat Agent Permissions section, select these options:
    • Chat

    • Conference/Transfer to Other Groups

  7. Ensure that the Pull Chat option is not selected.
  8. Ensure that the Pull Policy is set to First Due.
  9. In the Chat Queues section, select the digital-assistant queue (Digital Assistant Agent in our example) from the drop-down and then click Add Add icon.
  10. Make sure that the queue that you added appears in the queue list, as shown in this screen shot.


    Description of da-agent-profile.png follows

  11. In the Chat Agent Statuses section, ensure that Available - Unrestricted is assigned.
  12. Select Available - Unrestricted as the default status.
    This insures that when the digital assistant signs in as a digital-assistant agent, it will receive incoming requests automatically.
  13. In the Home tab, click Save and Close.
You don't need to set Max Active Chats or Max Total Chats because the digital assistant always notifies the chat server that it has capacity to take new chats, which overrides the numbers in these fields.
Assign the Digital-Assistant Agent to the Digital-Assistant Profile

You'll need to create an account in the Service Console for the digital-assistant agent, and associate it with the digital-assistant profile. This way, chat sessions that are assigned to the digital-assistant-agent queue will be sent to the digital-assistant agent.

You'll need a separate digital-assistant agent for each DA-as-Agent digital assistant that you build.

  1. From the Configuration menu, double-click Staff Accounts by Profile.
  2. In the Home tab, click New.
  3. In the Account Details page, enter these values:
    • User Name: For example, digitalassistant.
    • First Name: For example, Chat.
    • Last Name: For example, Bot.
    • Display Name: For example, Chat Bot.
  4. Click Change Password and provide a password.

    For security, always provide a password for the digital-assistant agent.

  5. From the Profile search list, select the profile that you configured in Create a Digital-Assistant Profile.


    Description of da-digitalassistantagent.png follows

  6. Select a group, and set the default currency and country.
  7. Save your changes.
Add Chat Rules

You'll need a chat rule in the Service Console to define when to assign a chat session to the digital assistant. You'll also need a state to handle transfers from the digital assistant to a live agent.

Here are the typical steps for adding the chat rules. You can learn more about rules at Business Rules in Using Oracle B2C Service.
  1. Expand Site Configuration and double-click Rules.
  2. In the Home tab, click Chat, and then click Edit.
  3. Create a state for the hand off to a live agent.
    1. Right-click States and click New State.
    2. Name the state. For example: 03. Hand Off to Live Agent.
    3. Click Save.
  4. Add a rule to the state to assign the chat session to a queue.

    These substeps show a very simple configuration. For your instance, you must carefully consider both the if conditions, and the then actions.

    1. Right-click the state that you just added and click New Rule.
    2. Name the rule. For example: Hand Off to Live Agent.
    3. In this example, there are no if conditions. You might need to add conditions as appropriate for your business needs.
    4. Click Add Action - Then and then click Chat Queue ID.
    5. From the Assign Chat Queue drop-down list, select the queue that the conversation should be sent to (in this example, the default queue).


      Description of da-escalation-rule.png follows

    6. Click Save.
  5. Add a rule to the initial state to route chat sessions to the digital-assistant-agent queue.
    1. Right-click the initial state (the one that is shown in bold text), and click New Rule.
    2. Name the rule. For example: Digital Assistant Agent.
    3. If applicable, click Add IF Condition Based On to add the desired conditions for routing to the digital assistant queue.
    4. Click Add Action - Then and add an action to assign the chat session to the digital assistant queue (Digital Assistant Agent in our example).
    5. Click Add Action - Then and add an action to transition to the state that you created for the hand off (03. Hand Off to Live Agent in our example) and then stop.


      Description of da-agent-rule.png follows

    6. (Optional) Add an Else action.
    7. Drag the rule to a position in the initial state such it's evaluated before any rules that might route the qualifying chat sessions to some other queue. For example, ensure that it is evaluated before a state that unconditionally routes chat sessions to the default queue.
  6. Compile and activate your changes.
Pass the Initial Utterance to the Digital Assistant

To prevent the customer from having to state their need twice, add a Subject field to the chat launch page. If a customer enters a value in that field, then, when the conversation is transferred to the digital assistant, the digital assistant tries to resolve the intent from the subject field value.

The Subject field is included in Inlays by default. To learn about customizing fields on the chat launch page, see Overview of Chat on the Customer Portal in Using Oracle B2C Service.

Configure Oracle Fusion Service

If your Digital Assistant instance is paired with a subscription to a Fusion-based Oracle Cloud Applications service, you can integrate a digital assistant with an Oracle Fusion Service implementation. This feature works with Oracle Fusion Service version 23A and later.

To configure the service implementation to work with Digital Assistant, see the Use Oracle Digital Assistant as an Agent section of Implementing Service Center with the Classic User Experience.

Task 3: Sign Your Digital Assistant into the Service

To sign a digital assistant into Oracle B2C Service or Oracle Fusion Service as a digital-assistant agent, create a DA as Agent channel and then enable it. This task also identifies the digital assistant to route the conversation to.

Each DA as Agent channel must have a unique user name. That is, you can't use the same digital-assistant agent for more than one channel. If the same digital-assistant agent is signed in to more than one channel, none of the channels will work as expected.

  1. In Oracle Digital Assistant, click Icon to open the side menu to open the side menu, select Development, and then select Channels.
  2. Click DA as Agent, and then click + Add Agent Channel.
  3. Enter a name and an optional description for this channel.
  4. Select the service (Oracle B2C Service or Oracle Fusion Service).

    If you selected Oracle Fusion Service, then the Authentication Service field displays the name of the IDCS confidential client (also referred to as the OAuth client) that's preconfigured for your paired instance.

  5. Enter the host.

    For Oracle B2C Service, you can derive these values from the URL that you use to launch the Agent Browser User Interface or the chat launch page. For example, if the URL is https://sitename.exampledomain.com/app/chat/chat_launch, then the host is sitename.exampledomain.com.

    For Oracle Fusion Service, this is the host portion of your Oracle Fusion Cloud Applications (Fusion) instance's URL. For example: sitename.exampledomain.com.

  6. Enter the user name and password for the digital-assistant agent that was created in Oracle B2C Service or Oracle Fusion Service. For example: digitalassistant.

    Don't use the same user name for more than one channel. If multiple channels have the same user name, then racing conditions can cause unexpected behavior.

  7. Click Create.
  8. In the Route To drop-down, select the digital assistant to route to.


    Description of da-agent-channelv2.png follows

  9. Switch Interaction Enabled to On.

    The channel establishes a connection with the service and the digital-assistant agent is signed in.

    You should wait at least one minute for the channel connection and sign-on to complete.

    Note

    Don't re-toggle the switch until at least one minute has passed. If you enable the channel and then disable it before the connection is established and sign-on completes (or vice versa), then you might break the connection and the digital assistant won't be able to get or send responses. To resolve a broken connection, delete the channel and then re-create it.

Tip:

If a channel isn't working, click Error Reports to see if there are any reported errors. Note that if you see a CONFLICT error or an ACCESS_DENIED error, you can typically resolve this problem by switching Interaction Enabled to Off, and then switching it to On. Sometimes, however, you might see this problem because the same digital assistant agent is signed in to more than one DA-as-Agent channel.

Change DA as Agent Channel Configuration

You can re-route a channel anytime regardless of whether the channel is enabled. For other changes, including stopping routing, you must ensure that the channel is disabled (Interaction Enabled is switched to Off) before you make the change.

Note that when you disable a channel, you sign the digital assistant agent out of the service . Therefore, you can't disable a channel if there are any active sessions.

After you complete the changes, you can sign the digital assistant agent back into the service by switching Interaction Enabled to On.