1

So i'm creating a chatbot, where users can ask faq's and place orders for items for loans. One bit i'm struggling with is how to pair paramaters and values when a user makes an order for multiple things in one sentence.

So for example:

User wants to order 5 items with varying quanititys:

"I'd like to order 3 phones, 2 cases, 3 power cables, 1 screen protector, and 1 bluetooth speaker".

I'd like it to do this and associate the quantity with the item. so something like:

3 - Phones
2 - Cases
3 - Power cables
1 - Screen protector
1 - Bluetooth speaker

Thanks!

Elrin
  • 13
  • 4

1 Answers1

0

One way to pair the amount and a product together would be by using composite entities. https://cloud.google.com/dialogflow/docs/entities-developer#developer_composite

Composite entities allow you to pair to values together in a single entity. So in your case you could have a composite entity named order, which contains an amount (Number) entity and a product entity.

By giving the appropriate sample utterances, you can train your agent to recognize this order entity and by checking the "Is List" option in the parameters you should be able to get multiple orders and have their product with the paired amount in a single entity.

Hope that this helps.

Jordi
  • 3,041
  • 5
  • 17
  • 36