This feature will allow you to integrate eddi with a backend server to monitor the messages with a chatbot, you can alter the response and send it back to the chatbot..
The callback can be invoked by multiple actions that you define in the package , you will receive in the post body a conversationMemorySnapshot
which is the model that has all information about the current conversation that invoked this callback, we will go through a step by step example to show you how callbacks work.
In order to enbale and configure callbacks in abot you will have to add this into one of the packages used by the chatbot:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
{
"type": "eddi://ai.labs.callback",
"config": {
"callbackUri": "String",
"action": "String",
"callOnActions":"String",
"timeoutInMillis": Long
}
} |
Description :
type | Must be eddi://ai.labs.callback to activate a callback. |
---|---|
config.callbackUri | (String) this is the URI that will be invoked; a POST request will be sent to that URI alongside |
config.action | (String) if you have one action that will invoke the callback use this property. |
config.callOnActions | (String) if you have multiple actions that will invoke the callback use this property, it should coma separated values. e.g("action1,action2,..."). |
config.timeoutInMillis | (Long) a duration of time in millisecond before timeout occurs. |
Here is the model for conversationMemorySnapshot :
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
"conversationMemorySnapshot": {
"id": "String",
"botId": "String",
"botVersion": Integer,
"environment": "String",
"conversationState": "String",
"conversationSteps": [array of conversationSteps],
"redoCache": []
} |
Description :
id | (String) id of the conversation |
---|---|
botId | (String) id of the bot |
botVersion | (String) version of the chatbot |
environment | (String) bot environment e.g: restricted, unrestricted |
conversationState | (String) enumeration values : READY, |
conversationSteps | (Array of conversationStep) History of the conversation |