manthanhd / talkify

Talkify is an open source framework with an aim to standardize and model conversational AI enabling development of personal assistants and chat bots. The mission of this framework is to make developing chat bots and personal assistants as easy as spinning up a simple website in html.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow follow-up questions to a skill

manthanhd opened this issue · comments

Special flag in context to be set followUp mapped to a skill name.

This also means that each skill needs a unique name before it can be added to the bot.

How might this work with persisted context? In real world, context will be persisted somewhere in a redis database. This means that as of now, the mapping will have to be relied upon the skill name.

Also, when a followUp flag is set, should the response automatically be marked final or can multiple skills mark their own followUps? How will this scale to multiple responses?

Potentially, upon a multiple response to multiple followups, the bot could split the response into a stack and then pass the response one by one to each of the followup skills who can then decide what to take off of the stack.

Mapping is relied upon the skill name.
Response is automatically marked as final.

How can a skill release a follow-up? Think about the following conversation:

YOU:[1]> I'd like to make a payment
BOT:[2]> Sure! What's your payment method? <----------- Lock acquired
YOU:[3]> You know what, nevermind.
BOT:[4]> No problem                <----------- Lock naturally released

Here the natural locking works quite well. However, it does not for the following:

YOU:[1]> I'd like to make a payment
BOT:[2]> Sure! What's your payment method? <----------- Lock acquired
YOU:[3]> Actually, what's my balance?
BOT:[4]> It is £350.00. <----------- Lock manually released, sentence gets re-evaluated.

In case 2, the skill will have to set a custom message to the response.message object and finish the execution like so:

response.message = new Message('ReevalRequested', 'Cannot process this message. Irrelavent to the skill.');
return response.final();

The code handling the bot, with the final callback to the resolve method could interpret the message and call the bot back for re-evaluation.

ezoic increase your site revenue