1

I'm creating a mock finance app in API.ai, and I need to get from the user which account they'd like. I have a default welcome intent as an entry, and a followup intent that collects what account they'd like (current, savings, etc).

How do I use the user response of "current" or "savings" parameters to choose the next intent?

Abhishek kumar
  • 4,347
  • 8
  • 29
  • 44
doggoz
  • 61
  • 5

1 Answers1

0

In API.AI you typically don't "choose" the next intent. API.AI recognizes the user's intent using a machine model that is trained using the examples you give for each intent.

For your example I'd recommend using API.AI's contexts to signal to API.AI what intents should be you'd like to be matched after the user specifies their account type. You can set an outgoing context for the intent which asks for the user's account type. After this outgoing context is set the next match will strongly prefer intent that have a input context of the same value. this will behavior will continue for the lifetime of the intent (more info on intent lifetime here)

If you haven't already, you may want to setup a fulfillment webhook to validate that the user has said "savings" or "current" and hasn't matched this intent and then triggered another intent. You can also set contexts in webhooks.

mattcarrollcode
  • 3,429
  • 16
  • 16