π οΈ Managing Long User Messages with Advanced Builder
Sometimes users send lengthy messages that the chatbot's NLP may struggle to process. In this case, we'll configure the bot to notify the user that the message is too lengthy and prompt them to simplify their request. Follow this guide to set up a use case for handling long messages.
Step 1: Add a New Use Case π
- In your chatbot, navigate to Build β Use Cases.
- Create a new Use Case named "Long Messages".
Step 2: Configure the Bot Response π¬
- Open the bot action.
- Edit the response to let users know the message is too long and ask them to simplify it. Feel free to customize this response.
- Save your changes.
- Set your Use Case Online.
Step 3: Configure the Trigger π
Since the NLP struggles with long messages, weβll set up a filter based on message length instead of using an AI-based intent.
- Go to Use Case β Start Intent.
- Delete the intent since we donβt need it.
πΈ
-
In the sidebar, go to Build β Filters.
-
Create a Filter and use a regular expression to match messages longer than 300 characters.
^.[\s\S]{300,}
-
Link this filter to the "Long Messages" bot action and Save.
Step 4: Test it! π§ͺ
Use a test message over 300 characters to verify the filter triggers the "Long Messages" response.
Going Further π
- How do I know if a filter was triggered?
- In the Inspector: Look for "No intent" under the Details tab or "Filter triggered" under the Checklist tab.
- In the Trace: The Summary will show "No fired intent found," and the Raw tab under "Bom interface" will list any matched filters.
-
Managing Multiple Filters
- Filters execute in order from top to bottom. If one isnβt matched, the next filter is evaluated until one matches or the NLP model takes over.
-
Quick Replies Triggering the Filter?
- Filters apply to every user message, including quick replies. Make sure quick reply titles donβt match any filters, or the intended action wonβt trigger.