sdk - API.AI - Is it possible to set the target intent before sending API.AI request? -
i building mobile app fill out form. basically, app consists of many screens , every screen has capability of being filled out voice using api.ai sdk. since screens may have similar attributes/fields types such salary, amount, names, yes/no questions, monthly expenses, rent amount, api response inaccurate; mixes intent supposed different screen -it mixes intents.
so question is.. can set/configure request screen target intent? example:
financial intent - financial screen 1000 - salary (api.ai expecting value) 200 - incomes (api.ai expecting value)
expenses intent - expenses intent 200 - rent (api.ai expecting value) 400 - bills (api.ai expecting value)
so, code can set target intent financial intent or agent not confused due similar data types?
thanks time , willingness guys.
a solution use contexts.
api.ai contexts allows specify in case (context) intent can triggered.
with form such as:
what name ?
what salary ?
what expenses ?
you can guide user setting every intent context in , context out:
- name intent:
- context in: askedname
- context out: askedsalary
- salary intent:
- context in: askedsalary
- context out: askedexpenses
- expenses intent:
- context in: askedexpenses
- context out: ...
this way, ensure name intent won't triggered until there askedname
context, salary intent won't triggered until there askedsalary
context, etc.
you can find more explanations here: https://api.ai/docs/dialogs#non-linear_dialogs
Comments
Post a Comment