8

I have a query of the following nature in API.ai "btc, ltc, xrp to usd, inr" How can I extract the query as source = [btc, ltc, xrp] destination = [usd, inr]

The number of elements in the source can be variable and the number of elements in the destination can also be variable. I am aware of the list entity and I tried it with the query. It picks up only btc in one list and puts the rest in another rest. Any suggestions

PirateApp
  • 5,433
  • 4
  • 57
  • 90

1 Answers1

4

You can create 2 intents ,

  1. SingleInput: a. Create a "btc, ltc, xrp" as utterance b. Add a Parameter $First as "SingleArray" with @sys.any

  2. MultipeInput: a. Create a "btc, ltc, xrp" to "usr ind" as utterance b. Add a Parameter $First as "SingleArray" with @sys.any b. Add a Parameter $Second as "MultipleArray" with @sys.any

Now when you issue the utterance with btn,ltc, you will get an output.

Your Single Input: "btc, ltc, xrp" output has parameter $First = [btc ltc xrp]

Your Multiple Input "btc, ltc, xrp to usr ind" output has parameter $First = [btc ltc xrp] and $Second = [usr ind]

tx fun
  • 569
  • 5
  • 19