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:> I'd like to make a payment BOT:> Sure! What's your payment method? <----------- Lock acquired YOU:> You know what, nevermind. BOT:> No problem <----------- Lock naturally released
Here the natural locking works quite well. However, it does not for the following:
YOU:> I'd like to make a payment BOT:> Sure! What's your payment method? <----------- Lock acquired YOU:> Actually, what's my balance? BOT:> 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.