Slots not cleared after starting convo again

Hello, I’m building a chatbot to check whether a user has access to a set of projects and databases.

The bot will ask for 2 slots for the form if the message doesn’t include those already reporting_type (project or database) id (of project / database)

After the form has been filled and actions have performed, it’ll ask if you need more help If yes, then it’ll restart the process asking for what project / database you need to check access to

I’m running into an issue where the slots are not cleared after you restart the conversation. When you talk to the bot the 2nd time, it won’t ask for the reporting_type and id even if you don’t provide them anymore because they are still “filled” from the previous conversation

Here’s my domain.yml

version: "2.0"

  - greet
  - affirm
  - deny
  - goodbye
  - out_of_scope
  - nlu_fallback

  - check_access
  - inform

  - reporting_type
  - id

    type: categorical
    influence_conversation: false
    - project
    - database
    type: any
    influence_conversation: false
    type: any
    influence_conversation: false

  # Defaults
  - text: Hey!
  - text: Hi there!
  - text: Hello?
  - text: Hi!

  - text: Bye now
  - text: C u later alligator :)
  - text: Bye and have a great day!

  - text: I don't think I understand. Can you try providing more detail or rephrasing it?
  - text: Um, can you rephrase that again for me?
  - text: Beep, boop, don't understand. Please rephrase

  - text: I'm sorry, I didn't quite understand that. Could you rephrase?
  - text: Can you rephrase what you just said please?

  - buttons:
    - payload: /check_access
      title: Check my access
    - payload: To be added
      title: To be added
    text: "You can ask me things like:\
      \ \n- Do I have access to project <id>?\
      \ \n- Please check my access\
      \ \nOr select from the options below:"

  - text: Sure let me help you with that!
  - text: Yes I can help you with that!

  - text: Give me a min, let me check...
  - text: Just a moment...
  - text: Yeah give me a min and I'll check that...

  - text: Did that help you?
  - text: Did that help?
  - text: Was that helpful?
  - text: Hope that was helpful to you?
  - text: Was that what you needed help with?

  - buttons:
    - payload: /inform{{"reporting_type":"project"}}
      title: Project
    - payload: /inform{{"reporting_type":"database"}}
      title: Database
    text: And I am looking at your access to which one here?

  - text: What's the {reporting_type}'s id?

      - entity: reporting_type
        type: from_entity
      - entity: id
        type: from_entity

  session_expiration_time: 60
  carry_over_slots_to_new_session: true


version: "2.0"

  # Defaults
- intent: greet
  examples: |
    - hey
    - hello
    - hi
    - hello there
    - moin
    - hey there
    - let's go
    - hey dude
    - yo bud
    - yo
    - sup
    - how are you
    - how's it going

- intent: affirm
  examples: |
    - yes
    - y
    - indeed
    - of course
    - that sounds good
    - correct
    - exactly
    - yep
    - ya

- intent: deny
  examples: |
    - no
    - n
    - never
    - I don't think so
    - don't like that
    - no way
    - not really
    - nope
    - wrong

- intent: goodbye
  examples: |
    - cu
    - good by
    - cee you later
    - good night
    - bye
    - goodbye
    - have a nice day
    - see you around
    - bye bye
    - see you later

- intent: out_of_scope
  examples: |
    - mmm I can't see what you're saying
    - I am looking forward to my best friend's wedding. Do you have any tuxedo's?
    - hmmmm
    - Can I?
    - Well, okay then
    - what is the square root of 5
    - I want to know the weather
    - what is the meaning of life.
    - Fridge Isn't Running
    - my tv isn't working
    - I want a pizza
    - my washing machine isn't working
    - what year is it
    - order a pizza
    - I want to order a pizza
    - what is the weather today
    - what is the weather
    - why is the sky blue
    - blah blah blah

# Ziplabs
- intent: check_access
  examples: |
    - Check my access
    - I need to open this [project](reporting_type) [123](id)
    - Do I have access to this [db]{"entity":"reporting_type","value":"database"} [5](id)?
    - Can I open this [project](reporting_type) [91](id)?
    - Do I have permission to open [db]{"entity":"reporting_type","value":"database"}?
    - access to this [project](reporting_type)?
    - I can't open [project](reporting_type) [55673](id)
    - I cannot access this [database]{"entity":"reporting_type","value":"database"}
    - What is my access?
    - Access
    - Can you give permission to open this [db]{"entity":"reporting_type","value":"database"} [4914](id)?
    - Please grant me access to [project](reporting_type)
    - Why can't I open [db]{"entity":"reporting_type","value":"database"}?
    - I need help accessing this [project](reporting_type)

- intent: inform
  examples: |
    - it's [91234](id)
    - 12331
    - it's 123
    - wait actually that is wrong. it should be 564

- synonym: database
  examples: |
    - database
    - db


version: "2.0"


- rule: intro
  - intent: greet
  - action: utter_greet
  - action: utter_help

- rule: respond to chitchat goodbye
  - intent: goodbye
  - action: utter_goodbye

- rule: out of scope
  - or:
    - intent: nlu_fallback
    - intent: out_of_scope
  - action: utter_default


version: "2.0"

- story: Want to check access
  - intent: check_access
  - active_loop: action_deactivate_loop
  - active_loop: null
  - action: utter_start_help
  - action: check_access_form
  - active_loop: check_access_form
  - active_loop: null
  - action: utter_check_access
  # Custom action to check access here
  - action: utter_did_that_help
- story: Did that help Yes
  - action: utter_did_that_help
  - intent: affirm
  - action: utter_goodbye

- story: Did that help No
  - action: utter_did_that_help
  - intent: deny
  - action: utter_help

Welcome to the community :slight_smile:

Set this to false

So that only affects whether slots are carried over to a new session or not after the session timed out.

In my case, if you answer “Yes” when asked “Do you still need help”, then you’ll start the conversation again. From some Rasa demos, that flag is still set to true but slots are cleared as expected.

Ah that’s what you mean by restart.

Is this the story you’re talking about?

You can change it to:

- story: Did that help No
  - action: utter_did_that_help
  - intent: deny
  - action: action_help

In action_help, you can return [AllSlotsReset()] to reset all the slots, or return [SlotSet('slot1', None), SlotSet('slot2', None), ...] to reset some slots.

Ah got it thanks!

1 Like