Recursion in Rasa Flows, Compatible LLM Models, and Fine-Tuning Datasets - Rasa Pro CALM - Rasa CALM - Rasa Community Forum
👋 Introducing the Rasa Playground
Recursion in Rasa Flows, Compatible LLM Models, and Fine-Tuning Datasets - Rasa Pro CALM
post by sk1382 on Sep 9, 2024
- How do we create a recursion or a loop in a flow? Because I have tried with giving
nextto same stepidand it uttered the same response for 5 times. Then I addedask_before_filling: trueto make it utter one time and ask again. But the problem is what if a user already gives the required information and the bot asks again no matter what the slot is filled with due toask_before_filling: trueline undercollect. - What are the other minimal viable LLM models that are fine tuned and compatible with Rasa? I have only found one from a Forum: dakshvar22_-_cmd_gen_codellama_13b_calm_demo-gguf.
- Also where and how can I find the data or datasets for the purpose of fine-tuning the other models?
@jtrasa Could you answer these doubts?
Thanks in advance.
post by stephens on Sep 19, 2024
There’s a new fine-tuning recipe with 3.10.
Can you explain the use case where you need recursion?
post by sk1382 on Sep 19, 2024
Thanks for the fine-tuning document link, I will look into it. The use case where I want to use recursion could be in this way:
- collect: preferred_city
description: Collects the specific city that the caller is interested in.
id: city_preference
ask_before_filling: true
next:
- if: slots.preferred_city = "bangalore"
then:
- action: utter_bangalore_colleges
next: name
- if: slots.preferred_city = "hyderabad"
then:
- action: utter_hyderabad_colleges
next: name
- if: slots.preferred_city = "mumbai" or slots.preferred_city = "bombay"
then:
- action: utter_mumbai_colleges
next: name
- else:
- action: utter_sorry
next: city_preference
But as a custom action, I am also collecting information on whether the user gives the city name before the specified step, and this step is asking no matter what user gives due to ask_before_filling: true which I am actually using to avoid recurring the same utterance such as:
utter_sorry:
- text: "Sorry! currently we are not available in that city. But you can choose a nearest city from these: Bangalore or Hyderabad or Mumbai."
If not, the utter_sorry will be uttered 5 times.
Also, if the LLMs that are already fine-tuned for compatibility with Rasa are provided, it would be a great help to the community.
Thanks in advance.
post by stephens on Sep 24, 2024
One option is to change preferred_city to a categorical slot, and then it will only accept a list of cities that you choose. Another option is that the else can erase the slot.
It’s not directly related to your question, but I would remove all of the if tests and use Conditional Response Variations instead.
post by sk1382 on Sep 25, 2024
I have used the set_slots in the else step to erase the slot, removed the ask_before_filling: true and now it is working good as expected without uttering the response 5 times.
Thanks for the hint provided @stephens.
I would like to provide a suggestion regarding Conditional Response Variations. Currently, it appears that conditions in response variances work only when the slot type is set to bool. While this is useful, it would greatly enhance flexibility and functionality if conditions could also work with categorical slot types, allowing any text value to be used as the condition instead of being limited to true or false.
This addition would enable more nuanced and varied responses based on the values of categorical slots, providing a richer user experience.
Thank you for considering this suggestion. I look forward to any updates on this feature.
post by stephens on Sep 25, 2024
You can use CRV’s with other slot types too. Here’s a blog post showing a categorical.
post by sk1382 on Sep 30, 2024
Hey @stephens, I wanted to let you know that I had actually tried the solution you suggested before, but it didn’t seem to work at the time. However, I gave it another shot after your recommendation, and now it’s working perfectly! I really appreciate your help and persistence—thanks again!