How to set multiple slots in custom action

@cyrilthank we don’t have a partnership as far as i’m aware. I’ll get back to you on the github issue about this

can u give an example?

return [SlotSet("slot1", "value"), SlotSet("slot2","value2")]

7 Likes

Does this works? Because this doesn’t work for me. I am using Rasa 3.1

    def _respond_with_availability(self, dispatcher, availability):
        start_time = None
        if availability:
            message = "Here are the available time slots:\n"
            for slot in availability:
                specialty = slot.specialty.SpecialtyName
                start_time = slot.Start_Time
                print([specialty,start_time])
                End_time = slot.End_time
                message += f"- {start_time.strftime('%H:%M')} to {End_time.strftime('%H:%M')} \n"
                message += f"Do you want to book an appointment for this time slot?"
                dispatcher.utter_message(text=message)
                return [SlotSet("specialty",specialty),SlotSet("start_time",start_time)]
        else:
            message = "No availability found.Do you want to book an appointment for another day?"
            dispatcher.utter_message(text=message)
            return[SlotSet("day", None),FollowupAction(name ='doctor_avaialability_form')]

This is my code. But it won’t do it. But if there is only one slot then it will work