just-ai / jaicf-kotlin

Kotlin framework for conversational voice assistants and chatbots development
https://help.jaicf.com
Apache License 2.0
239 stars 39 forks source link

Filling slots from client context #40

Open Denire opened 4 years ago

Denire commented 4 years ago

This issue suggest a feature of filling slots from client context.

Let's say that we have an Intent, which has required slots like name and phoneNumber. These slots are required and must be filled to proceed dialog, otherwise bot won't be able to perform some action.

Once client answered to it, we can store it in client context, further eliminating need to ask it again. But right now this information will be stored only in our bot context, activator will have no knowledge of it and won't have any use of it. So, when user will fall into this same intent, he should be asked to fill name and phoneNumber again (this behaviour may vary from activator to activator, but still). And this makes slot filling unusable for these kind of common scenarios.

As I think, resolving this issue must bring some interfaces/methods for framework users to pre-fill some slots (either via client context, or directly form ActionContext). Or just find way to re-use slots.

morfeusys commented 4 years ago

@Denire right now fillSlots method already receives a botContext as an argument. This makes it possible to decide if an activator should start a slot filling procedure or fetch all required data from the user's context. Isn't it?

Denire commented 4 years ago

@morfeusys I'm not sure that fetching from botContext by default is the best option. As I imagine, we should provide some interface for client to connect value from botContext (client context?) to slot, just like we do it with SlotReactor.