Deploy the Genesys Cloud application server

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:

  1. 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.
  2. Deploy the Genesys Cloud application server for rendering the Agent Assist UI module in Cloud Run.
  3. Create OAuth client.
  4. Complete the environment variables.
  5. Set up the interaction widget in Genesys Cloud.
  6. Configure the Agent Assist integration with the interaction widget in Genesys Cloud.
  7. Configure Messenger in Genesys Cloud.
  8. 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:

  1. Install the Google Cloud CLI, if you haven't already configured it.
  2. Follow the Google Cloud instructions to create a service account and assign the Dialogflow API client role.
  3. Reach out to agent-assist-ui-modules-support@google.com for access to the Genesys Cloud repository.
  4. Deploy an Agent Assist UI modules backend. When you deploy the backend server, specify the environment variable AUTH_OPTION to be GenesysCloud, following the deployment instructions.

Deploy Genesys Cloud application server using CLI

  1. Clone the git repository onto your local machine or development environment with the following code:
    git clone https://github.com/GoogleCloudPlatform/agent-assist-integrations
    
  2. 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
    
  3. When prompted for a service name, press Enter to accept the default.
  4. 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
    
  5. 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 the REGION 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
  6. 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

  1. Follow the instructions in the Genesys Cloud documentation to create a new OAuth client (Token Implicit Grant).
  2. Ensure the grant type is Implicit Grant (Browser).
  3. Add your application URL to the Authorized redirect URIs section.
  4. 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.
    
  5. Replace CONVERSATION_PROFILE_NAME with the name of the conversation profile, such as projects/my-project/conversationProfiles/abc123.
  6. 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 is mypurecloud.com.
  • GENESYS_CLOUD_ENVIRONMENT: Genesys cloud environment. The default value is prod.
  • 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

  1. Delete the Cloud Run service.
  2. In your local terminal, run the following command:
    gcloud beta run services list
    
  3. Select the previously chosen target platform to list active deployments.
  4. Run the following command:
    gcloud beta run services delete agent-assist-modules-application-server
    

What's next