All communication between the
Agent Assist UI modules and their connectors
happens through custom events. For example, when an Agent Assist suggestion
is received, a connector service will dispatch an analyze-content-received
event to the UI modules. The modules are subscribed to these events.
For example, in the connector service:
this.api.analyzeContent(...).then((response) => {
dispatchAgentAssistEvent('analyze-content-response-received', {
detail: {response}});
});
In the module:
addAgentAssistEventListener('analyze-content-response-received', (response) => {
// Use the AnalyzeContent response to render suggestions in the UI.
});
You can also use these events to create your own custom connectors. Custom connectors allow you to integrate the UI modules into an agent system that isn't currently supported by Agent Assist (only LivePerson is supported). For more information about implementing modules and connectors, see the implementation documentation.
Agent Assist UI module events
Event name | Payload | Description |
---|---|---|
active-conversation-selected |
ActiveConversationSelectedPayload |
Dispatched when a new conversation has been selected. |
analyze-content-requested |
AnalyzeContentRequestDetails |
Dispatched when an AnalyzeContent request should be made. |
analyze-content-response-received |
PayloadWithConversationName |
Dispatched when a new AnalyzeContent response has been received. |
conversation-completed |
Void | Dispatched when the Dialogflow conversation has completed. |
conversation-details-received |
PayloadWithConversationName |
Dispatched when conversation details are received from the SDK (including agent and customer info). |
conversation-model-requested |
ConversationModelRequestedPayload |
Dispatched to fetch a conversation model resource. |
conversation-model-received |
ConversationModel or null |
Dispatched when a conversation model resource has been received. |
conversation-profile-requested |
ConversationProfileRequestedPayload |
Dispatched to fetch a conversation profile resource. |
conversation-profile-received |
ConversationProfile |
Dispatched when a conversation profile resource has been received. |
conversation-initialization-requested |
ConversationInitializationRequestedPayload |
Dispatched when the Dialogflow conversation should be initialized. |
conversation-initialized |
ConversationInitializedPayload |
Dispatched when the Dialogflow conversation has been initialized. |
dark-mode-toggled |
DarkModeToggledPayload |
Dispatched when dark mode has been set in the agent desktop. |
dialogflow-api-error |
UiModuleError or null |
Dispatched when a Dialogflow API error is encountered. |
dialogflow-api-authentication-error |
Void | Dispatched when a Dialogflow API authentication (401) error is encountered. |
list-messages-requested |
ListMessagesRequestedPayload |
Dispatched with a conversation name to list historical messages for. |
list-messages-response-received |
PayloadWithConversationName |
Dispatched when messages have been listed for a given conversation. |
new-message-received |
Message | Dispatched when a new customer or agent utterance has been received (during voice conversations). |
patch-answer-record-requested |
PatchAnswerRecordPayload |
Disaptched when an answer record should be updated. |
patch-answer-record-received |
PayloadWithConversationName |
Dispatched when an answer record has been successfully updated. |
snackbar-notification-requested |
SnackbarNotificationPayload |
Disaptched when a snackbar notification is requested. |
smart-reply-selected |
SmartReplySelection |
Dispatched when a Smart Reply chip is selected. |
smart-reply-follow-up-suggestions-received |
PayloadWithConversationName<SmartReplyAnswer[]> |
Dispatched when Smart Reply follow-up suggestions have been received. |
conversation-summarization-requested |
Void | Dispatched when a conversation summarization is requested. |
conversation-summarization-received |
PayloadWithConversationName |
Dispatched when a conversation summarization has been received. |
agent-desktop-connector-initialized |
Void | Dispatched when the agent desktop connector has been initialized. |
api-connector-initialized |
Void | Dispatched when the API connector has been initialized. |
event-based-connector-initialized |
Void | Dispatched when the event-based connector has been initialized. |
agent-desktop-connector-initialization-failed |
Void | Dispatched if the agent desktop connector initialization failed. |
api-connector-initialization-failed |
Void | Dispatched if the API connector initialization failed. |
event-based-connector-initialization-failed |
Void | Dispatched if the event-based connector initialization failed. |
Custom connectors
If you are integrating Agent Assist connectors into any agent desktop that isn't LivePerson, you will need to write a custom connector. This connector facilitates interactions between the agent desktop and the UI modules. Once you have created a custom connector, return to the UI module implementation documentation for details about configuring your connector(s) and implementing the modules. You can use a custom connector with either a managed container or with individual modules.
The connector must be responsible for the following operations:
- Dispatching an event to initialize the Dialogflow conversation once the
conversation ID is available.
Event name:
conversation-initialization-requested
- Notifying the module system when the conversation details are available.
Event name:
conversation-details-received
- For voice conversations, dispatching an event whenever a new utterance is
registered from the agent or customer.
Event name:
analyze-content-requested
- Notifying the module system when 'dark mode' has been toggled in the primary
application.
Event name:
dark-mode-toggled
In addition, the connector must subscribe to the following events to update the agent desktop UI where applicable:
- For Smart Reply, update the agent's input field whenever a Smart Reply chip
is selected.
Event name:
smart-reply-chip-selected1
.
Example event dispatch:
if (newMessageFromHumanAgent) { dispatchAgentAssistEvent('analyze-content-requested', { detail: { participantRole: 'HUMAN_AGENT', request: { textInput: {text: newMessageFromHumanAgent}, messageSendTime: new Date().toISOString() } } }); }
Example event subscription:
addAgentAssistEventListener('smart-reply-chip-selected', (event) => { const chipContent = event.details; // Populate the agent chat box with the selected Smart Reply chip. });