Skip to content

Instantly share code, notes, and snippets.

@thoraxe
Created August 4, 2023 16:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thoraxe/af8df03c025f24a93fa5399cf6934ac6 to your computer and use it in GitHub Desktop.
Save thoraxe/af8df03c025f24a93fa5399cf6934ac6 to your computer and use it in GitHub Desktop.
version: "3.1"
intents:
- greet
- goodbye
- affirm
- deny
- mood_great
- mood_unhappy
- bot_challenge
- turtle_name
slots:
turtle_name:
type: text
mappings:
- type: from_text
conditions:
- active_loop: turtle_form
requested_slot: turtle_name
responses:
utter_greet:
- text: "Hey! How are you?"
utter_cheer_up:
- text: "Here is something to cheer you up:"
image: "https://i.imgur.com/nGF1K8f.jpg"
utter_did_that_help:
- text: "Did that help you?"
utter_happy:
- text: "Great, carry on!"
utter_goodbye:
- text: "Bye"
utter_iamabot:
- text: "I am a bot, powered by Rasa."
utter_ask_turtle_name:
- text: "What is your turtle's name?"
forms:
turtle_form:
required_slots:
- turtle_name
session_config:
session_expiration_time: 60
carry_over_slots_to_new_session: true
Bot loaded. Visualisation at http://localhost:5006/visualization.html .
Type a message and press enter (press 'Ctrl-c' to exit).
? Your input -> i like turtles
/home/thoraxe/.pyenv/versions/3.10.9/envs/rasa-310/lib/python3.10/site-packages/rasa/shared/utils/io.py:99: UserWarning: Parsed an intent 'likes_turtles' which is not defined in the domain. Please make sure all intents are listed in the domain.
More info at https://rasa.com/docs/rasa/domain
? Your NLU model classified 'i like turtles' with intent 'likes_turtles' and there are no entities, is this correct? Yes
------
Chat History
# Bot You
────────────────────────────────────────────────────
1 action_listen
────────────────────────────────────────────────────
2 i like turtles
intent: likes_turtles 1.00
Current slots:
turtle_name: None, requested_slot: None, session_started_metadata: None
------
? The bot wants to run 'turtle_form', correct? Yes
/home/thoraxe/.pyenv/versions/3.10.9/envs/rasa-310/lib/python3.10/site-packages/rasa/server.py:860: FutureWarning: The "POST /conversations/<conversation_id>/execute" endpoint is deprecated. Inserting actions to the tracker externally should be avoided. Actions should be predicted by the policies only.
rasa.shared.utils.io.raise_warning(
------
Chat History
# Bot You
────────────────────────────────────────────────────────────────────────────
1 action_listen
────────────────────────────────────────────────────────────────────────────
2 i like turtles
intent: likes_turtles 1.00
────────────────────────────────────────────────────────────────────────────
3 turtle_form 1.00
active_loop{"name": "turtle_form"}
slot{"requested_slot": "turtle_name"}
What is your turtle's name?
Current slots:
turtle_name: None, requested_slot: turtle_name, session_started_metadata: None
version: "3.1"
nlu:
- intent: likes_turtles
examples: |
- i like turtles
- turtles are cool
- turtles are great
- intent: greet
examples: |
- hey
- hello
- hi
- hello there
- good morning
- good evening
- moin
- hey there
- let's go
- hey dude
- goodmorning
- goodevening
- good afternoon
- 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: affirm
examples: |
- yes
- y
- indeed
- of course
- that sounds good
- correct
- intent: deny
examples: |
- no
- n
- never
- I don't think so
- don't like that
- no way
- not really
- intent: mood_great
examples: |
- perfect
- great
- amazing
- feeling like a king
- wonderful
- I am feeling very good
- I am great
- I am amazing
- I am going to save the world
- super stoked
- extremely good
- so so perfect
- so good
- so perfect
- intent: mood_unhappy
examples: |
- my day was horrible
- I am sad
- I don't feel very well
- I am disappointed
- super sad
- I'm so sad
- sad
- very sad
- unhappy
- not good
- not very good
- extremly sad
- so saad
- so sad
- intent: bot_challenge
examples: |
- are you a bot?
- are you a human?
- am I talking to a bot?
- am I talking to a human?
version: "3.1"
rules:
- rule: Say goodbye anytime the user says goodbye
steps:
- intent: goodbye
- action: utter_goodbye
- rule: Say 'I am a bot' anytime the user challenges
steps:
- intent: bot_challenge
- action: utter_iamabot
- rule: activate turtle form
steps:
- intent: likes_turtles
- action: turtle_form
- active_loop: turtle_form
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment