Which is the best approach for large FAQ #846
Unanswered
valeValentini
asked this question in
Q&A
Replies: 1 comment 5 replies
-
Hi,
With this approach only one of the handling flows will match and advance while all the others keep waiting for their corresponding events. Also note, that with smarted models like GTP4 you can use docstring like descriptions to define user intent flows to reduce the number of needed examples:
|
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone!
I'm developing a chatbot using Colang 2 for a project involving around 300 FAQ entries. I’d like to know the best practice for structuring a chatbot with a large number of predefined flows.
Is a conditional approach (using if/elif statements) the most efficient solution, or is there a more optimal way to handle many intents without introducing latency?
Initially, I structured the main flow using multiple or when statements to detect intents, with each intent having up to three sample expressions. The code was similar to the following:
where the user flows are:
And the bot flows are
When the number of intents is >40, this approach started introducing significant latency (up to 10 seconds). The delay is not in the bot's response itself, but in closing the unhandled events of each flow and allowing new user input. It seems that activating multiple or when statements concurrently causes a slowdown as i aspected.
So to address this, I considered switching to a conditional branching structure, where each intent is routed using if/elif statements within the while loop, rather than activating multiple flows simultaneously. But i can't find a way to get the user intent in a string to than pass it to the condition check.
So :( I can’t seem to correctly extract the intent from generating user intent for unhandled user utterance.
From debugging, I could see that the value is saved in the GenerateUserIntentActionFinished event’s return_value property, but I’m unable to retrieve and use it within the conditional branching.
Is this if/elif approach the correct one, or are there alternative methods for structuring this?
Can anyone advise on how to extract the intent effectively?
Thank you so much!!
Beta Was this translation helpful? Give feedback.
All reactions