Stories.yml
version: "3.1"
stories:
- story: bot_launch
steps:
- action: action_show_help_on_launch
- story: happy path
steps:
- action: utter_greet
- action: utter_show_possible_list_option
- story: sad path 1
steps:
- intent: greet
- action: utter_greet
- intent: mood_unhappy
- action: utter_cheer_up
- action: utter_did_that_help
- intent: affirm
- action: utter_happy
- story: sad path 2
steps:
- intent: greet
- action: utter_greet
- intent: mood_unhappy
- action: utter_cheer_up
- action: utter_did_that_help
- intent: deny
- action: utter_goodbye
- story: help_request
steps:
- intent: ask_for_help
- action: utter_help
- story: ask_current_weather
steps:
- intent: ask_current_weather
- action: utter_ask_current_weather
- story: ask_forecast
steps:
- intent: ask_forecast
- action: utter_ask_forecast
- story: ask_historical_weather
steps:
- intent: ask_historical_weather
- action: utter_ask_historical_weather
- story: ask_severe_weather_alerts
steps:
- intent: ask_severe_weather_alerts
- action: utter_ask_severe_weather_alerts
- story: ask_air_quality
steps:
- intent: ask_air_quality
- action: utter_ask_air_quality
- story: Get weather information for valid city
steps:
- intent: request_current_weather_city
entities:
- city: "Berlin"
- action: action_validate_city_info
- slot_was_set:
- city: "Berlin"
- action: action_get_weather_info_current
- action: utter_show_possible_list_option
- story: Get weather information for invalid city
steps:
- intent: request_current_weather_city
entities:
- city: "abc"
- input_validity: invalid_city
- action: action_validate_city_info
- slot_was_set:
- city: null
- input_validity: invalid_city
- action: utter_request_city
- intent: inform_city
- slot_was_set:
- city: text
- input_validity: valid
- action: action_get_weather_info_current
- action: utter_show_possible_list_option
- story: Get weather information with different options
steps:
- intent: inform_city
entities:
- city: "Berlin"
- slot_was_set:
- city: text
- input_validity: valid
- action: action_get_weather_info_current
- action: utter_show_possible_list_option
- story: Get weather information with ZIP code and country code
steps:
- intent: request_current_weather_zipcode_countrycode
entities:
- zipcode: "10001"
- country_code: "US"
- action: action_validate_zip_code_current_weather
- action: action_validate_country_code_current_weather
- slot_was_set:
- zipcode: "10001"
- country_code: "US"
- input_validity: valid
- action: action_get_zipcode_weather_current_weather
- action: utter_show_possible_list_option
- story: Handle ZIP code without country code and correction
steps:
- intent: request_current_weather_zipcode_countrycode
entities:
- zipcode: "90210"
- country_code: null
- action: action_validate_zip_code_current_weather
- action: action_validate_country_code_current_weather
- slot_was_set:
- zipcode: "90210"
- country_code: null
- input_validity: invalid_country_code
- action: utter_ask_for_correct_countrycode
- intent: inform_countrycode
entities:
- country_code: "DE"
- action: action_validate_country_code_current_weather
- slot_was_set:
- zipcode: "90210"
- country_code: "DE"
- input_validity: valid
- action: action_get_zipcode_weather_current_weather
- action: utter_show_possible_list_option
- story: Handle invalid ZIP code input and correction
steps:
- intent: request_current_weather_zipcode_countrycode
entities:
- zipcode: "99999"
- country_code: "US"
- action: action_validate_zip_code_current_weather
- action: action_validate_country_code_current_weather
- slot_was_set:
- zipcode: "99999"
- country_code: "US"
- input_validity: invalid_zipcode
- action: utter_ask_for_correct_zipcode
- intent: inform_zipcode
entities:
- zipcode: "90210"
- action: action_validate_zip_code_current_weather
- slot_was_set:
- zipcode: "90210"
- country_code: "US"
- input_validity: valid
- action: action_get_zipcode_weather_current_weather
- action: utter_show_possible_list_option
- story: Handle request for historical weather with complete information
steps:
- intent: request_historical_weather_daterange_city
entities:
- start_date: "2024-03-01"
- end_date: "2024-03-07"
- city: "Madrid"
- action: action_validate_city_info
- action: action_validate_date_range_historical_weather
- slot_was_set:
- city: "Madrid"
- start_date: "2024-03-01"
- end_date: "2024-03-07"
- action: action_get_past_weather_info
- action: utter_show_possible_list_option
- story: Handle historical weather with missing end date and correction
steps:
- intent: request_historical_weather_daterange_city
entities:
- start_date: "2024-01-01"
- end_date: null
- city: "London"
- action: action_validate_city_info
- action: action_validate_start_date
- slot_was_set:
- city: "London"
- start_date: "2024-01-01"
- end_date: null
- action: utter_ask_for_end_date
- intent: inform_enddate
entities:
- start_date: "2024-01-01"
- end_date: "2024-01-07"
- city: "London"
- action: action_validate_city_info
- action: action_validate_date_range_historical_weather
- slot_was_set:
- city: "London"
- start_date: "2024-01-01"
- end_date: "2024-01-07"
- action: action_get_past_weather_info
- action: utter_show_possible_list_option
- story: Handle historical weather with missing start date and correction
steps:
- intent: request_historical_weather_daterange_city
entities:
- start_date: null
- end_date: "2024-01-01"
- city: "London"
- action: action_validate_city_info
- action: action_validate_end_date
- slot_was_set:
- city: "London"
- end_date: "2024-01-01"
- start_date: null
- action: utter_ask_for_start_date
- intent: inform_startdate
entities:
- start_date: "2024-01-01"
- end_date: "2024-01-07"
- city: "London"
- action: action_validate_city_info
- action: action_validate_date_range_historical_weather
- slot_was_set:
- city: "London"
- start_date: "2024-01-01"
- end_date: "2024-01-07"
- action: action_get_past_weather_info
- action: utter_show_possible_list_option
- story: Handle invalid city for historical weather and correction
steps:
- intent: request_historical_weather_daterange_city
entities:
- start_date: "2023-11-01"
- end_date: "2023-11-10"
- city: "FakeCity"
- action: action_validate_city_info
- action: action_validate_date_range_historical_weather
- slot_was_set:
- start_date: "2023-11-01"
- end_date: "2023-11-10"
- city: "FakeCity"
- action: utter_ask_for_correct_city
- intent: inform_city
- action: action_validate_city_info
- slot_was_set:
- start_date: "2023-11-01"
- end_date: "2023-11-10"
- city: text
- action: action_get_past_weather_info
- action: utter_show_possible_list_option
- story: Handle invalid date range for historical weather
steps:
- intent: request_historical_weather_daterange_city
entities:
- start_date: "2024-03-15"
- end_date: "2024-03-10"
- city: "Berlin"
- action: action_validate_city_info
- action: action_validate_date_range_historical_weather
- slot_was_set:
- city: "Berlin"
- start_date: "2024-03-15"
- end_date: "2024-03-10"
- action: utter_invalid_daterange
- action: utter_ask_for_correct_daterange
- intent: inform_startdate
entities:
- start_date: "2024-03-10"
- intent: inform_enddate
entities:
- end_date: "2024-03-15"
- action: action_validate_date_range_historical_weather
- slot_was_set:
- city: "Berlin"
- start_date: "2024-03-10"
- end_date: "2024-03-15"
- action: action_get_past_weather_info
- action: utter_show_possible_list_option
- story: Handle request for future weather based on time period forecast
steps:
- intent: request_weather_forecast_timeperiod_and_city
entities:
- city: "Tokyo"
- time_period: "next week"
- action: action_validate_city_info
- action: action_validate_time_period_forecast
- slot_was_set:
- city: "Tokyo"
- time_period: "next week"
- action: action_get_future_weather_info
- action: utter_show_possible_list_option
- story: Handle request for forecast with city and days provided
steps:
- intent: request_weather_forecast_days_and_city
entities:
- city: "Miami"
- days: 7
- action: action_validate_city_info
- action: action_validate_days_forecast
- slot_was_set:
- city: "Miami"
- days: 7
- input_validity: valid
- action: action_get_future_weather_info
- action: utter_show_possible_list_option
- story: Handle invalid number of days input and correction
steps:
- intent: request_weather_forecast_days_and_city
entities:
- city: "New York"
- time_period: "Many"
- action: action_validate_city_info
- action: action_validate_days_forecast
- slot_was_set:
- city: "New York"
- time_period: "Many"
- action: utter_invalid_timeperiod
- intent: inform_timeperiod
- action: action_validate_days_forecast
- slot_was_set:
- time_period: "this week"
- city: "New York"
- action: action_get_future_weather_info
- action: utter_show_possible_list_option
- story: Handle date too far in future for weather forecast
steps:
- intent: request_weather_forecast_days_and_city
entities:
- city: "London"
- days: 30
- action: action_validate_city_info
- action: action_validate_days_forecast
- slot_was_set:
- city: "London"
- days: 30
- action: utter_ask_for_shorter_forecast
- intent: inform_days
- action: action_validate_days_forecast
- slot_was_set:
- days: 7
- city: "London"
- action: action_get_future_weather_info
- action: utter_show_possible_list_option
Rules.yml
version: "3.1"
rules:
- rule: Show help on session start
steps:
- action: action_session_start
- 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: Get weather information for valid city
steps:
- intent: request_current_weather_city
entities:
- city: "Berlin"
- action: action_validate_city_info
- slot_was_set:
- city: "Berlin"
- action: action_get_weather_info_current
- action: utter_show_possible_list_option
- rule: Get weather information for invalid city
steps:
- intent: request_current_weather_city
entities:
- city: "abc"
- action: action_validate_city_info
- slot_was_set:
- city: null
- action: utter_request_city
- rule: Get weather information with ZIP code and country code
steps:
- intent: request_current_weather_zipcode_countrycode
entities:
- zipcode: "10001"
- country_code: "US"
- action: action_validate_zip_code_current_weather
- action: action_validate_country_code_current_weather
- slot_was_set:
- zipcode: "10001"
- country_code: "US"
- action: action_get_zipcode_weather_current_weather
- action: utter_show_possible_list_option
- rule: Handle missing end date for historical weather
steps:
- intent: request_historical_weather_daterange_city
entities:
- end_date: null
- action: utter_ask_for_end_date
- rule: Handle missing start date for historical weather
steps:
- intent: request_historical_weather_daterange_city
entities:
- start_date: null
- action: utter_ask_for_start_date
- rule: Ask the user to rephrase whenever they send a message with low NLU confidence
steps:
- intent: nlu_fallback
- action: utter_please_rephrase
- rule: Handle core fallback
steps:
- action: action_default_fallback
- action: utter_default
domain.yaml
version: "3.1"
intents:
- greet
- goodbye
- affirm
- deny
- mood_great
- mood_unhappy
- bot_challenge
- request_current_weather_city
- request_current_weather_zipcode_countrycode
- request_historical_weather_daterange_city
- request_weather_forecast_timeperiod_and_city
- request_weather_forecast_days_and_city
- inform_city
- inform_zipcode
- inform_countrycode
- inform_startdate
- inform_enddate
- inform_timeperiod
- inform_days
- nlu_fallback
- ask_historical_weather
- ask_severe_weather_alerts
- ask_air_quality
- ask_forecast
- ask_current_weather
- ask_for_help
entities:
- city
- time_period
- input_validity
- zipcode
- country_code
- start_date
- end_date
- days
slots:
city:
type: text
influence_conversation: true
mappings:
- type: from_entity
entity: city
- type: from_text
intent: request_current_weather_city
time_period:
type: text
influence_conversation: true
mappings:
- type: from_entity
entity: time_period
- type: from_text
intent: request_weather_forecast_timeperiod_and_city
input_validity:
type: categorical
values:
- valid
- invalid
- invalid_city
- invalid_zipcode
- invalid_days
- invalid_daterange
- incomplete_data
influence_conversation: true
mappings:
- type: from_entity
entity: input_validity
zipcode:
type: text
influence_conversation: true
mappings:
- type: from_entity
entity: zipcode
- type: from_text
intent: request_current_weather_zipcode_countrycode
country_code:
type: text
influence_conversation: true
mappings:
- type: from_entity
entity: country_code
- type: from_text
intent: request_current_weather_zipcode_countrycode
start_date:
type: text
influence_conversation: true
mappings:
- type: from_entity
entity: start_date
- type: from_text
intent: request_historical_weather_daterange_city
end_date:
type: text
influence_conversation: true
mappings:
- type: from_entity
entity: end_date
- type: from_text
intent: request_historical_weather_daterange_city
days:
type: text
influence_conversation: true
mappings:
- type: from_entity
entity: end_date
- type: from_text
intent: request_weather_forecast_days_and_city
responses:
utter_greet:
- text: "Hey! How can I assist you today? ๐ I'm the Climia genius ๐ weather bot! ๐"
- text: "Hello! Need help with the weather? I'm your Climia genius bot ๐! ๐ฆ๏ธ"
- text: "Hi there! How can the Climia genius weather bot assist you today? ๐ค๏ธ๐ฌ"
utter_cheer_up:
- text: "Hereโs something to brighten your day! ๐๐"
image: "https://i.imgur.com/nGF1K8f.jpg"
utter_did_that_help:
- text: "Did that help? ๐ค๐ก"
utter_happy:
- text: "Great! ๐ผ I hope you have a fantastic day! ๐"
utter_goodbye:
- text: "Take care and have a wonderful day! ๐๐"
utter_iamabot:
- text: "Iโm the Climia genius ๐ weather bot ๐ค, here to assist you with weather updates! ๐ฆ๏ธ"
utter_show_possible_list_option:
- text: "โจ **Here are some options you can choose from:** โจ\n\n"
buttons:
- title: "๐ฆ๏ธ Check current weather"
subtitle: "๐ **Required:** City"
payload: "/request_current_weather_city"
- title: "๐ Check current weather with zipcodes"
subtitle: "๐ **Required:** Zip code & Country Code (2-letter)"
payload: "/request_current_weather_zip"
- title: "๐
Request historical weather"
subtitle: "๐ **Required:** City, Start Date (YYYY-MM-DD), & End Date (YYYY-MM-DD) (Must be exactly 7 days or less)"
payload: "/request_historical_weather"
- title: "๐ฎ Request future weather forecast"
subtitle: "๐ **Required:** City & Number of days(Max:15 days from today)"
payload: "/request_future_weather"
- title: "โ Ask general questions"
subtitle: "โน๏ธ **No specific parameters needed**"
payload: "/ask_general_questions"
utter_request_city:
- text: "Please enter the city you want to know the weather for. ๐๐"
utter_please_rephrase:
- text: "๐ค I didn't quite understand that. Could you rephrase? ๐"
utter_default:
- text: "๐ค Sorry, I didn't get that. Can you rephrase? ๐"
utter_ask_for_correct_countrycode:
- text: "๐ซ I couldn't find the provided country code ๐. Please make sure you've entered a valid one. ๐"
utter_ask_for_correct_zipcode:
- text: "๐ซ I couldn't find the weather for the provided zip code ๐บ๏ธ. Please make sure you've entered a valid one. ๐"
utter_ask_for_end_date:
- text: "I am sorry. I could not find the provided end date. Please enter the end date for the historical weather data. ๐
โณ"
utter_ask_for_start_date:
- text: "I am sorry. I could not find the provided start date. Please enter the start date for the historical weather data. ๐
๐"
utter_ask_for_correct_city:
- text: "I am sorry. I could not find the provided city. Please enter the correct city ๐๐บ๏ธ"
utter_invalid_daterange:
- text: "๐ซ The date range seems incorrect. Please ensure the start date is before the end date. ๐๏ธ๐"
utter_ask_for_correct_daterange:
- text: "๐
The date range is invalid. The start date should be earlier than the end date. Please correct it. ๐ฐ๏ธ๐ ๏ธ"
utter_invalid_days:
- text: "๐ฐ๏ธ The number of days youโve entered is not valid. Please provide a number between 1 and 15. โ"
utter_ask_for_shorter_forecast:
- text: "๐ Your forecast request exceeds the 15-day limit. Please specify a shorter time period. ๐๏ธ"
utter_invalid_timeperiod:
- text: "๐ The time period must be between 1 to 15 days. Please check and provide a valid duration. ๐ฐ๏ธ๐ซ"
utter_help:
- text: "Hereโs how you can use this bot:\n1. To get the current weather, ask about the weather in a specific city. ๐๐ฆ๏ธ\n2. For weather forecasts, mention the city and time period. ๐
๐ฎ\n3. To check historical weather data, provide the city and date range(YYYY-MM-DD). ๐๐\n4. For severe weather alerts, just ask if there are any alerts for your area. ๐จ๐ฉ๏ธ\n5. To get air quality information, specify the city. ๐ฌ๏ธ๐\n6. You can change the temperature unit by asking for Celsius or Fahrenheit. ๐ก๏ธ๐"
utter_ask_current_weather:
- text: "To get the current weather, simply ask me about the weather in a specific city. For example, 'Whatโs the current weather in Tokyo?' ๐๐ค๏ธ"
utter_ask_forecast:
- text: "To get a weather forecast, ask for the weather in a city along with the time period youโre interested in. For example, 'Can you give me the weather forecast for New York for the next 7 days?' ๐
๐ฎ"
utter_ask_historical_weather:
- text: "To find historical weather data, ask for the weather in a city for a specific date range. For example, 'What was the weather like in London from 2024-01-01 to 2024-01-07(YYYY-MM-DD)?' ๐๐"
utter_ask_severe_weather_alerts:
- text: "To check for severe weather alerts, ask if there are any alerts for your area. For example, 'Are there any severe weather alerts for New York?' ๐จ๐ฉ๏ธ"
utter_ask_air_quality:
- text: "To get air quality information, ask for the air quality in a specific city. For example, 'Whatโs the air quality like in Berlin today?' ๐ซ๏ธ๐"
utter_ask_temperature_unit:
- text: "To change the temperature unit, ask for the temperature in Celsius or Fahrenheit. For example, 'Can I get the weather in Celsius?' ๐ก๏ธ๐"
actions:
- action_default_fallback
- utter_ask_for_correct_zipcode
- utter_show_possible_list_option
- utter_request_city
- utter_ask_for_correct_countrycode
- utter_please_rephrase
- utter_default
- utter_ask_for_end_date
- utter_ask_for_start_date
- utter_ask_for_correct_city
- utter_invalid_daterange
- utter_ask_for_correct_daterange
- utter_ask_for_shorter_forecast
- utter_invalid_timeperiod
- utter_invalid_days
- action_show_help_on_launch
- action_session_start
- action_validate_city_info
- action_get_weather_info_current
- action_validate_zip_code_current_weather
- action_validate_country_code_current_weather
- action_get_zipcode_weather_current_weather
- action_validate_date_range_historical_weather
- action_get_past_weather_info
- action_validate_start_date
- action_validate_end_date
- action_validate_time_period_forecast
- action_get_future_weather_info
- action_validate_days_forecast
session_config:
session_expiration_time: 60
carry_over_slots_to_new_session: true
Can you please help me with stories and rules.yaml and domain.yaml to fix the contradicting stories ? I would appreciate the help , This is my error message
InvalidRule: Contradicting rules or stories found ๐จ
- the prediction of the action 'utter_ask_for_correct_zipcode' in story 'Handle invalid ZIP code input and correction' is contradicting with rule(s) 'Get weather information with ZIP code and country code' which predicted action 'action_get_zipcode_weather_current_weather'.
Please update your stories and rules so that they don't contradict each other.
You can find more information about the usage of rules at https://rasa.com/docs/rasa/rules.
(weatherbot) trishachetani@TrishaChetanis-MacBook-Air weather %
``` I keep getting for all stories the same issue . how to tackle it