IVR - Is it possible to gather multiple inputs from 1 question and then do a nested split based off those inputs?

22 Views Asked by At

Doing a dining IVR booking system on Twilio.

Currently asking the question to the user:

"Are you bringing any guests and if so how many?

I know I can get there if I do 2 individual questions using the SpeechResult on the split:

"Are you bringing any guests?"

Split - "Yes" or "No"

"How many guests are you bringing?"

Split - "1", "2", "3", "4" or "5".

But I want to find out is it possible to do this as a singular question with the likes of a nested split? I.E

1st Split - "Yes" or "No"

2nd Split - "1", "2", "3", "4" or "5".

1

There are 1 best solutions below

0
Marc Brooks On

Answer I found how to do this is as so:

Set the split to contains following by the answer selection you want. Its a bit crude but its the way I found that works.

In my case I put my split for the following conditions:

Contains Yes 1, Contains Yes 2, Contains Yes 3, Contains Yes 4, Contains Yes 5, Contains No.

And in the fetch statement I have the following prompt which is sent to OpenAI.

You will be provided with message containing both a yes or no answer and a number, you have two tasks: Your first task is to distinguish if the answer is: "Yes" or "No". Your second task is to distinguish if the number is: "1", "2", "3", "4" or "5". This number must be in numerical format. Finally you must only repeat both answers together as: "Yes 1", "Yes 2", "Yes 3", "Yes 4", "Yes 5" or "No".

This worked so far, however I do get some occasional bugs from ChatGPT so I have to continue refining the prompt but it delivers the point across.

But in short this allows me to grab multiple inputs from the same message.