This feature will allow you to integrate eddi with a backend server to monitor the messages with a 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 enable and configure callbacks in a chatbot you will have to add this into one of the packages used by the chatbot:
{
"type": "eddi://ai.labs.callback",
"config": {
"callbackUri": "String",
"action": "String",
"callOnActions": "String",
"timeoutInMillis": Long
}
}
Here is the model for conversationMemorySnapshot
:
{
"conversationMemorySnapshot": {
"id": "String",
"botId": "String",
"botVersion": Integer,
"environment": "String",
"conversationState": "String",
"conversationSteps": [array of conversationSteps],
"redoCache": []
}
}
Note Callbacks does not have a store like the other extensions e.g :
httpCalls
,behaviorSet
,regularDictionaries
,etc..
We will do a step by step example from scratch (chatbot creation to a simple conversation that uses a callback)
For the sake of simplicity we will use a simple nodejs http server to intercept the callback and get the conversation snapshot.
More about regular dictionaries can be found here.
Creating the regular dictionary Expand source
Request URL
POST
http://localhost:7070/regulardictionarystore/regulardictionaries
Request Body