Run a dialog task after answering a question

How can we run a dialog task after answering a question in the knowledge collection.

For example , I need a feedback from an user if he is happy with the solution or answer after answering any question. I have a task for it.
But in the knowledge collection the response to a question can either be message or a running a task.
I want this dialog task to run after answering every question. How to do that/

@sharvari4810c : Please enable botkit and subscribe to event “onEvent”.
This subscription would notify the botkit of the following events:

endDialog : when the dialog execution is completed/ reached end of dialog
endFaq: when the FAQ response is delivered to the user.

When the endFAQ is reached at botkit, check the message object for the identified FAQ and then frame the logic to send the bot a message which would invoke the dialog task as needed.

Please refer to the below topic for more details:

Also, you should be able to link the FAQ directly to a dialog and this feature should help you achieve your requirement without having had to enable the bot kit.

Please refer to the below link at section ‘Run a Task’
https://developer.kore.ai/docs/bots/bot-builder-tool/knowledge-task/creating-a-knowledge-graph/

I am not understanding where exactly do I have to use snippet. The logic to trigger the dialog for eventTypes can be at the bot kit. So by Bot Kit do you mean WEB kore.ai SDK or you mean at kore.ai Bot builder?
If in WEB kore.ai SDK , then in which file do I have to make changes ?

@sharvari4810c Below is the link to access the Botkit SDK from github.

Hello,

BotBuilder - The UI interface of our platform developers use to “design” bots.

WebSDK - A “web-client” used to “integrate” a published chat-bot on a third party web page (UI) [Should not be new to you]. A sample index.html is provided in our web-sdk code. Users are expected to extend it to implement their use case in whichever way business needs them to.

Bot-Kit - This is an extension to bot’s functionality. A server side listener which (when used and activated) listens to and taps all communication by users and from bot and vice versa. Typical use cases like Agent Transfers, Suppressing unacceptable words/ phrases etc. and many other use cases can be achieved by bot-kit. For agent transfers, bot-kit mediates between end user (chat bot UI - webSDK), Kore platform and third party agent transfer interface like ServiceNow/ LivePerson etc.

Now coming back to the query. Had your query been invoking a task when a knowledge question was invoked, it would have been to simply use bot-builder to configure the knowledge question to invoke a task instead of providing a pre-cooked answer.
But your use case is to invoke a task “after” a ‘responding’ to a KG. That can only be done when you tap into the bot and user messages from bot-kit.

You will however need to enable bot-kit at the bot level as shown below.

How you handle the events will be part of bot-kit code.

You will need to integrate the bot with the BotKit SDK to achieve the requirement.

The Kore.ai BotKit SDK is a set of libraries that provide you with precision control for bot interaction with users for the bots you build on Kore.ai Bots Platform.
Please refer the following link to understand more about the BotKit SDK:
https://developer.kore.ai/docs/bots/sdks/using-the-botkit-sdk/