diff --git a/.rasa/cache/cache.db b/.rasa/cache/cache.db index 8a139ba28bb29232cf18aed76318958f1f033ba7..38ef27a263a7e012bac6e7312a5a9065ca11a3bb 100644 Binary files a/.rasa/cache/cache.db and b/.rasa/cache/cache.db differ diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000000000000000000000000000000000000..3f999078b9b6571f631285c2adf2be08588a291f --- /dev/null +++ b/Readme.md @@ -0,0 +1,14 @@ +Welcome to my recipe suggestion chatbot: +Made by Berend Fuchs 814080 + +Why did I choose RASA? + +What can this bot do? + Flask + Rasa + Spoonacular API + + +What are its custom actions and which intents does it classify correctly? + How do I talk with the bot? + How will the bot respond? \ No newline at end of file diff --git a/actions/__pycache__/actions.cpython-310.pyc b/actions/__pycache__/actions.cpython-310.pyc index 7fd15b5cefdcd7caf6937f894dd120c252eb9803..e48bb80000bd2cbafa5a70abf845e870a3650cc7 100644 Binary files a/actions/__pycache__/actions.cpython-310.pyc and b/actions/__pycache__/actions.cpython-310.pyc differ diff --git a/actions/actions.py b/actions/actions.py index ecad199e682512c9133a443de97acbd6fcf4e490..be1004efe8b069842d68aac8f0d9753cca4317dd 100644 --- a/actions/actions.py +++ b/actions/actions.py @@ -14,7 +14,7 @@ class ActionRecommendCuisine(Action): tracker: Tracker, domain: Dict[Text, Any]) -> List[Dict[Text, Any]]: - cuisines = ["Italian", "Chinese", "Mexican", "Indian", "French", "Japanese", "Thai", "Spanish", "Greek", "Turkish", "Moroccan", "American", "Korean", "Vietnamese", "Ethiopian", "Argentinian", "Lebanese", "German"] + cuisines = ["Italian", "Chinese", "Mexican", "Indian", "French", "Japanese", "Thai", "Spanish", "Greek", "Turkish", "Moroccan", "American", "Korean", "Vietnamese", "Ethiopian", "Argentinian", "Lebanese"] recommended_cuisine = random.choice(cuisines) dispatcher.utter_message(text=f"I recommend you try {recommended_cuisine} cuisine!") @@ -119,6 +119,11 @@ class ActionShowPicture(Action): data = response.json() if data['results']: image_url = data['results'][0]['image'] + test = requests.get(image_url) + if test.status_code == 404: + dispatcher.utter_message("I am unable to fetch this image off of Spoonacular") + dispatcher.utter_message("Can I help you with anything else?") + return "action_" dispatcher.utter_message(text=f"Here is a picture of {dish}:", image=image_url) else: dispatcher.utter_message(text=f"Sorry, I couldn't find a picture for {dish}.") diff --git a/data/nlu.yml b/data/nlu.yml index 6dab257f73f29d7231ba5d2551200e1ba7fb15a4..e0fe5dcd0a12f67d3fda9c99973fc8c7281b85e2 100644 --- a/data/nlu.yml +++ b/data/nlu.yml @@ -117,8 +117,10 @@ nlu: - How do I make [Green Curry](dish_name)? - How do I make [Thai-Style Mussels](dish_name)? - Can you tell me how to prepare [Spaghetti Carbonara](dish_name)? - - What are the steps to make [Chicken Tikka Masala](dish_name)? - What are the steps to make [Layered Greek Salad](dish_name)? + - What are the steps to make [Chicken Tikka Masala](dish_name)? + - What are the steps to make [Moussaka](dish_name)? + - What are the steps to make [vegetable minestrone soup](dish_name)? - I want to cook [Beef Wellington](dish_name) - How to make [Eggs Benedict](dish_name)? - Can you walk me through making [Pizza](dish_name)? @@ -131,6 +133,11 @@ nlu: - Can you tell me how to cook [Biryani](dish_name)? - What are the steps for [Enchiladas](dish_name)? - How to make [Risotto](dish_name)? + - How to make [Plantain Pizza](dish_name)? + - How to make [Lamb Moussaka](dish_name)? + - How to make [Broccolini Quinoa Pilaf](dish_name)? + - How to make [Pork Fried Rice](dish_name)? + - How to make [mango fried rice](dish_name)? - intent: ask_nutrition_analysis examples: | @@ -316,3 +323,4 @@ nlu: - Vegetable Minestrone Soup - vegetable minestrone soup - Italian Tuna Pasta + - Moussaka diff --git a/data/stories.yml b/data/stories.yml index 18519c1efd764c8c08b93c7e9ac6ea5c85851cfc..d9cbd8799199037c8aa582f1c5f505c0b66d0495 100644 --- a/data/stories.yml +++ b/data/stories.yml @@ -9,7 +9,7 @@ stories: steps: - intent: ask_capability - action: utter_capability - - action: utter_capability + - action: utter_capability2 - story: recommend cuisine steps: diff --git a/domain.yml b/domain.yml index fd602c4e11af9c89fc7e58c4fdc664c7d1e31585..b7de30b2f015669b402eccc423050b34d4958aeb 100644 --- a/domain.yml +++ b/domain.yml @@ -75,7 +75,8 @@ responses: - text: "Sounds good! What else do you have planned?" utter_capability: - - text: I can give you cuisine recommendations. - - text: I know some recipes if you need any guidance! - - text: I could tell you any info that you might need on recipes from Spooncular. + - text: I can give you cuisine and recipe recommendations. + + utter_capability2: + - text: I could also tell you any info that you might need on recipes from Spooncular. \ No newline at end of file