Edgetier Worker

Type: Edgetier Worker

An edgetier worker will route a conversation to a live agent in edgetier. If messages come in while the chat is offline a message will be returned to the user “Sorry - our contact center is currently closed. Please try again later.”

Note: Edgetier workers cannot be interacted with directly by users, they must be transferred from a flow worker first.

Creating an edgetier worker through cli

Save this json to a file and create a worker using the cli command sb-cli worker create file.json. Note to replace the values for Api, FormsId, LanguageId, and SetupId.

{
  "Data": {
    "QueueUpdates": true/false,
    "SetupId": 1,
    "LanguageId": "en",
    "FormsId": 1,
    "Api": "https://your.edgetier.com",
    "ConversationLifecycle": {
      "liveChatStart": [{ "type": "BotSummary", "enabled": true }],
      "preWrap": [
        { "type": "ShortSummary", "formFieldName": "note", "enabled": true },
        {
          "categorizationType": "ReasonCode",
          "formFieldName": "disposition_codes",
          "categories": [
            {
              "description": "Forgot User Name",
              "label": "Forgot User Name"
            },
            {
              "description": "New Registration",
              "label": "New Registration"
            },
            {
              "description": "No Response/No Contact",
              "label": "No Response/No Contact"
            },
            {
              "description": "Other",
              "label": "Other"
            },
            {
              "description": "Redirect Non-Login",
              "label": "Redirect Non-Login"
            },
            {
              "description": "Password Reset",
              "label": "Password Reset"
            }
          ],
          "type": "Categorization",
          "enabled": true
        },
        {
          "type": "CustomPrompt",
          "prompt": "Summarize this conversation {{liveChatMessages}}",
          "formFieldName": "my_custom_prompt",
          "enabled": true
        }
      ]
    }
  },
  "Config": {},
  "Description": "Worker that routes to livechat agents in edgetier",
  "Enabled": true,
  "Name": "EdgetierWorker",
  "Type": "edgetier-worker"
}

Setting the customers email

If you want to change the default email address that comes across in the create chat. You need to set the email in context. What ever email is set to in context will appear as the customers email and if no name is set, it defaults to the “noreply@servisbot.com”.

Setting in flow Add a setContext node and set the email to your desired value.

Setting the SetupId and FormsId in Context

The EdgeTier worker’s configured setupId and formsId can both be overridden by setting either setupId and/or formsId in context to the value you wish to use.

Like with emails, this can be set in a flow with the setContext node.

Secure File Upload Request

If you want to allow agents to request files during chats you will need to configure a SlashCommand in your worker configuration.

Pre-requisites: You will need an API Key and URL for our link shortener service ‘Squeeze’. Please contact ServisBOT to request this. Once you have them, put the API key in a Token Auth secret.

{
  "Data": {
    "SetupId": 1,
    "Api": "https://your.edgetier.com",
    "Language": "en",
    "FormsId": 1,
    "ShortLinkConfig": {
      "Config": {
        "Api": "squeeze-api-url",
        "ApiKey": "srn:vault::engineering:secret:squeeze"
      },
      "Type": "Squeeze"
    },
    "FileUploadUrlExpiry": 180,
    "SlashCommands": {
      "/fileUpload": {
        "actions": [
          {
            "type": "markup",
            "value": "<TimelineMessage> <SecureFileUpload promptText='Could you post a picture of the front of your drivers license?' promptButtonText='Upload Picture' retryButtonText='Replace' confirmButtonText='Complete' confirmationText='All set!' interactionType='event' preventRetries='true' version='2'> <UploadItem fileType='image/*'  name='drivers-license-front'/> </SecureFileUpload> </TimelineMessage>"
          }
        ]
      }
    }
  },
  "Config": {},
  "Description": "Worker that routes to livechat agents in edgetier",
  "Enabled": true,
  "Name": "EdgetierWorker",
  "Type": "edgetier-worker"
}

This configuration will allow agents to use the command /fileUpload to send the secure file upload markup to the user. The markup in the example is for a drivers-license-front document. Please see the SecureFileUpload documentation for more information.

When the user has uploaded their document the agent will received a message like this:

We have received the following files for the user
drivers-license-front: url https://sbot.ly/vV56d9ys

The link will show the document that the user has uploaded. The default expiry time on the link is 2 minutes unless the FileUploadUrlExpiryis set in seconds to another value in the worker config through the cli. The max value on this expiry is 600

Getting access to the chat token

The chat token for edgetier is available in context. if you want to use it in flow it will be in msg.payload.context.edgetier.chatToken

Conversation Presensce

Pre-requisites:

  • Enhanced Messenger enabled on the endpoint or Organization.
  • Conversation Presence enabled on your organization, please contact ServisBOT to request this.

With Conversation Presence enabled users that have not been present for 60 seconds will be marked as absent. When configured, if the absent user has an active Edgetier livechat conversation the conversation will be disconnected and a message will be sent to the user and the agent.

In the browser as long as the user keeps the tab the bot is on open they will not be marked as absent even if changing tabs. However on mobile devices when the user switches to another app the browser will suspend the tab when it is not in focus. This means that the user will be marked as absent after 60 seconds of switching to another app.

The default message is “User has been disconnected due to inactivity” and can be configured using the ConversationPresenceDisconnectMessage parameter.

Sample configuration:

{
  "Data": {
    "SetupId": 1,
    "Api": "https://your.edgetier.com",
    "Language": "en",
    "FormsId": 1,
    "ConversationPresence": true,
    "ConversationPresenceDisconnectMessage": "User automatically disconnected custom message"
  },
  "Config": {},
  "Description": "Worker that routes to livechat agents in edgetier",
  "Enabled": true,
  "Name": "EdgetierWorker",
  "Type": "edgetier-worker"
}

OpenAI Chat Summary

If you want the conversation with an agent to get summarized and potentially categorized by OpenAI after it finishes, you do so by including the SummaryConfig object in the EdgeTier worker configuration.

Pre-requisites: You will need an OpenAI secret configured for your organization to take advantage of this feature.

{
  "Data": {
    "SetupId": 1,
    "Api": "https://your.edgetier.com",
    "Language": "en",
    "FormsId": 1,
    "SummaryConfig": {
      "SummaryEnabled": true,
      "DispositionErrorCode": "ER01", // optional - the fallback disposition code for if OpenAI fails to categorize. defaults to NONE
      "Dispositions": [
        // optional - a list of disposition codes to categorize the conversation into
        {
          "Code": "411",
          "Description": "Refunds"
        },
        {
          "Code": "532",
          "Description": "Replacements"
        },
        {
          "Code": "22A",
          "Description": "Complaints"
        }
      ]
    }
  },
  "Config": {},
  "Description": "Worker that routes to livechat agents in edgetier",
  "Enabled": true,
  "Name": "EdgetierWorker",
  "Type": "edgetier-worker"
}

Once confgured, whenever a live chat completes for the configured worker the result will be available in context under latestLiveChatDetails, and will include a summary, an externalConversationId and potentially a dispositionCode if you provided dispositions.

{
  "latestLiveChatDetails": {
    "summary": "A summary of your recent conversation",
    "dispositionCode": "22A",
    "externalConversationId": "edgetier-token"
  }
}

ConversationLifecycle

This section is for managing events during certain lifecycle states

Support states are

Live Chat Start

Live Chat Start are events that fire once the conversation has been assigned to the live chat bot

A list of support actions are :

Bot Summary

This will perform a summary of the conversation prior to going to live chat. This will in turn insert this summary into the history of the live chat conversation as the last message for the agent to read

Example config

{
  "type": "BotSummary",
  "enabled": true
}

Pre Wrap

Pre Wrap are events that are triggered when either the customer leaves the chat or the agent his the end chat button in Edgetier’s UI.

A list of support actions are:

Short Summary

Short Summary with produce a 2-3 sentence summary of the conversation with the agent, it gets the entire transcript of the conversation with the agent.

Example config

{
  "type": "ShortSummary",
  "formFieldName": "note",
  "enabled": true
}

Explanation of the config

  • formFieldName - The name of the field that will get auto populated on the EdgeTier wrap up form UI

Categorization

Categorization will try to pick a given category reason for the live chat conversation, it gets the entire transcript of the conversation with the agent.

Example config

{
  "categorizationType": "ReasonCode",
  "formFieldName": "disposition_codes",
  "categories": [
    {
      "description": "Forgot User Name",
      "label": "Forgot User Name"
    },
    {
      "description": "New Registration",
      "label": "New Registration"
    },
    {
      "description": "No Response/No Contact",
      "label": "No Response/No Contact"
    },
    {
      "description": "Other",
      "label": "Other"
    },
    {
      "description": "Password Reset",
      "label": "Password Reset"
    }
  ],
  "type": "Categorization",
  "enabled": true
}

Explanation of the config

  • categorizationType - The type of categorization used. Currently only ReasonCode supported
  • formFieldName - The name of the field that will get auto selected on the EdgeTier wrap up form UI
  • categories - A list of descriptions and labels.
    • Label is whats selected in the EdgeTier wrap up form UI
    • Description - An explanation of the label

CustomPrompt

CustomPrompt will create a custom prompt to send to OpenAI. Adding {{liveChatMessages}} to the prompt will insert the transcript of the conversation with the agent.

Example config

{
  "type": "CustomPrompt",
  "prompt": "Summarize this conversation {{liveChatMessages}}",
  "formFieldName": "my_custom_prompt",
  "enabled": true
}

Explanation of the config

  • prompt - The prompt that will be sent to OpenAI. Can be templated with {{liveChatMessages}}
  • formFieldName - The name of the field that will get auto populated on the EdgeTier wrap up form UI