IBM/watson-assistant-slots-intro

Handling multiple values of context variables

Closed this issue · 4 comments

Hello Everyone,

I am developing a pizza ordering chatbot. I have a context variable: 'pizza_type' which takes the value of type of pizza the user wants to order. It works fine if the user only orders 1 type of pizza. If the user works 2 or more pizzas, the chatbot only considers 1st pizza type and ignores rest of the entries. How do I solve this problem?

No definite answer for you, but it would probably take some changes to the context passed between the app and Assistant, and also to the Assistant dialog to ask user if they want to order multiple pizzas. The context could manage which pizza (in the array of pizzas) is currently being ordered.
Please share your solution if you decide to pursue this.

Thank you @rhagarty . Is there a method to run something like a "for loop" in assitant dialog? For example if user order salami pizza with cheese topping and vegetarian pizza with olives topping. Then currently, chatbot responds that user has ordered ONLY salami pizza with cheese and olive toppings. I cannot find a way to assign correct toppings to correct pizza and store the data for further usage.

@kraken24 There is a "jump to" option when creating your Assistant dialog nodes. You could build a loop around ordering a single pizza. Then ask "Would you like to order another pizza?", and jump back to the top node and do it again.

@rhagarty it worked. Thank you. I will try to improve the dialog flow structure more