You can set up an application server for rendering Agent Assist suggestions on the web in Genesys Cloud.
Objectives
Genesys Cloud integration involves the following processes:
- Deploy the backend server for the UI module to call the Dialogflow API, register an authentication token, and setup cloud Pub/Sub and Memorystore for Redis.
- Deploy the Genesys Cloud application server for rendering the Agent Assist UI module in Cloud Run.
- Create OAuth client.
- Complete the environment variables.
- Set up the interaction widget in Genesys Cloud.
- Configure the Agent Assist integration with the interaction widget in Genesys Cloud.
- Configure Messenger in Genesys Cloud.
- Use the Genesys Cloud web chat and messaging tools to test the integration.
Before you begin
You must complete the following actions before starting the Genesys Cloud integration:
- Install the Google Cloud CLI, if you haven't already configured it.
- Follow the Google Cloud instructions to create a service account and assign the Dialogflow API client role.
- Reach out to agent-assist-ui-modules-support@google.com for access to the Genesys Cloud repository.
- Deploy an Agent Assist UI modules backend. When you deploy the backend server, specify the environment variable
AUTH_OPTION
to beGenesysCloud
, following the deployment instructions.
Deploy Genesys Cloud application server using CLI
- Clone the git repository onto your local machine or development environment with the following code:
git clone https://github.com/GoogleCloudPlatform/agent-assist-integrations
- In your local terminal, use the following code to change the active directory to the repository root directory where the Docker file resides before running the Google Cloud CLI builds.
cd genesyscloud/frontend
- When prompted for a service name, press Enter to accept the default.
- Run the following command to save the state of your repository into the Google Cloud Artifact Registry. Replace
PROJECT-ID
with your Google Cloud project ID.gcloud builds submit --tag gcr.io/PROJECT-ID/agent-assist-modules-application-server
- Deploy the integration using the following command. Replace
PROJECT-ID
with your agent's Google Cloud project ID,UI_MODULE_SERVICE_ACCOUNT
with your service account client email, and set theREGION
for Cloud Run.gcloud run deploy $AA_MODULE_APPLICATION_SERVER
--image gcr.io/$GCP_PROJECT_ID/$AA_MODULE_APPLICATION_SERVER
--service-account=$ui_module_service_account
--memory 1Gi --platform managed
--region us-central1
--allow-unauthenticated
- Click Enter to accept the default service name.
For details, see Cloud Run documentation. In the Google Cloud console, you can view a list of your active integration deployments under Cloud Run.
Create an OAuth client
- Follow the instructions in the Genesys Cloud documentation to create a new OAuth client (Token Implicit Grant).
- Ensure the grant type is Implicit Grant (Browser).
- Add your application URL to the Authorized redirect URIs section.
- Update the Oauth 2.0 client token duration to 3600 second. This matches the JWT token for the Dialogflow API access of 1 hour.
{Application_SERVER_URL}?conversationProfile={CONVERSATION_PROFILE_NAME}&features={FEATURES}Replace {APPLICATION_SERVER_URL} with the URL of your UI application server.
- Replace
CONVERSATION_PROFILE_NAME
with the name of the conversation profile, such asprojects/my-project/conversationProfiles/abc123
. - Replace
FEATURES
with a comma-separated list of Agent Assist features you would like the application to include. Only include features configured in your conversation profile. Genesys cloud supports the following features:ARTICLE_SUGGESTION
FAQ
ARTICLE_SEARCH
SMART_REPLY
CONVERSATION_SUMMARIZATION
KNOWLEDGE_ASSIST_V2
SMART_REPLY
Example URL:
https://my-project.wm.r.appspot.com?conversationProfile=projects/my-project/conversationProfiles/abc123&features=ARTICLE_SUGGESTION,CONVERSATION_SUMMARIZATION
Complete the environment variables
The Genesys Cloud application uses the following environment variables. To set the environment variables, follow the Cloud Run instructions.
OAUTH_CLIENT_ID
: Genesys Cloud OAuth Client ID.GENESYS_CLOUD_REGION
: Genesys Cloud region. The default value ismypurecloud.com
.GENESYS_CLOUD_ENVIRONMENT
: Genesys cloud environment. The default value isprod
.PROXY_SERVER
: The URL of the Agent Assist backend connector.APPLICATION_SERVER_URL
: URL of the UI application server.PROJECT_ID
: Your Google Cloud project ID.CONVERSATION_PROFILE
: The conversation profile to use. This should match the profile in the redirect URL of the OAuth client.FEATURES
: Comma-separated constant for Agent Assist features. This should match the features in the redirect URL of the OAuth client.
Sample .env file:
OAUTH_CLIENT_ID = a1-b2-c3 GENESYS_CLOUD_REGION = mypurecloud.com GENESYS_CLOUD_ENVIRONMENT = prod PROXY_SERVER = https://my-project–aa-backend-integeration.wm.r.appspot.com APPLICATION_SERVER_URL = https://my-project.wm.r.appspot.com PROJECT_ID = my-project CONVERSATION_PROFILE = projects/project-id/locations/global/conversationProfiles/your-conversation-profile-id FEATURES = KNOWLEDGE_ASSIST_V2, CONVERSATION_SUMMARIZATION
When you create an OAuth client, Genesys Cloud also provides a client ID.
Run the deployment command with updated environment variables.
gcloud run deploy $AA_MODULE_APPLICATION_SERVER
--image gcr.io/$GCP_PROJECT_ID/$AA_MODULE_APPLICATION_SERVER
--service-account=$ui_module_service_account
--memory 1Gi --platform managed
--region us-central1
--allow-unauthenticated
--set-env-vars ^~^OAUTH_CLIENT_ID=$OAUTH_CLIENT_ID~GENESYS_CLOUD_REGION=$GENESYS_CLOUD_REGION~GENESYS_CLOUD_ENVIORNMENT=$GENESYS_CLOUD_ENVIORNMENT~CONVERSATION_PROFILE=$CONVERSATION_PROFILE~FEATURES=$FEATURES~PROJECT_ID=$PROJECT_ID~APPLICATION_SERVER_URL=''~PROXY_SERVER=$PROXY_SERVER~APPLICATION_SERVER_URL=$APPLICATION_SERVER_URL
The Genesys Cloud application server must be deployed to a Google Cloud hosting service. Use App Engine or Cloud Run.
Shut down the application server
- Delete the Cloud Run service.
- In your local terminal, run the following command:
gcloud beta run services list
- Select the previously chosen target platform to list active deployments.
- Run the following command:
gcloud beta run services delete agent-assist-modules-application-server