Enabling Cloud Pub/Sub notifications lets you receive a notification each time an Agent Assist event completes. You can configure Agent Assist to send a notification for all events or only specified events, including Agent Assist suggestions, conversation lifecycle information, and live transcripts.
Prerequisites
- Enable the Dialogflow API.
- Follow the instructions to create a Cloud Pub/Sub topic.
Enable Cloud Pub/Sub notifications
You can configure Agent Assist to send a notification for all events or for specified events in your conversation profile.
A conversation profile configures a set of parameters that control the suggestions or notifications made to an agent during a conversation. You have the option of configuring Cloud Pub/Sub notifications either using the Agent Assist console or by calling the API directly. You can configure each type of notification separately, using the topics that you've created.
For more details about Cloud Pub/Sub configuration parameters, see the
conversationProfile
reference documentation.
Enable Cloud Pub/Sub notifications using the Agent Assist console
When you create a new conversation profile using the Agent Assist console, you can select which notification types you'd like to receive using the topics you've created:
Enable Cloud Pub/Sub notifications using the API
If you prefer to call the API directly to create or update a conversation profile,
check this section for the locations you should configure in the
ConversationProfile
resource.
The following example is configured to enable all Cloud Pub/Sub notifications
that match a designated TOPIC_ID
.
{ "name": "projects/PROJECT_ID/locations/global/conversationProfiles/CONVERSATION_PROFILE_ID", "displayName": "CONVERSATION_PROFILE_NAME", "automatedAgentConfig": { }, "humanAgentAssistantConfig": { "notificationConfig": { "topic": "projects/PROJECT_ID/topics/FEATURE_SUGGESTION_TOPIC_ID", "messageFormat": "JSON" }, "humanAgentSuggestionConfig": { "featureConfigs": [{ "enableEventBasedSuggestion": true, "suggestionFeature": { "type": "ARTICLE_SUGGESTION" }, "conversationModelConfig": { } }] }, "messageAnalysisConfig": { } }, "notificationConfig": { "topic": "projects/PROJECT_ID/topics/CONVERSARION_LIFECYCLE_TOPIC_ID", "messageFormat": "JSON" }, "newMessageEventNotificationConfig": { "topic": "projects/PROJECT_ID/topics/LIVE_TRANSCRIPT_TOPIC_ID", "messageFormat": "JSON" }, "languageCode": "en-US" }
Configuration of the Cloud Pub/Sub message
Notification | Trigger | Configuration in ConversationProfile |
---|---|---|
suggestion_event | When Agent Assist generates a suggestion | ConversationProfile.humanAgentAssistantConfig.notificationConfig Set SuggestionFeatureConfig.enableEventBasedSuggestion to true for selected featuresSupported features: ARTICLE_SUGGESTION, FAQ AND DIALOGFLOW_ASSIST |
life_cycle_event | When conversation open or close | ConversationProfile.notificationConfig |
new_message_event | When a new message/utterance transcript appears | ConversationProfile.newMessageEventNotificationConfig |
Content of the Cloud Pub/Sub message
The content of the Cloud Pub/Sub message depends on the event that triggers that Cloud Pub/Sub notification.
Notification | Message Data | Message Data Example |
---|---|---|
suggestion_event | HumanAgentAssistantEvent |
{ "conversation": "projects/PROJECT_ID/locations/LOCATION/conversations/CONVERSATION_ID", "participant": "projects/PROJECT_ID/locations/LOCATION/conversations/CONVERSATION_ID/participants/PARTICIPANT_ID", "suggestionResults": [ SuggestionResult ]} |
life_cycle_event | ConversationEvent |
{ "conversation": "projects/PROJECT_ID/locations/LOCATION/conversations/CONVERSATION_ID", "type": "CONVERSATION_STARTED" } |
new_message_event | ConversationEvent |
{ "conversation": "projects/PROJECT_ID/locations/LOCATION/conversations/CONVERSATION_ID", "type": "NEW_MESSAGE", "newMessagePayload": Message } |