Oracle B2C Service Center continues to evolve by bringing innovative solutions to improve the customer’s experience and help with agent efficiency. Chat Agent Suggestions with Generative AI provides your live agents with intelligent suggestions that are contextually relevant to the current conversation, ensuring faster resolution and improved customer satisfaction.

In the 24B release, we introduced the Chat Agent Suggestions feature and at the time, the suggestions were powered by the Oracle Digital Assistant. This is a powerful feature which proactively reads the chat conversation between the end user and the agent and provide suggestions curated by the Oracle Digital Assistant.

In the 25A release, Administrators can now configure the feature so that suggestions are powered by a data source other than the Oracle Digital Assistant. OCI Generative AI Agent, OCI Generative AI, Azure Open AI or any REST endpoint, can now be used to power the suggestions.

This article provides information about how to configure the Chat Agent Suggestions feature with the following data sources:

  1. Oracle Digital Assistant
  2. OCI Generative AI Agent
  3. OCI Generative AI
  4. Azure Open AI
  5. Others (REST endpoint)

Oracle Digital Assistant

Oracle Digital Assistant is a platform that allows you to create and deploy digital assistants. Skills can be created within ODA, and those skills can be configured to provide the suggestions for the Agents. Refer to Oracle Digital Assistant Documentation for details.

Follow these steps to configure the Chat Agent Suggestions feature with an Oracle Digital Assistant tenancy:

  1. Within the Browser UI
  2. Navigate to Administration > Live Chat Configuration > Chat Agent Suggestions

    Agent Suggestion

  3. “Chat Agent Suggestions” home page will show the list of existing connections.

    Chat Agent Suggestion Home Page

  4. Select “Add New” to create a new connection & complete the following fields for this connection on left side of the Page. 
    • Name: Any meaningful name with max length of 11 characters. Name must start with a letter, end with a letter or number, and only contain letters, numbers or underscore.
    • Notes: Relevant notes for this connection
  5. Navigate to the “Configurations” tab and complete the following fields for this connection:
    • Type : Oracle Digital Assistant
    • ODA URL : Oracle Digital Assistant URL e.g. oda-c4b7b8119xxxxxxxxxx-da2.data.digitalassistant.oci.oraclecloud.com
    • Channel Id : Channel ID for communicating with ODA.
    • Channel Secret Key : Channel Secret key of the channel. 
    • Max Token Expiration (Minutes) : Token Expiration in minutes from ODA

      New Agent Suggestion ODA Type

      Channel Id, Channel Secret Key and Max Token Expiration fields value can be copied from ODA console. Steps for configuring the Channel in ODA can be found here. Below is the snapshot of ODA Console from where the channel infomation can be copied.

      ODA Console

  6. Navigate to the “Profile Access” tab to assign profiles to this connection:
    • For any interface, use the menu to select the profile(s) for which this feature is enabled
    • Select an interface
    • From the menu on the left, select the profile, then use the arrow button to move the profile to the menu on the right. Multiple profiles can be selected.

      New Agent Suggestion ODA Profile Configuration

  7. Navigate to the “Customizations” tab to define additional options for this connection:
    • Logging Extensibility Action: Name of the registered action (from extensibility).
      Extensibility Code that is triggered when a suggestion action is performed from Oracle B2C Service Agent Browser UI. This will be helpful if you wish to monitor the agent suggestion usage for a site. This is an optional step.
    • Feedback Extensibility Action: This option is currently disabled and will be enabled in future release with the capability of collecting feedback from agents using the feature

      New Agent Suggestion ODA Customization Config

  8. Save your changes.

OCI Generative AI Agent

OCI Generative AI Agents is a fully managed service that combines the power of large language models (LLMs) with an intelligent retrieval system to create contextually relevant answers by searching your knowledge base, making your AI applications smart and efficient. Refer to OCI Generative AI Agent documentation for details.

Follow these steps to configure the Chat Agent Suggestions feature with an OCI Generative AI Agent tenancy:

  1. Within the Browser UI
  2. Navigate to Administration > External Objects & Integrations
    • Set up External Object connections with the OCI Gen AI Agent end point. Refer to External Object Configuration Section for details.
      Note: The External object connection should be pointing to OCI Gen AI Agent. The base URL has to be specifed in below format
      https://{API EndPoint}/20240531/agentEndpoints/{agentEndpointId}
  3. Navigate to Administration > Chat Configurations > Chat Agent Suggestions

    Agent Suggestion

  4. “Chat Agent Suggestions” home page will show the list of existing connections.

    Agent Suggestion Admin Home Page

  5. Select “Add New” to create a new connection & complete the following fields in the left side of the page for this connection:
    • Name: Any meaningful name with max length of 11 characters. Name must start with a letter, end with a letter or number, and only contain letters, numbers or underscore.
    • Notes: Relevant notes for this connection
  6. Navigate to the “Configurations” tab and complete the following fields for this connection:
    • Type : OCI > Gen AI Agent
    • OCI Generative AI XO Connection : Select previously created External Object connection.

      New Agent Suggestion Gen AI Agent

       

  7. Navigate to the “Profile Access” tab to assign profiles to this connection:
    • For any interface, use the menu to select the profile(s) for which this feature is enabled
    • Select an interface
    • From the menu on the left, select the profile, then use the arrow button to move the profile to the menu on the right. Multiple profiles can be selected

      New Agent Suggestion Gen AI Agent

  8. Navigate to the “Customizations” tab to define additional options for this connection:
    • Convert Request Extensibility Action: Name of the registered action from BUI Extension.
      Develop Extensibility Code that can be used for providing additional prompt message to the request payload. This is an optional step.
    • Logging Extensibility Action: Name of the registered action from BUI Extension.
      Develop Extensibility Code that is triggered when a suggestion action is performed from Oracle B2C Service Agent Browser UI. This will be helpful if you wish to monitor the agent suggestion usage for a site. This is an optional step.
    • Feedback Extensibility Action: This option is currently disabled and will be enabled in future release with the capability of collecting feedback from agents using the feature

      New Agent Suggestion OCI Gen AI Agent Customization Configuration

  9. Save your changes.

Sample code for Gen AI Agent Extension

// Sample code for OCI Gen AI Agent Request Extension. Prompt message can be added to the message.
public ociGenAIAgentRequestExtension(message: string): string {
     return 'Generate result in 50 words. ' + message;
}

OCI Genenerative AI

OCI Generative AI is a fully managed Oracle Cloud Infrastructure service that provides a set of state-of-the-art, customizable large language models (LLMs) that cover a wide range of use cases, including chat, text generation, summarization, and creating text embeddings. It supports Cohere and Meta models. Refer to OCI Generative AI documentation for details.

The set up for OCI Gen AI Cohere and OCI Gen AI Meta are similar. The only difference is the extension payload. 

Follow these steps to configure the Chat Agent Suggestions feature with an OCI Generative AI Cohere tenancy:

  1. Within the Browser UI
  2. Navigate to Administration > External Objects & Integrations
    • Set-up an External Objects connection with your OCI Generative AI Cohere endpoint. Refer to External Object Configuration Section for details.
      Note: The External object connection should be pointing to OCI Gen AI. The base URL has to be specifed in below format
      https://{Inference API Endpoint}/20231130/actions/chat
  3. Navigate to Administration > Live Chat Configuration > Chat Agent Suggestions

    Agent Suggestion

  4. “Chat Agent Suggestions” home page will show the list of existing connections.

    Chat Agent Suggestion Home Page

  5. Select “Add New” to create a new connection & complete the following fields in the left side of the page for this connection:
    1. Name: Any meaningful name with max length of 11 characters. Name must start with a letter, end with a letter or number, and only contain letters, numbers or underscore.
    2. Notes: Relevant notes for this connection
  6. Navigate to the “Configurations” tab and complete the following fields for this connection:
    • Type : OCI > Oracle Gen AI Cohere
    • LLM XO Connections : Select previously created External Object connection.

      New Agent Suggestion OCI Gen AI Cohere Configuration

  7. Navigate to the “Profile Access” tab to assign profiles to this connection:
    • For any interface, use the menu to select the profile(s) for which this feature is enabled
    • Select an interface
    • From the menu on the left, select the profile, then use the arrow button to move the profile to the menu on the right. Multiple profiles can be selected
       

      New Agent Suggestion OCI Gen AI Cohere Profile Configuration

  8. Navigate to the “Customizations” tab to define Extensibility registered action names for this connection:
    • Convert Request Extensibility Action: Name of the registered action from BUI Extension.
      Develop Extensibility Code that is used for creating the request payload for getting the suggestion from the OCI Generative AI End point.
    • Convert Response Extensibility Action: Name of the registered action from BUI Extension.
      Develop Extensibility Code that is used for creating the response format required by Oracle B2C Service Agent Browser UI. 
    • Logging Extensibility Action: Name of the registered action from BUI Extension.
      Develop Extensibility Code that is triggered when a suggestion action is performed from Oracle B2C Service Agent Browser UI. This will be helpful if you wish to monitor the agent suggestion usage for a site. This is an optional step.
    • Feedback Extensibility Action: This option is currently disabled and will be enabled in future release with the capability of collecting feedback from agents using the feature

      New Agent Suggestion OCI Gen AI Cohere Customization

  9. Save your changes.

Sample code for Gen AI Cohere Extension

    // Sample code for OCI Gen AI Cohere Extension.

    // For creating the Request Payload
    public ociGenAIRequestExtensionCohere(param: any): any {
        // Perform some logic on param.
        let messages: any[] = [];
        // Chat History are passed as part of chatHistory property.
        let transcript = param.chatHistory;
        // Message is passed as part of message attribute.
        let message = param.message;

        for (const transcriptItem in transcript) {
            if (transcript.hasOwnProperty(transcriptItem) && !transcript[transcriptItem].private && !transcript[transcriptItem].offTheRecord) {
                let message = transcript[transcriptItem].message;
                if (transcript[transcriptItem].senderType === 'AGENT') {
                    messages.push({ 'role': 'CHATBOT', 'message': message });
                } else if (transcript[transcriptItem].senderType === 'END_USER') {
                    messages.push({ 'role': 'USER', 'message': message });
                }
            }
        }
        // Below is a sample prompt with Large Language Parameters for COHERE Model.
  // https://docs.oracle.com/en-us/iaas/api/#/en/generative-ai-inference/20231130/datatypes/CohereChatRequest
  // https://docs.oracle.com/en-us/iaas/api/#/en/generative-ai-inference/20231130/ChatResult/Chat
  // https://docs.oracle.com/en-us/iaas/api/#/en/generative-ai-inference/20231130/datatypes/ChatDetails
        let chatRequest = {
            'maxTokens': 150,
            'temperature': 1,
            'preambleOverride': 'Give result in 50 words',
            'frequencyPenalty': 0,
            'presencePenalty': 0,
            'topP': 0.75,
            'topK': 0,
            'isStream': false, // isStream should be false
            'chatHistory': messages,
            'message': message,
            'apiFormat': 'COHERE'
        };

        let payload = {
            'compartmentId': 'Your Compartment Id', // Compartment Id you want to connect
            'servingMode': {
                'modelId': 'cohere.command-r-08-2024', // cohere model you want to connect
                'servingType': 'ON_DEMAND'
            },
            'chatRequest': chatRequest
        };
        return { 'payload': payload };
    }

 // For creating the Response
    public ociGenAIResponseExtensionCohere(param: any): any {
        let response = param.payload;
        return { 'suggestionText': response?.chatResponse.text };
    }

Sample Code for Gen AI Meta Extension

// Sample code for OCI Gen AI Meta Extension.

    // For creating the Request Payload
    public ociGenAIRequestExtensionMeta(param: any): any {
        // Perform some logic on param.
        let messages: any[] = [];
        // Chat History are passed as part of chatHistory property.
        let transcript = param.chatHistory;
        // Message is passed as part of message attribute.
        let message = param.message;

        for (const transcriptItem in transcript) {
            if (transcript.hasOwnProperty(transcriptItem) && !transcript[transcriptItem].private && !transcript[transcriptItem].offTheRecord) {
                let message = transcript[transcriptItem].message;
                if (transcript[transcriptItem].senderType === 'AGENT') {
                    messages.push({ 'role': 'ASSISTANT', 'content': [{ 'type': 'TEXT', 'text': message }] });
                } else if (transcript[transcriptItem].senderType === 'END_USER') {
                    messages.push({ 'role': 'USER', 'content': [{ 'type': 'TEXT', 'text': message }] });
                }
            }
        }
        if (message) {
            messages.push({ 'role': 'USER', 'content': [{ 'type': 'TEXT', 'text': message }] });
        }
        // Below is a sample prompt with Large Language Parameters for Meta Model
		// https://docs.oracle.com/en-us/iaas/api/#/en/generative-ai-inference/20231130/datatypes/GenericChatRequest
		// https://docs.oracle.com/en-us/iaas/api/#/en/generative-ai-inference/20231130/ChatResult/Chat
		// https://docs.oracle.com/en-us/iaas/api/#/en/generative-ai-inference/20231130/datatypes/ChatDetails 

        let chatRequest = {
            'maxTokens': 600,
            'messages': messages, // chat History has to be populated and passed on for maintaining the context of conversation
            'temperature': 1,
            'frequencyPenalty': 0,
            'presencePenalty': 0,
            'topP': 0.75,
            'topK': -1,
            'isStream': false, // is Stream should be false
            'apiFormat': 'GENERIC',
        };

        let payload = {
            'compartmentId': 'Your Compartment Id',
            'servingMode': {
                'modelId': 'meta.llama-3.3-70b-instruct', // model you want to connect
                'servingType': 'ON_DEMAND'
            },
            'chatRequest': chatRequest
        };
        return { 'payload': payload };
    }

    // For creating the Response  
    public ociGenAIResponseExtensionMeta(param: any): any {
        let response = param.payload;
        return { 'suggestionText': response?.chatResponse?.choices[0]?.message?.content[0]?.text };
    }

Azure Open AI

Azure OpenAI Service provides REST API access to OpenAI’s powerful language models like GPT-4o, GPT-4o mini, GPT-4, GPT-3.5-Turbo etc. These models can be easily configured for the Agent Suggestions feature. Refer to Azure Open AI documentation for details

Follow these steps to configure the Chat Agent Suggestions feature with an Azure Open AI tenancy:

  1. Within the Browser UI
  2. Navigate to Administration > External Objects & Integrations
  3. Navigate to Administration > Chat Configurations > Chat Agent Suggestions

    Agent Suggestion

  4. “Chat Agent Suggestions” home page will show the list of existing connections.

    Agent Suggestion Admin Home Page

  5. Select “Add New” to create a new connection & complete the following fields in the left side of the page for this connection:
    • Name: Any meaningful name with max length of 11 characters. Name must start with a letter, end with a letter or number, and only contain letters, numbers or underscore.
    • Notes: Relevant notes for this connection
  6. Navigate to the “Configurations” tab and complete the following fields for this connection: 
    • Type : Azure > Azure Open AI
    • LLM XO Connections : Select previously created External Object connection.

      New Agent Suggestion Azure Open AI Configuration

  7. Navigate to the “Profile Access” tab to assign profiles to this connection:
    • For any interface, use the menu to select the profile(s) for which this feature is enabled
    • Select an interface
    • From the menu on the left, select the profile, then use the arrow button to move the profile to the menu on the right. Multiple profiles can be selected

      New Agent Suggestion Azure Open AI Profile Configuration

  8. Navigate to the “Customizations” tab to define Extensibility registered action names for this connection
    • Convert Request Extensibility Action: Name of the registered action from BUI Extension.
      Develop Extensibility Code that is used for creating the request payload for getting the suggestion from the Azure Open AI End point.
    • Convert Response Extensibility Action: Name of the registered action from BUI Extension.
      Develop Extensibility Code that is used for creating the response format required by Oracle B2C Service Agent Browser UI. 
    • Logging Extensibility Action: Name of the registered action from BUI Extension.
      Develop Extensibility Code that is triggered when a suggestion action is performed from Oracle B2C Service Agent Browser UI. This will be helpful if you wish to monitor the agent suggestion usage for a site. This is an optional step.
    • Feedback Extensibility Action: This option is currently disabled and will be enabled in future release with the capability of collecting feedback from agents using the feature

      New Agent Suggestion Azure Open AI Customization

       

  9. Save your changes.

Sample code for Azure Open AI Extension

// Sample code for Azure OpenAI Extension.

    // For creating the Request Payload
    public azureOpenAIRequestExtension(param: any): any {
        // Perform some logic on param.
        let messages: any[] = [];
        // Chat History are passed as part of chatHistory property.
        let transcript = param.chatHistory;
        // Message is passed as part of message attribute.
        let message = param.message;

        messages.push({
            'role': 'system',
            'content': 'You are an AI assistant and returns result in 75 words.'
        });
        for (const transcriptItem in transcript) {
            if (transcript.hasOwnProperty(transcriptItem) && !transcript[transcriptItem].private && !transcript[transcriptItem].offTheRecord) {
                let message = transcript[transcriptItem].message;
                if (transcript[transcriptItem].senderType === 'AGENT') {
                    messages.push({ 'role': 'assistant', 'content': message });
                } else if (transcript[transcriptItem].senderType === 'END_USER') {
                    messages.push({ 'role': 'user', 'content': message });
                }
            }
        }
        messages.push({ 'role': 'user', 'content': message });
        // Below is a sample prompt with Large Language Parameters for Azure OpenAI
		// https://learn.microsoft.com/en-us/azure/ai-services/openai/reference
        let payload = {
            'messages': messages, // chat History has to be populated and passed on for maintaining the context of conversation
            'temperature': 0.7,
            'top_p': 0.95,
            'frequency_penalty': 0,
            'presence_penalty': 0,
            'max_tokens': 150,
            'stop': null,
            'stream': false // stream should be false
        };
        return {'payload' : payload};
    }

    // For parsing the Response
    public azureOpenAIResponseExtension(param: any): any {
        let response = param.payload;
        return { 'suggestionText': response?.chatResponse?.choices[0]?.message?.content[0]?.text };
    }

 

Others (Rest Endpoints)

Besides the providers discussed above, the Agent Suggestion can be integrated with any rest providers. The rest endpoint has to be configured as External Object and it can be used for getting Agent Suggestion.

Follow these steps to configure the Chat Agent Suggestions feature with Others option:

  1. Within the Browser UI
  2. Navigate to Administration > External Objects & Integrations
  3. Navigate to Administration > Chat Configurations > Chat Agent Suggestions

    Agent Suggestion

  4. “Chat Agent Suggestions” home page will show the list of existing connections.

    Agent Suggestion Home Page

  5. Select “Add New” to create a new connection & complete the following fields in the left side of the page for this connection:
    • Name: Any meaningful name with max length of 11 characters. Name must start with a letter, end with a letter or number, and only contain letters, numbers or underscore.
    • Notes: Relevant notes for this connection
  6. Navigate to the “Configurations” tab and complete the following fields for this connection: 
    • Type : Others
    • LLM XO Connections : Select previously created External Object connection.

      New Agent Suggestion Others Configuration

  7. Navigate to the “Profile Access” tab to assign profiles to this connection:
    • For any interface, use the menu to select the profile(s) for which this feature is enabled
    • Select an interface
    • From the menu on the left, select the profile, then use the arrow button to move the profile to the menu on the right. Multiple profiles can be selected

      New Agent Suggestion Other Profile Permission

       

  8. Navigate to the “Customizations” tab to define Extensibility registered action names for this connection:
    • Convert Request Extensibility Action: Name of the registered action from BUI Extension.
      Develop Extensibility Code that is used for creating the request payload for getting the suggestion from the Rest End point.
    • Convert Response Extensibility Action: Name of the registered action from BUI Extension.
      Develop Extensibility Code that is used for creating the response format required by Oracle B2C Service Agent Browser UI. 
    • Logging Extensibility Action: Name of the registered action from BUI Extension.
      Develop Extensibility Code that is triggered when a suggestion action is performed from Oracle B2C Service Agent Browser UI. This will be helpful if you wish to monitor the agent suggestion usage for a site. This is an optional step.
    • Feedback Extensibility Action: This option is currently disabled and will be enabled in future release with the capability of collecting feedback from agents using the feature
    • New Agent Suggestion Other Customization Configuration

       

  9. Save your changes.
  10. Extension Code would be similar to OCI Gen AI provider where request payload would be created and response would be formatted.

 

External Object Configuration

An External Objects Connection is required for connecting the Chat Agent Suggestions feature with sources like OCI Generative AI Agent, OCI Generative AI, and Azure Open AI. Follow the steps in this documentation to configure the External Object Connection.

  1. Within the Browser UI
  2. Navigate to Administration > External Objects & Integrations

    Admin Configuration

  3. External Object Home Page will list all existing connections

    External Object Home Page

  4. Create a new External Object connections for the Agent Suggestions End Point. The endpoints for each of the different sources (ex: OCI Generative AI Agent, OCI Generative AI, Azure Open AI) are all different, so a separate External Objects connection must be created for each.
  5. Select “Add New” for creating new External Object Connection. Provide the API endpoints of the service provider and include the necessary authentication details. Ensure that you add the required headers or query parameters as specified by your service provider.

    External Object New Admin

BUI Extensibility

The extension has to be added as Console Extension in BUI.

Register Extensibility Action

 Register the action name and invoke the code below, so that the action can execute the callback function (BUI Extensibility Documentation):

class SampleExtensionClass {
  public async initialize(): Promise<void> {
    const extensionProvider: IExtensionProvider = await ORACLE_SERVICE_CLOUD.extension_loader.load("CUSTOM_APP_ID", "1");
    const globalContext: IExtensionGlobalContext = await extensionProvider.getGlobalContext();

    //register the functions defined for converting request and response as defined.
    globalContext.registerAction('ociGenAIRequestExtensionCohere', this.convertRequest.bind(this));
    globalContext.registerAction('ociGenAIResponseExtensionCohere', this.convertResponse.bind(this));
  }
.....
// add convert request and add convert response functions defined in above code snippets
.....
}
(async () => {
  return await new SampleExtensionClass().initialize();
})()