I am building a mobile app to fill out a form. Basically, the app consists of many screens and every screen has the capability of being filled out by voice using API.AI SDK. So since all the screens may have similar attributes/fields types such as salary, amount, names, YES/NO questions, monthly expenses, rent amount, the API response is very inaccurate; it sometimes mixes an intent that is supposed to be for a different screen -It mixes the intents.
Can I set/configure a request by screen with the target intent? Example:
FINANCIAL INTENT - FINANCIAL SCREEN
1000 - Salary (API.AI is expecting only the value)
200 - Extra Incomes (API.AI is expecting only the value)
EXPENSES INTENT - EXPENSES INTENT
200 - Rent (API.AI is expecting only the value)
400 - Bills (API.AI is expecting only the value)
So, from my code can I set the target intent like financial intent or something like that so the agent does not get confused due to similar data types?
A solution would be to use contexts.
API.AI contexts allows you to specify in which case (context) an Intent can be triggered.
With a form such as:
What is your name ?
What is your salary ?
What are your expenses ?
You can guide your user by setting for every Intent a context in and a context out:
This way, you ensure that the Name Intent won't be triggered until there is the askedname
context, that the Salary Intent won't be triggered until there is the askedsalary
context, etc.
You can find more explanations here: https://api.ai/docs/dialogs#non-linear_dialogs