I am creating a chatbot which could get you the multiple details and one is order details. It has the attributes of order number, name and id. Any one of the attributes can be used to get the order details. I have to add a form action to get the attributes/slots to get the details. Since the user can ask in general like,
User: Can you get me the order details
Bot: Yes. Please provide the name/number/id to get you the details.
The problem is,
If I try to create different intent, the context of the intent will be same, it will be difficult to classify. Eg
intent:searchby_number:
get me details of [08141801] - (order_number)
intent: searchby_name:
get me details of [cerner] - (order_name)
I can combine this into single intent with different entities.
eg:
intent:search_order:
Can you get me the order details
get me details of [08141801] - (order_number)
get me details of [cerner] - (order_name)
order details of [mascjx00c] - (order_id)
But how can I add the form for this because any one of the slot is enough to get the details. Can we have optional slots in a form or is there any better way to achieve this?
I think it would be better to keep them under a single intent. Also I think you should rename your entities as well (if possible) and make them a single entity. Optionally, you can use entity groups. For example like this:
## intent: search_order
- Can you get me the order details
- get me details of [08141801](search_parameter)
- get me details of [cerner](search_parameter)
- order details of [mascjx00c](search_parameter)
Now you can trigger the form action if no entity is extracted otherwise do whatever you want with it.
Thanks @saurabh-m523. This might work for a case where the api will accept any parameter.
The problem for me is that I have to know the type of attribute / parameter whether it’s an id or name or number to pass it in the api. It’s difficult to differentiate if I have same entity.