# Agent Assist Widget Configuration

After you add the Agent Assist channel, you can configure it for use with different Data Sources.

1. Navigate to **Settings > AiseraGPT** and choose the bot that has an **Agent Assist** channel.
2. In the **AiseraGPT Details** window, choose the Agent Assist channel.

<div align="left"><figure><img src="https://2363686080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpGx3TYftP94ZFjKvFVqM%2Fuploads%2FD4B9rKrVuu8KqbpRWYu9%2Fagent_assist_channel.png?alt=media&#x26;token=9fc6f49f-276d-482d-981f-c74480c6e819" alt="" width="563"><figcaption><p>AiseraGPT Details Window</p></figcaption></figure></div>

3. In the **Channel Details** window, select Enable for the following checkboxes:

<div align="left"><figure><img src="https://2363686080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpGx3TYftP94ZFjKvFVqM%2Fuploads%2FAtCJ8OZJ4hM3vh6NEVKu%2Fchannel1.png?alt=media&#x26;token=94dd1163-e5a1-4fc1-9d3e-c1a287f47f28" alt="" width="563"><figcaption><p>Agent Assist Channel Details</p></figcaption></figure></div>

<div align="left"><figure><img src="https://2363686080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpGx3TYftP94ZFjKvFVqM%2Fuploads%2F243ADAzMkiBqugxHpesf%2Fchannels2.png?alt=media&#x26;token=d57ded17-dd6e-4cbf-a061-c9f4b3332a0f" alt="" width="563"><figcaption><p>Edit Ticket AI Agent Assist Channel </p></figcaption></figure></div>

4. Add code for the **Widget** configuration, based on your Data Source:

<div align="left"><figure><img src="https://2363686080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpGx3TYftP94ZFjKvFVqM%2Fuploads%2Fv0X0DmYwW1ThXgiz8sZG%2Fchannels3_widget.png?alt=media&#x26;token=75fe69ca-4725-46ba-9338-860a5aa1c483" alt="" width="563"><figcaption></figcaption></figure></div>

5. Choose one of the links below for code you can paste into the Widget Configuration \
   per data source:
   1. [**Salesforce Widget**](https://docs.aisera.com/agent-assist/adding-the-ticket-ai-agent-assist-channel/agent-assist-widget-configuration/salesforce-widget)
   2. [**ServiceNow Widget**](https://docs.aisera.com/agent-assist/adding-the-ticket-ai-agent-assist-channel/agent-assist-widget-configuration/servicenow-widget)
   3. [**Zendesk Widget**](https://docs.aisera.com/agent-assist/adding-the-ticket-ai-agent-assist-channel/agent-assist-widget-configuration/zendesk-widget)
6. Include the following code in the **Policy** parameter field, and verify that the **`regService`, `intentExtractionService,`** **`summaryService,`** and **`nextBestAction`** fields are set to `true`:

```
   {
   "enabled": true,
   "queryFields": [
      "title",
      "description"
   ],
   "preProcessingV2": {
      "title": "function setTitle(title) { if (title.startsWith(\"'\")) {    title = title.replace(\"'\", '');  }  if (title.endsWith(\"'\")) {    title = title.substring(0, title.length - 1);  }  return title;}",
      "description": "function(description){var pre = 'Message: Short Description of Issue:';var i=description.toLowerCase().indexOf(pre.toLowerCase());if(i>=0){return description.substring(i+pre.length(), description.length());}return description;}",
      "searchText": "function setTitle(title) {  if (title.startsWith(\"'\")) {    title = title.replace(\"'\", '');  }  if (title.endsWith(\"'\")) {    title = title.substring(0, title.length - 1);  }  return title;}"
   },
   "processing": {
      "method": "sequential",
      "fields": [
         "title",
         "title+description"
      ],
      "sequentialStopScore": 90
   },
   "confidenceScoreThreshold": {
      "intent": 20,
      "bol": 60,
      "keywordsearch": 30,
      "kbClassifier": 40
   },
   "scoreNormalization": {
      "kb_classifier": "function(score){return (score-80)*(100-95)/(100-80)+95;}",
      "intent": "function(score){return (score-80)*(100-95)/(100-80)+95;}",
      "bol": "function(score){return (score-60)*(95-90)/(100-60)+90;}",
      "keywordsearch": "function(score){return (score-30)*(90-85)/(100-30)+85;}",
      "publicKBs": "function(score){return 90;}"
   },
   "maxNumOfKB": 5,
   "kbPredictionMode": "NORMAL",
   "enableEntityMatching": false,
   "expandClassAsEntity": false,
   "maxNumOfIntents": 10,
   "cannedAnswer": {
      "enabled": false,
      "defaultQueryText": "function getDefaultQueryText(input) { return \"\";}",
      "searchText": "function setTitle(title) {  if (title.startsWith(\"'\")) {    title = title.replace(\"'\", '');  }  if (title.endsWith(\"'\")) {    title = title.substring(0, title.length - 1);  }  return title;}",
      "datasourceId": "1",
      "botId": 2,
      "favorites": true,
      "useScript": true,
      "script": "function templates(input) { const botId = 2;if(input.type && input.type == 'Incident') console.log('@@@@@input = ' + JSON.stringify(input)); else console.log('@@@@@@ inside else'); return botId;}"
   },
   "freeFormSearch": {
      "enabled": true,
      "isSearchOnly": false
   },
   "autoCompleteTickets": {
      "datasourceId": "17",
      "maxTickets": 300
   },
   "predictionPostProcessing": {
      "similarConversations": "function(predictionObj) { console.log('inside similarConversations' + JSON.stringify(predictionObj));return predictionObj.responseData;}"
   },
   "predictions": [
      "predictionsV3"
   ],
   "useTenantClientRestAPI": true,
   "useKBClassifier": false,
   "useKBClassifierV2": true,
   "KBClassifierMode": "append",
   "predictionTimeout": {
      "similarTickets": 10,
      "search": 6,
      "icmv2": 20,
      "sentiment": 20,
      "escalation": 5,
      "nlp": 10,
      "summary": 10,
      "answer": 90,
      "intentExtraction": 5
   },
   "aclKeys": [],
   "ragService": {
      "enabled": true,
      "flowId": "e7752e43-398c-4a4c-a64d-b30e3313df9c",
      "deadlineInSec": 90
   },
   "intentExtractorService": {
      "enabled": true,
      "formatter": "function(output){ console.log('intentExtractorService formatter ' + output.data);return output.data;}",
      "preProcessMessage": "function(message){return message;}",
      "requestParameters": "function(requestParameters){return [];}"
   },
   "summaryService": {
      "enabled": true,
      "flowId": "e33c2845-2549-4e28-8edf-6db503d5fa50",
      "deadlineInSec": 30
   },
   "sentimentService": {
      "enabled": false,
      "formatter": "function(output){ console.log('sentimentService formatter ' + output.data);return output.data;}",
      "preProcessMessage": "function(message){return message;}",
      "requestParameters": "function(requestParameters){return requestParameters;}"
   },
   "similarConversations": {
      "summaryEnabled": true
   },
   "nextBestAction": {
      "enabled": true,
      "flowId": "cb34c80b-1180-4b92-bd0e-dae891416ff2",
      "deadlineInSec": 90
   }
}
```

5. Use the default settings for the remaining fields.

\ <br>
