Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow follow-up questions to a skill #8

Closed
manthanhd opened this issue Oct 23, 2016 · 4 comments
Closed

Allow follow-up questions to a skill #8

manthanhd opened this issue Oct 23, 2016 · 4 comments

Comments

@manthanhd
Copy link
Owner

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.

@manthanhd
Copy link
Owner Author

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.

@manthanhd manthanhd self-assigned this Nov 6, 2016
@manthanhd manthanhd mentioned this issue Nov 6, 2016
@manthanhd
Copy link
Owner Author

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

@manthanhd
Copy link
Owner Author

manthanhd commented Nov 6, 2016

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.

@manthanhd
Copy link
Owner Author

manthanhd commented Nov 7, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

1 participant