{"id":21411,"date":"2019-06-11T06:23:34","date_gmt":"2019-06-11T05:23:34","guid":{"rendered":"https:\/\/developer.kore.ai\/v7-2\/?p=21411"},"modified":"2021-03-30T07:19:17","modified_gmt":"2021-03-30T06:19:17","slug":"context-object","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v7-2\/docs\/bots\/bot-builder-tool\/dialog-task\/context-object\/","title":{"rendered":"Context Object"},"content":{"rendered":"<section class=\"l-section wpb_row height_auto\"><div class=\"l-section-h i-cf\"><div class=\"g-cols vc_row type_default valign_top\"><div class=\"vc_col-sm-12 wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p><span style=\"font-weight: 400\">The <code>Context<\/code> object is the container object that persists data for dialog execution and across all intents i.e.\u00a0dialog tasks, action, alert &amp; info tasks, and FAQs. The Kore.ai&#8217;s natural language processing (NLP) engine populates the intent identified, entities extracted, and history into this object. Keys from the <code>Context<\/code> object can be used in the dialog task and intent transition conditions. In addition, the <code>context<\/code> object can be accessed with additional system and session variables.\u00a0<\/span><\/p>\n<p>The\u00a0syntax when using a\u00a0<code>Context<\/code> object key in a URL is to enclose the object name in double brackets as shown next:<br \/>\n<span style=\"color: #0000ff\">https:\/\/quora.com\/<strong>{{context.entities.topic}}<\/strong>\/rss<\/span><\/p>\n<p><span style=\"font-weight: 400\">The <code>Context<\/code> object can also be referenced in a Script node\u00a0as well as for dynamic values in an\u00a0Entity node and passed in the payload response to the Kore.ai SDK. You can update the <code>Context<\/code> object key values based on business logic to\u00a0influence the dialog task execution.<\/span><\/p>\n<p>The following table describes the <code>Context<\/code> object keys.<\/p>\n<table>\n<thead>\n<tr>\n<th>Key<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>intent<\/td>\n<td>The intent recognized by the NLP interpreter.<br \/>\n<b>Syntax:<\/b> <code>context.intent.&lt;&lt; intent name &gt;&gt;<\/code><\/td>\n<\/tr>\n<tr>\n<td>entities<\/td>\n<td>An array of key\/value pairs based on user prompts and recognized user input for those prompts.<br \/>\n<b>Syntax:<\/b> <code>context.entities.&lt;&lt; entity name &gt;&gt;<\/code>In the following code example, the <code>context.entities<\/code> object is used to access values for the amount and account names as a confirmation for a funds transfer between accounts<\/p>\n<pre>var today = new Date();\r\nif(today.getHours() &lt; 21)\r\n {\r\n   print(\"You have requested to transfer \" +context.entities.Amount + \" USD from \" +context.entities.FromAccountName +\" to \" +context.entities.ToAccountName + \" account. \" +  \" Your funds will be shown immediately though transfer will be shown in tomorrow's date in your transaction history. Shall I go ahead? \");\r\n  }\r\n else\r\n {\r\n  print(\"You have requested to transfer \" +context.entities.Amount + \" USD from \" +context.entities.FromAccountName +\" to \" +context.entities.ToAccountName + \" account. Shall I go ahead? \" +context.accdata[0].transactions.length);\r\n  }<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td>traits<\/td>\n<td>Traits set for the given context<\/td>\n<\/tr>\n<tr>\n<td>currentLanguage<br \/>\n(introduced in ver7.1)<\/td>\n<td>the current conversation language<\/td>\n<\/tr>\n<tr>\n<td>suggestedLanguages<br \/>\n(introduced in ver7.1)<\/td>\n<td>list of all languages detected by the platform from the user&#8217;s first utterance, presented in the order of confidence level. This will be reset at the start of each conversation.<\/td>\n<\/tr>\n<tr>\n<td>session.EnterpriseContext<\/td>\n<td>A key\/value pair defined by the developer. Any Bots developed by that developer can read and modify this key. The data is common for all Bots and all users in an enterprise.<br \/>\n<b>Syntax:<\/b><br \/>\nGET &#8211; <code>context.session.EnterpriseContext.&lt;&lt; varName &gt;&gt;<\/code><br \/>\nPUT &#8211; <code>EnterpriseContext.put( &lt;&lt; \u2018varName\u2019 &gt;&gt;, &lt;&lt; value &gt;&gt;, &lt;&lt; persistTimeInMinutes &gt;&gt;)<\/code><br \/>\nDELETE &#8211; <code>EnterpriseContext.delete( &lt;&lt; \u2018varName\u2019 &gt;&gt;)<\/code><\/td>\n<\/tr>\n<tr>\n<td>session.BotContext<\/td>\n<td>A key\/value pair defined by the developer. The data is common for this Bot only and to all users in an enterprise.<br \/>\n<b>Syntax:<\/b><br \/>\nGET &#8211; <code>context.session.BotContext.&lt;&lt; varName &gt;&gt;<\/code><br \/>\nPUT &#8211; <code>BotContext.put( &lt;&lt; \u2018varName\u2019 &gt;&gt;, &lt;&lt; value &gt;&gt;, &lt;&lt; persistTimeInMinutes &gt;&gt;)<\/code><br \/>\nDELETE &#8211; <code>BotContext.delete( &lt;&lt; \u2018varName\u2019 &gt;&gt;)<\/code><\/td>\n<\/tr>\n<tr>\n<td>session.UserContext<\/td>\n<td>A read-only key\/value pair from the Bots Platform that provides all users profile data. This key is not available for Bot definitions but is available as a platform variable.<br \/>\n<b>Syntax:<\/b><br \/>\nGET &#8211; <code>context.session.UserContext.&lt;&lt; varName &gt;&gt;<\/code><\/td>\n<\/tr>\n<tr>\n<td>session.UserSession<\/td>\n<td>A key\/value pair defined by the developer. The data is common for all Bots but only for the specified user in an enterprise.<br \/>\n<b>Syntax:<\/b><br \/>\nGET &#8211; <code>context.session.UserSession.&lt;&lt; varName &gt;&gt;<\/code><br \/>\nPUT &#8211; <code>UserSession.put( &lt;&lt; \u2018varName\u2019 &gt;&gt;, &lt;&lt; value &gt;&gt;, &lt;&lt; persistTimeInMinutes &gt;&gt;)<\/code><br \/>\nDELETE &#8211; <code>UserSession.delete( &lt;&lt; \u2018varName\u2019 &gt;&gt;)<\/code><\/td>\n<\/tr>\n<tr>\n<td>session.BotUserSession<\/td>\n<td>A key\/value pair defined by the developer. The data is common for all users but only for the specified Bot in an enterprise.<br \/>\n<b>Syntax:<\/b><br \/>\nGET &#8211; <code>context.session.BotUserSession.&lt;&lt; varName &gt;&gt;<\/code><br \/>\nPUT &#8211; <code>BotUserSession.put( &lt;&lt; \u2018varName\u2019 &gt;&gt;, &lt;&lt; value &gt;&gt;, &lt;&lt; persistTimeInMinutes &gt;&gt;)<\/code><br \/>\nDELETE &#8211; <code>BotUserSession.delete( &lt;&lt; \u2018varName\u2019 &gt;&gt;)<\/code><\/td>\n<\/tr>\n<tr>\n<td>history<\/td>\n<td>An array that contains the <code>nodeId<\/code> for each component using the NLP interpreter.<\/td>\n<\/tr>\n<tr>\n<td>&lt;&lt; nodename &gt;&gt;.response.body<\/td>\n<td>The HTTP JSON response from the Service node.<br \/>\n<b>Syntax:<\/b> <code>context.&lt;&lt; node name &gt;&gt;.response.body<\/code><br \/>\nIn the following code example, the response from a Service node is displayed to the end-user in a Message node.<br \/>\n<code><br \/>\nprint(JSON.stringify(context.fetchopportunitiesnode.response.body));<br \/>\n<\/code><\/td>\n<\/tr>\n<tr>\n<td>Developer Defined Key<\/td>\n<td>A key\/value pair defined by the developer.<br \/>\n<b>Syntax:<\/b> <code>context.&lt;&lt; varName &gt;&gt;<\/code><br \/>\nFor example, <code>context.customerId<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Sample Context Object<\/strong><\/p>\n<p>The following is a payload response that contains a context object.<\/p>\n<pre class=\"lang:default decode:true \">\"context\":{\r\n   \"bot\":\"Kore Banking Documentation\",\r\n   \"botid\":\"st-b4a22e86-XXXX-575c-b888-e106d083a251\",\r\n   \"taskid\":\"dg-df510618-XXXX-5a0b-8370-ee042b3e5b47\",\r\n   \"intent\":\"Agent\",\r\n   \"intentType\":\"dialog\",\r\n   \"entities\":{\r\n      \"Name\":12345,\r\n      \"number\":1234\r\n   },\r\n   \"userInputs\":{\r\n      \"originalInput\":{\r\n         \"sentence\":\" agent\",\r\n         \"timestamp\":1501244143000\r\n      }\r\n   },\r\n   \"history\":[\r\n      {\r\n         \"originalSentence\":\"agent\",\r\n         \"timestamp\":1501244143000\r\n      },\r\n      {\r\n         \"dialogState\":\"started\",\r\n         \"timestamp\":1501244143000\r\n      },\r\n      {\r\n         \"nodeId\":\"intent0\",\r\n         \"state\":\"processed\",\r\n         \"type\":\"intent\",\r\n         \"componentName\":\"Agent\",\r\n         \"timestamp\":1501244143000\r\n      },\r\n      {\r\n         \"nodeId\":\"entity1\",\r\n         \"state\":\"processing\",\r\n         \"type\":\"entity\",\r\n         \"componentName\":\"Name\",\r\n         \"timestamp\":1501244143000\r\n      },\r\n      {\r\n         \"nodeId\":\"entity1\",\r\n         \"state\":\"waitingForUserInput\",\r\n         \"type\":\"entity\",\r\n         \"componentName\":\"Name\",\r\n         \"timestamp\":1501244143000\r\n      },\r\n      {\r\n         \"nodeId\":\"entity1\",\r\n         \"state\":\"processed\",\r\n         \"type\":\"entity\",\r\n         \"componentName\":\"Name\",\r\n         \"timestamp\":1501244149000\r\n      },\r\n      {\r\n         \"nodeId\":\"entity4\",\r\n         \"state\":\"processing\",\r\n         \"type\":\"entity\",\r\n         \"componentName\":\"number\",\r\n         \"timestamp\":1501244149000\r\n      },\r\n      {\r\n         \"nodeId\":\"entity4\",\r\n         \"state\":\"waitingForUserInput\",\r\n         \"type\":\"entity\",\r\n         \"componentName\":\"number\",\r\n         \"timestamp\":1501244149000\r\n      },\r\n      {\r\n         \"nodeId\":\"entity4\",\r\n         \"state\":\"processed\",\r\n         \"type\":\"entity\",\r\n         \"componentName\":\"number\",\r\n         \"timestamp\":1501244156000\r\n      },\r\n      {\r\n         \"nodeId\":\"agentTransfer3\",\r\n         \"state\":\"processing\",\r\n         \"type\":\"agentTransfer\",\r\n         \"componentName\":\"agenttransfer\",\r\n         \"timestamp\":1501244156000\r\n      },\r\n      {\r\n         \"dialogState\":\"transferredToAgent\",\r\n         \"timestamp\":1501244156000\r\n      }\r\n   ],\r\n   \"dialog_tone\":[\r\n      {\r\n         \"tone_name\":\"positive\",\r\n         \"level\":1\r\n      }\r\n   ],\r\n   \"message_tone\":[\r\n      {\r\n         \"tone_name\":\"positive\",\r\n         \"level\":1\r\n      }\r\n   ],\r\n  \"currentTags\": {\r\n    \"tags\": [\r\n      \"name\"\r\n    ]\r\n  },\r\n  \"historicTags\": [\r\n    {\r\n      \"tags\": [\r\n        \"name\"\r\n      ]\r\n    }\r\n  ],\r\n   \"session\":{\r\n      \"EnterpriseContext\":{\r\n         \"5\":\"500\",\r\n         \"TestData-Ent\":\"1000234\",\r\n         \"ec1\":\"Enterprise Context session variable from processor\",\r\n         \"Enterprise_G_Smith_Email\":\"george.smith@kore.com\",\r\n         \"enterprisesessiondialog\":\"enterprisesessiondialogvalue\",\r\n         \"enterprisecustomprocessor\":\"enterprisecustomprocessorvalue\",\r\n         \"enterprisepreprocessor\":\"enterprisepreprocessorvalue\",\r\n         \"EnterpriseContext\":\"EnterpriseContextvalueresponse\",\r\n         \"Entersession123\":\"Entersession123value\",\r\n         \"EnterpriseContext Summary\":\"TestingSpread\",\r\n         \"enterprisecontext\":\"enterprisecontextvalue\",\r\n         \"ec2\":\"Enterprise Context session variable from channel response\",\r\n         \"EC\":\"ec session variable from intializer\",\r\n         \"enterprisepreprocessorkey\":\"enterprisepreprocessorvalue\"\r\n      },\r\n      \"BotContext\":{\r\n      },\r\n      \"UserContext\":{\r\n         \"profColour\":\"#3651fc\",\r\n         \"workinghours\":{\r\n            \"workdays\":\"Mon, Tue, Wed, Thu, Fri, Sat, Sun\",\r\n            \"workstart\":\"12:00 AM\",\r\n            \"workend\":\"12:00 PM\"\r\n         },\r\n         \"dept\":\"Product Development\",\r\n         \"jTitle\":\"Documentation Manager\",\r\n         \"profImage\":\"profile.png\",\r\n         \"activationStatus\":\"active\",\r\n         \"emailId\":\"help.docs@kore.com\",\r\n         \"firstName\":\"Help\",\r\n         \"lastName\":\"Docs\",\r\n         \"orgId\":\"o-b30656ae-XXXX-XXXX-9181-065f7de34be9\",\r\n         \"_id\":\"u-4b9f02a3-XXXX-XXXX-b5cc-6df81c0af603\",\r\n         \"customData\":null,\r\n         \"identities\":[\r\n            {\r\n               \"val\":\"help.docs@kore.com\",\r\n               \"type\":\"email\"\r\n            },\r\n            {\r\n               \"val\":\"kore\/u-4b9f02a3-XXXX-XXXX-b5cc-6df81c0af603\",\r\n               \"type\":\"mapped\"\r\n            }\r\n         ]\r\n      },\r\n      \"UserSession\":{\r\n      },\r\n      \"BotUserSession\":{\r\n         \"lastMessage\":{\r\n            \"channel\":\"rtm\",\r\n            \"messagePayload\":{\r\n               \"clientMessageId\":1501244152843,\r\n               \"message\":{\r\n                  \"body\":\"1234\"\r\n               },\r\n               \"resourceid\":\"\/bot.message\",\r\n               \"botInfo\":{\r\n                  \"chatBot\":\"Kore Banking Documentation\",\r\n                  \"taskBotId\":\"st-b4a22e86-XXXX-XXXX-b888-e106d083a251\"\r\n               },\r\n               \"client\":\"botbuilder\",\r\n               \"meta\":{\r\n                  \"timezone\":\"America\/New_York\",\r\n                  \"locale\":\"en-US\"\r\n               },\r\n               \"id\":1501244152843\r\n            }\r\n         }\r\n      },\r\n      \"opts\":{\r\n         \"userId\":\"u-4b9f02a3-XXXX-XXXX-b5cc-6df81c0af603\",\r\n         \"streamId\":\"st-b4a22e86-XXXX-XXXX-b888-e106d083a251\"\r\n      }\r\n   }\r\n},\r\n\"channel\":{\r\n   \"_id\":\"dc-5b4a742a-XXXX-XXXX-938f-520912935456\",\r\n   \"channelInfos\":{\r\n      \"requestId\":\"ms-26aae382-XXXX-XXXX-8bf1-a9e076770956\",\r\n      \"message\":\"The bot is not accessible via Web \/ Mobile Client.\",\r\n      \"body\":\"1234\",\r\n      \"client\":\"botbuilder\",\r\n      \"handle\":{\r\n         \"spanId\":\"8cab2ce2f6aabc47\",\r\n         \"traceId\":\"8cab2ce2f6aabc47\",\r\n         \"taskBotId\":\"st-b4a22e86-XXXX-XXXX-b888-e106d083a251\",\r\n         \"clientId\":\"5a37bf24-XXXX-XXXX-a816-f9602db08149\",\r\n         \"userId\":\"u-4b9f02a3-XXXX-XXXX-b5cc-6df81c0af603\",\r\n         \"handleId\":\"54e95c2b-XXXX-XXXX-ba6b-384d4166f1b2\"\r\n      },\r\n      \"botInfo\":{\r\n         \"taskBotId\":\"st-b4a22e86-XXXX-XXXX-b888-e106d083a251\",\r\n         \"chatBot\":\"Kore Banking Documentation\"\r\n      },\r\n      \"from\":\"u-4b9f02a3-3f6f-XXXX-XXXX-6df81c0af603\",\r\n      \"type\":\"rtm\"\r\n   },\r\n   \"__v\":0\r\n},\r\n\"baseUrl\":\"https:\/\/bots.kore.ai\/api\/botsdk\/stream\/st-b4a22e86-XXXX-XXXX-b888-e106d083a251\",\r\n\"sendUserMessageUrl\":\"https:\/\/bots.kore.ai\/api\/botsdk\/stream\/st-b4a22e86-e95b-XXXX-XXXX-e106d083a251\/sendUserMessage\/1501244156289\",\r\n\"sendBotMessageUrl\":\"https:\/\/bots.kore.ai\/api\/botsdk\/stream\/st-b4a22e86-e95b-XXXX-XXXX-e106d083a251\/sendBotMessage\/1501244156289\"\r\n}<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Sample_Context_Objects\"><em>Sample Context Objects<\/em><\/span><\/h3>\n<p>This section contains a series of sample\u00a0<code>Context<\/code> objects.<br \/>\n<strong>Sample 1<\/strong><\/p>\n<pre class=\"lang:default decode:true\">{\r\n  \"context\": {\r\n    \"bot\": \"ImageTest\",\r\n    \"botid\": \"st-59423292-a088-56f3-8bae-4aca93e979bf\",\r\n    \"taskid\": \"dg-5e03ef27-2660-560f-a51e-afba56ec8d0f\",\r\n    \"intent\": \"PrintHtml\",\r\n    \"intentType\": \"dialog\",\r\n    \"entities\": {\r\n      \"url\": \"www.yahoo.com\"\r\n    },\r\n    \"history\": [\r\n      \"intent0\",\r\n      \"entity2\",\r\n      \"service3\",\r\n      \"message4\"\r\n    ],\r\n    \"session\": {\r\n      \"EnterpriseContext\": {\r\n        \"Enterprise_J_Doe_Email\": \"John.Doe@kore.ai\",\r\n        \"EnterpriseContext Summary\": \"Testing\",\r\n        \"enterprisecontext\": \"enterprisecontextvalue\",\r\n        \"enterprisepreprocessor\": \"enterprisepreprocessorvalue\",\r\n        \"EnterpriseContext\": \"EnterpriseContextvalueresponse\",\r\n        \"enterprisecustomprocessor\": \"enterprisecustomprocessorvalue\",\r\n        \"enterprisepreprocessorkey\": \"enterprisepreprocessorvalue\",\r\n        \"Entersession123\": \"Entersession123value\",\r\n        \"enterprisesessiondialog\": \"enterprisesessiondialogvalue\"\r\n      },\r\n      \"BotContext\": {},\r\n      \"UserContext\": {\r\n        \"_id\": \"u-c93c649c-078b-52bc-93ee-f825e2ce909b\",\r\n        \"emailId\": \"Jane.Doe.com\",\r\n        \"lastName\": \"Jane\",\r\n        \"firstName\": \"Doe\",\r\n        \"profImage\": \"no-avatar\",\r\n        \"profColour\": \"#5AA921\",\r\n        \"activationStatus\": \"active\",\r\n        \"jTitle\": \"\",\r\n        \"orgId\": \"o-b30656ae-9be9-5fa2-9181-065f7de34be9\",\r\n        \"identities\": [\r\n          {\r\n            \"val\": \"Jane.Doe.com\",\r\n            \"type\": \"email\"\r\n          }\r\n        ]\r\n      },\r\n      \"UserSession\": {},\r\n      \"BotUserSession\": {},\r\n      \"opts\": {\r\n        \"userId\": \"u-c93c649c-078b-52bc-93ee-f825e2ce909b\",\r\n        \"streamId\": \"st-59423292-a088-56f3-8bae-4aca93e979bf\"\r\n      }\r\n    },\r\n    \"accountidtouse\": null,\r\n    \"report\": {\r\n      \"response\": {\r\n        \"body\": {\r\n          \"imageURLS\": {\r\n            \"vlarge\": \"https:\/\/app.collab.ai\/api\/getMediaStream\/media\/f-72247859-68b4-51d0-a9db-c78d2f1cb962.png?e=1485330342&amp;n=7470041802&amp;s=ImpsR2VPODZNUzVFaTVyN3lGd2hXUy9KQ1g4dE5KeXhEOGwybElWTWQ1VTA9Ig$$\",\r\n            \"small\": \"https:\/\/app.collab.ai\/api\/getMediaStream\/media\/f-d16f9842-5f65-5bd0-8442-25b90f919c6f.png?e=1485330342&amp;n=176619407&amp;s=IitsdS9QM2c3Y212Z1o1V0RTTmkrNkppVnVSbnhHaEpDSnN2ZDNtcW5oVkU9Ig$$\",\r\n            \"large\": \"https:\/\/app.collab.ai\/api\/getMediaStream\/media\/f-57f47443-f3fc-5258-b8ed-b55bfa50e63d.png?e=1485330343&amp;n=1981298329&amp;s=IkswUmZmQmJ1Lzc0d09FNi9XYld1T1IyZzAwa3p0M2tuS0g3U0pOZTVUUzg9Ig$$\"\r\n          }\r\n        }\r\n      }\r\n    },\r\n    \"message_tone\": [],\r\n    \"dialog_tone\": [],\r\n    \"mappedIntents\": []\r\n  }\r\n}<\/pre>\n<p><strong>Sample 2<\/strong><\/p>\n<pre class=\"lang:default decode:true\">{\r\n  \"context\": {\r\n    \"bot\": \"ImageTest\",\r\n    \"botid\": \"st-59423292-a088-56f3-8bae-4aca93e979bf\",\r\n    \"taskid\": \"dg-5e03ef27-2660-560f-a51e-afba56ec8d0f\",\r\n    \"intent\": \"PrintHtml\",\r\n    \"intentType\": \"dialog\",\r\n    \"entities\": {\r\n      \"url\": \"www.yahoo.com\"\r\n    },\r\n    \"history\": [\r\n      \"intent0\",\r\n      \"entity2\",\r\n      \"service3\",\r\n      \"message4\"\r\n    ],\r\n    \"session\": {\r\n      \"EnterpriseContext\": {\r\n        \"Enterprise_G_Ravindra_Email\": \"ravindra.balleda@kore.ai\",\r\n        \"EnterpriseContext Summary\": \"TestingSpread\",\r\n        \"enterprisecontext\": \"enterprisecontextvalue\",\r\n        \"enterprisepreprocessor\": \"enterprisepreprocessorvalue\",\r\n        \"EnterpriseContext\": \"EnterpriseContextvalueresponse\",\r\n        \"enterprisecustomprocessor\": \"enterprisecustomprocessorvalue\",\r\n        \"enterprisepreprocessorkey\": \"enterprisepreprocessorvalue\",\r\n        \"Entersession123\": \"Entersession123value\",\r\n        \"enterprisesessiondialog\": \"enterprisesessiondialogvalue\"\r\n      },\r\n      \"BotContext\": {},\r\n      \"UserContext\": {\r\n        \"_id\": \"u-c93c649c-078b-52bc-93ee-f825e2ce909b\",\r\n        \"emailId\": \"umesh.kushwaha@kore.ai\",\r\n        \"lastName\": \"Kushwaha\",\r\n        \"firstName\": \"Umesh\",\r\n        \"profImage\": \"no-avatar\",\r\n        \"profColour\": \"#5AA921\",\r\n        \"activationStatus\": \"active\",\r\n        \"jTitle\": \"\",\r\n        \"orgId\": \"o-b30656ae-9be9-5fa2-9181-065f7de34be9\",\r\n        \"identities\": [\r\n          {\r\n            \"val\": \"umesh.kushwaha@kore.ai\",\r\n            \"type\": \"email\"\r\n          }\r\n        ]\r\n      },\r\n      \"UserSession\": {},\r\n      \"BotUserSession\": {},\r\n      \"opts\": {\r\n        \"userId\": \"u-c93c649c-078b-52bc-93ee-f825e2ce909b\",\r\n        \"streamId\": \"st-59423292-a088-56f3-8bae-4aca93e979bf\"\r\n      }\r\n    },\r\n    \"accountidtouse\": null,\r\n    \"reportPage\": {\r\n      \"response\": {\r\n        \"body\": {\r\n          \"imageURLS\": {\r\n            \"vlarge\": \"https:\/\/bots.kore.ai\/api\/getMediaStream\/media\/f-72247859-68b4-51d0-a9db-c78d2f1cb962.png?e=1485330342&amp;n=7470041802&amp;s=ImpsR2VPODZNUzVFaTVyN3lGd2hXUy9KQ1g4dE5KeXhEOGwybElWTWQ1VTA9Ig$$\",\r\n            \"small\": \"https:\/\/bots.kore.ai\/api\/getMediaStream\/media\/f-d16f9842-5f65-5bd0-8442-25b90f919c6f.png?e=1485330342&amp;n=176619407&amp;s=IitsdS9QM2c3Y212Z1o1V0RTTmkrNkppVnVSbnhHaEpDSnN2ZDNtcW5oVkU9Ig$$\",\r\n            \"large\": \"https:\/\/bots.kore.ai\/api\/getMediaStream\/media\/f-57f47443-f3fc-5258-b8ed-b55bfa50e63d.png?e=1485330343&amp;n=1981298329&amp;s=IkswUmZmQmJ1Lzc0d09FNi9XYld1T1IyZzAwa3p0M2tuS0g3U0pOZTVUUzg9Ig$$\"\r\n          }\r\n        }\r\n      }\r\n    },\r\n    \"message_tone\": [],\r\n    \"dialog_tone\": [],\r\n    \"mappedIntents\": []\r\n  }\r\n}<\/pre>\n<p>The following section describes the <code>Context<\/code> object parameters.<\/p>\n<ul>\n<li><code>bot<\/code> &#8211; The name of the bot.<\/li>\n<li><code>botid<\/code> &#8211; The system unique GUID for the bot.<\/li>\n<li><code>taskid<\/code> &#8211;\u00a0The system unique GUID for the dialog task.<\/li>\n<li><code>intent<\/code> &#8211; The name of the root intent of the dialog task.<\/li>\n<li><code>intentType<\/code> &#8211; The dialog task type. One of:\n<ul>\n<li><code>dialog<\/code><\/li>\n<li>???<\/li>\n<\/ul>\n<\/li>\n<li><code>entities<\/code> &#8211; An array o key\/value pairs that represent entity nodes processed and their values, for example,\u00a0<span id=\"s-29\" class=\"sObjectK\">&#8220;SourceAirport&#8221;<\/span><span id=\"s-30\" class=\"sColon\">:<\/span><span id=\"s-31\" class=\"sObjectV\">&#8220;MCO&#8221;.<\/span><\/li>\n<li><code>history<\/code> &#8211; An array of objects defining the sequential and historical node path executed in the dialog flow.\n<ul>\n<li><code>nodeId<\/code> &#8211; The dialog task flow ID for this node using node type and incremental numbering, for example, intent0, service2, and so forth.<\/li>\n<li><code>state<\/code> &#8211; The status of object for the timestamp indicated. One of:\n<ul>\n<li><code><code>processing<\/code><\/code> \u2013 The Bots Platform begins processing of the node<\/li>\n<li><code><code>processed<\/code><\/code> \u2013 The node and node\u00a0connections are processed, a following node is found but the dialog has not yet moved to that node.<\/li>\n<li><code><code>waitingForUserInput<\/code><\/code> \u2013 The user was prompted\u00a0for input but has not been received.<\/li>\n<li><code><code>pause<\/code><\/code> \u2013 The current dialog\u00a0task is paused while another task is started.<\/li>\n<li><code><code>resume<\/code><\/code> \u2013 The current dialog with status of pause continues at the same point in the flow after completion of another task that was started.<\/li>\n<li><code><code>waitingForServerResponse<\/code><\/code> \u2013 The server request is pending an asynchronous response.<\/li>\n<li><code><code>error<\/code><\/code> \u2013 An error occurred, for example, the loop limit is reached, a server or script node execution fails.<\/li>\n<li><code><code>end<\/code><\/code> \u2013 \u00a0The dialog reached the end in the dialog\u00a0flow.<\/li>\n<\/ul>\n<\/li>\n<li><code>type<\/code> &#8211; The type of dialog task. One of:\n<ul>\n<li><code>intent<\/code> &#8211; The dialog task is a user intent or task.<\/li>\n<li><code>faq<\/code> &#8211; The dialog task is a knowledge graph.<\/li>\n<\/ul>\n<\/li>\n<li><code>componentName<\/code> &#8211; The name of the node.<\/li>\n<li><code>timestamp<\/code> &#8211; The JSON\u00a0date timestamp of the node execution, for example, <span style=\"color: #0000ff\">1492794646000<\/span>.<\/li>\n<\/ul>\n<\/li>\n<li><code>onHoldTasks<\/code> &#8211; array of all tasks that are kept on hold while a conversation is in progress. This is a read-only list which you can use for evaluation purposes. (introduced in ver 7.1)<\/li>\n<li><code>&lt; <em>service node name<\/em> &gt;<\/code> &#8211; A collection of objects for Service node executions.\n<ul>\n<li><code>response<\/code> &#8211; Returns the request status and response body as a JSON payload.\n<ul>\n<li><code>statusCode<\/code> &#8211; The HTTP status code of the request, for example, <code>200 OK<\/code>.<\/li>\n<li><code>body<\/code> &#8211; The JSON payload response body from the service request.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li><code>resultsFound<\/code> &#8211; <strong>True<\/strong>, if results are returned.<\/li>\n<li><code>session<\/code>\n<ul>\n<li><code>EnterpriseContext<\/code> &#8211; Key\/value pairs available to all bots and all users in an enterprise.<\/li>\n<li><code>BotContext<\/code> &#8211; Key\/value pairs available to all users of this specific bot.<\/li>\n<li><code>UserContext<\/code> &#8211; Key\/value pairs available to all bots for a user.\n<ul>\n<li><code>_id<\/code> &#8211; The Kore.ai user ID.<\/li>\n<li><code>emailId<\/code> &#8211; The email address associated with the user ID.<\/li>\n<li><code>lastName<\/code> &#8211;\u00a0The last name of the user.<\/li>\n<li><code>firstName<\/code> &#8211;\u00a0The first\u00a0name of the user.<\/li>\n<li><code>profImage<\/code> &#8211;\u00a0The image or avatar filename of the user.<\/li>\n<li><code>profColour<\/code> &#8211;\u00a0The account color for the user.<\/li>\n<li><code>activationStatus<\/code> &#8211; The account status of the user. One of:\n<ul>\n<li value=\"1\"><code>active<\/code> \u2013 The user is active and can interact with other Kore.ai users.<\/li>\n<li value=\"2\"><code>inactive<\/code> \u2013 The user is not active, but user data is retained in the system.<\/li>\n<li value=\"3\"><code>suspended<\/code> \u2013 The user is suspended by an administrator. The user cannot log on to Kore.ai, however, messages can still be sent to the suspended user.<\/li>\n<li value=\"4\"><code>locked<\/code> \u2013 The user exceeded the maximum number of log on attempts.<\/li>\n<\/ul>\n<\/li>\n<li><code>jTitle<\/code> &#8211; The title of the user, if defined.<\/li>\n<li><code>orgId<\/code> &#8211;\u00a0The organizational ID of the user account, if defined.<\/li>\n<li><code>customData<\/code> &#8211; Coming soon.<\/li>\n<li><code>identities<\/code> &#8211;\u00a0Alternate user IDs, if defined.\n<ul>\n<li><code>val<\/code> &#8211; The alternate ID<\/li>\n<li><code>type<\/code> &#8211; The type of alternate ID. One of:\n<ul>\n<li>email<\/li>\n<li>More coming soon.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li><code>UserSession<\/code> &#8211; Key\/value pairs that you can define\u00a0for this specific user for all bots in an enterprise<\/li>\n<li><code>BotUserSession<\/code> &#8211; Key\/value pairs that you can define\u00a0to a specific bot based on the inputs by a specific user.<\/li>\n<li><code>opts<\/code> &#8211; Coming soon with examples.\n<ul>\n<li><code>userId<\/code> &#8211;<\/li>\n<li><code>streamId<\/code> &#8211;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li><code>message_tone<\/code> &#8211; Coming soon with examples. An array of recognized\u00a0tone emotions and scores for the current node in a dialog task.\n<ul>\n<li><code>tone_name<\/code> &#8211; The name of the tone detected. One of:\n<ul>\n<li><code>angry<\/code><\/li>\n<li><code>disgust<\/code><\/li>\n<li><code>fear<\/code><\/li>\n<li><code>sad<\/code><\/li>\n<li><code>joy<\/code><\/li>\n<li><code>positive<\/code>\u00a0\u2013 A special tone used to\u00a0evaluate the general positivity of an utterance.<\/li>\n<\/ul>\n<\/li>\n<li><code>count<\/code> &#8211; Coming soon with examples.<\/li>\n<li><code>level<\/code> &#8211; The level of the tone emotion ranging from -3 to +3. One of:\n<ul>\n<li><strong>+3<\/strong> \u2013 The user definitely expressed the tone emotion.<\/li>\n<li><strong>+2<\/strong> \u2013 The user expressed the tone emotion.<\/li>\n<li><strong>+1<\/strong> \u2013 The user likely expressed the tone emotion.<\/li>\n<li><strong>0<\/strong> \u2013\u00a0The user tone emotion is neutral.<\/li>\n<li><strong>-1<\/strong> \u2013 The user likely suppressed the tone emotion.<\/li>\n<li><strong>-2<\/strong> \u2013 The user suppressed the tone emotion.<\/li>\n<li><strong>-3<\/strong> \u2013 \u00a0The user definitely suppressed the tone emotion.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li><code>dialog_tone<\/code> &#8211;\u00a0An array of average recognized\u00a0tone emotions and scores for the entire\u00a0dialog task session.\n<ul>\n<li><code>tone_name<\/code> &#8211; The name of the tone detected. One of:\n<ul>\n<li><code>angry<\/code><\/li>\n<li><code>disgust<\/code><\/li>\n<li><code>fear<\/code><\/li>\n<li><code>sad<\/code><\/li>\n<li><code>joy<\/code><\/li>\n<li><code>positive<\/code>\u00a0\u2013 A special tone used to\u00a0evaluate the general positivity of an utterance.<\/li>\n<\/ul>\n<\/li>\n<li><code>count<\/code> &#8211; Coming soon with examples.<\/li>\n<li><code>level<\/code> &#8211; The level of the tone emotion ranging from -3 to +3. One of:\n<ul>\n<li><strong>+3<\/strong> \u2013 The user definitely expressed the tone emotion.<\/li>\n<li><strong>+2<\/strong> \u2013 The user expressed the tone emotion.<\/li>\n<li><strong>+1<\/strong> \u2013 The user likely expressed the tone emotion.<\/li>\n<li><strong>0<\/strong> \u2013\u00a0The user tone emotion is neutral.<\/li>\n<li><strong>-1<\/strong> \u2013 The user likely suppressed the tone emotion.<\/li>\n<li><strong>-2<\/strong> \u2013 The user suppressed the tone emotion.<\/li>\n<li><strong>-3<\/strong> \u2013 \u00a0The user definitely suppressed the tone emotion.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div><\/div><\/div><\/div><\/div><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"The Context object is the container object that persists data for dialog execution and across all intents i.e.\u00a0dialog tasks, action, alert &amp; info tasks, and FAQs. The Kore.ai's natural language processing (NLP) engine populates the intent identified, entities extracted, and history into this object. Keys from the Context object can be used in the dialog...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-21411","post","type-post","status-publish","format-standard","hentry","category-dialog-task"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v7-2\/wp-json\/wp\/v2\/posts\/21411","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v7-2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v7-2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-2\/wp-json\/wp\/v2\/comments?post=21411"}],"version-history":[{"count":7,"href":"https:\/\/developer.kore.ai\/v7-2\/wp-json\/wp\/v2\/posts\/21411\/revisions"}],"predecessor-version":[{"id":23795,"href":"https:\/\/developer.kore.ai\/v7-2\/wp-json\/wp\/v2\/posts\/21411\/revisions\/23795"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v7-2\/wp-json\/wp\/v2\/media?parent=21411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-2\/wp-json\/wp\/v2\/categories?post=21411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v7-2\/wp-json\/wp\/v2\/tags?post=21411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}