Spaces:
Running
Running
Evan Lesmez
commited on
Commit
•
2ffe248
1
Parent(s):
8f49005
Give credit to Edamam API
Browse files- _proc/01_app.ipynb +0 -35
- lv_recipe_chatbot/app.py +9 -2
- nbs/01_app.ipynb +10 -26
_proc/01_app.ipynb
CHANGED
@@ -20,17 +20,6 @@
|
|
20 |
"<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->"
|
21 |
]
|
22 |
},
|
23 |
-
{
|
24 |
-
"cell_type": "code",
|
25 |
-
"execution_count": null,
|
26 |
-
"metadata": {
|
27 |
-
"language": "python"
|
28 |
-
},
|
29 |
-
"outputs": [],
|
30 |
-
"source": [
|
31 |
-
"from dotenv import load_dotenv"
|
32 |
-
]
|
33 |
-
},
|
34 |
{
|
35 |
"cell_type": "code",
|
36 |
"execution_count": null,
|
@@ -743,30 +732,6 @@
|
|
743 |
"execution_count": null,
|
744 |
"metadata": {},
|
745 |
"output_type": "execute_result"
|
746 |
-
},
|
747 |
-
{
|
748 |
-
"name": "stdout",
|
749 |
-
"output_type": "stream",
|
750 |
-
"text": [
|
751 |
-
"\n",
|
752 |
-
"\n",
|
753 |
-
"> Entering new AgentExecutor chain...\n",
|
754 |
-
"\n",
|
755 |
-
"Invoking: `vegan_recipe_edamam_search` with `{'query': 'vegan lemon ginger thai'}`\n",
|
756 |
-
"\n",
|
757 |
-
"\n",
|
758 |
-
"[{'label': 'Creamy Vegan Saag Paneer (With Tofu) Recipe', 'url': 'https://www.seriouseats.com/recipes/2017/03/creamy-vegan-saag-paneer-tofu-recipe.html', 'ingredientLines': ['12 ounces (350g) extra-firm tofu', '1 tablespoon (15g) yellow miso paste', '3 tablespoons (45ml) lemon juice, divided, plus 1 tablespoon (5g) zest, from 2 to 3 lemons', '3 tablespoons (45ml) vegetable oil, divided', 'Kosher salt and freshly ground black pepper', '6 ounces almond, soy, rice, or cashew milk (2/3 cup; 170ml)', '6 ounces cauliflower florets or peeled sunchokes (170g; about 1/3 of a small head of cauliflower)', '4 medium cloves garlic (about 20g), finely minced', '1 (1-inch) knob ginger (about 20g), peeled and finely minced', '1 to 4 green or red Thai chilies (depending on your heat preference), stemmed and finely minced', '1 teaspoon ground coriander seed', '1 teaspoon ground cumin seed', '1 teaspoon ground turmeric', '1 cardamom pod, smashed', '8 ounces (225g) mature spinach, curly if available (see note)', '8 ounces (225g) arugula or mustard greens, tough mustard green stems removed and discarded (see note)'], 'totalTime': 60.0}, {'label': 'Scooped: Kaffir Lime, Ginger, Star Anise Sorbet Recipe', 'url': 'http://www.seriouseats.com/recipes/2010/08/kaffir-lime-ginger-anise-sorbet-recipe.html', 'ingredientLines': ['3 1/2 cups of coconut water (not coconut milk)', '12 kaffir lime leaves, slightly bruised in your palm', '2 small pieces of star anise', '1 tablespoon of ginger, shredded on a fine grater or microplane', '2 to 3 tablespoons of lime juice, to taste', '1 cup of sugar'], 'totalTime': 90.0}, {'label': 'Vegan Thai Curry', 'url': 'https://www.brokefoodies.com/vegan-thai-curry-recipe-keto/', 'ingredientLines': ['1 tofu pack 454g, cut into 16 cubes.', '2 Bell peppers (Red & Green) Cut into strips', '2 tbsp coconut oil', '1 tbsp tomato paste', '1 15 oz can coconut milk full fat', '2 tsp chili flakes', '1 tsp thai curry paste', '1 tbsp almond butter', 'Thumb sized piece of ginger peeled', '1 stalk of lemon grass cut into 3 pieces', '1 clove or garlic', '1/4 cup soy sauce'], 'totalTime': 0.0}]I found a few vegan recipes that include lemon, ginger, and Thai flavors. Here are some options for you:\n",
|
759 |
-
"\n",
|
760 |
-
"1. [Creamy Vegan Saag Paneer (With Tofu)](https://www.seriouseats.com/recipes/2017/03/creamy-vegan-saag-paneer-tofu-recipe.html): This recipe features tofu, yellow miso paste, lemon juice and zest, vegetable oil, and various spices. It's a creamy and flavorful dish inspired by Indian cuisine.\n",
|
761 |
-
"\n",
|
762 |
-
"2. [Scooped: Kaffir Lime, Ginger, Star Anise Sorbet](http://www.seriouseats.com/recipes/2010/08/kaffir-lime-ginger-anise-sorbet-recipe.html): If you're looking for a refreshing dessert, this sorbet recipe combines coconut water, kaffir lime leaves, star anise, ginger, lime juice, and sugar. It's a unique and tangy treat.\n",
|
763 |
-
"\n",
|
764 |
-
"3. [Vegan Thai Curry](https://www.brokefoodies.com/vegan-thai-curry-recipe-keto/): This recipe includes tofu, bell peppers, coconut oil, tomato paste, coconut milk, chili flakes, Thai curry paste, almond butter, ginger, lemongrass, garlic, and soy sauce. It's a flavorful and aromatic curry dish.\n",
|
765 |
-
"\n",
|
766 |
-
"Please let me know if you'd like more information about any of these recipes or if you have any other preferences.\n",
|
767 |
-
"\n",
|
768 |
-
"> Finished chain.\n"
|
769 |
-
]
|
770 |
}
|
771 |
],
|
772 |
"source": [
|
|
|
20 |
"<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->"
|
21 |
]
|
22 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
{
|
24 |
"cell_type": "code",
|
25 |
"execution_count": null,
|
|
|
732 |
"execution_count": null,
|
733 |
"metadata": {},
|
734 |
"output_type": "execute_result"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
735 |
}
|
736 |
],
|
737 |
"source": [
|
lv_recipe_chatbot/app.py
CHANGED
@@ -154,8 +154,15 @@ def create_demo(bot: ConversationBot):
|
|
154 |
|
155 |
msg = gr.Textbox()
|
156 |
# clear = gr.Button("Clear")
|
157 |
-
gr.Markdown(
|
158 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
msg.submit(
|
160 |
fn=bot.respond, inputs=[msg, chatbot], outputs=[msg, chatbot], queue=False
|
161 |
)
|
|
|
154 |
|
155 |
msg = gr.Textbox()
|
156 |
# clear = gr.Button("Clear")
|
157 |
+
gr.Markdown(
|
158 |
+
"""
|
159 |
+
**🔃Refresh the page to start from scratch🔃**
|
160 |
+
|
161 |
+
Recipe search tool powered by the [Edamam API](https://www.edamam.com/)
|
162 |
+
|
163 |
+
![Edamam Logo](https://www.edamam.com/assets/img/small-logo.png)
|
164 |
+
"""
|
165 |
+
)
|
166 |
msg.submit(
|
167 |
fn=bot.respond, inputs=[msg, chatbot], outputs=[msg, chatbot], queue=False
|
168 |
)
|
nbs/01_app.ipynb
CHANGED
@@ -75,6 +75,7 @@
|
|
75 |
"metadata": {},
|
76 |
"outputs": [],
|
77 |
"source": [
|
|
|
78 |
"from dotenv import load_dotenv"
|
79 |
]
|
80 |
},
|
@@ -763,8 +764,15 @@
|
|
763 |
"\n",
|
764 |
" msg = gr.Textbox()\n",
|
765 |
" # clear = gr.Button(\"Clear\")\n",
|
766 |
-
" gr.Markdown(\
|
767 |
-
"\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
768 |
" msg.submit(\n",
|
769 |
" fn=bot.respond, inputs=[msg, chatbot], outputs=[msg, chatbot], queue=False\n",
|
770 |
" )\n",
|
@@ -817,30 +825,6 @@
|
|
817 |
"execution_count": null,
|
818 |
"metadata": {},
|
819 |
"output_type": "execute_result"
|
820 |
-
},
|
821 |
-
{
|
822 |
-
"name": "stdout",
|
823 |
-
"output_type": "stream",
|
824 |
-
"text": [
|
825 |
-
"\n",
|
826 |
-
"\n",
|
827 |
-
"\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n",
|
828 |
-
"\u001b[32;1m\u001b[1;3m\n",
|
829 |
-
"Invoking: `vegan_recipe_edamam_search` with `{'query': 'vegan lemon ginger thai'}`\n",
|
830 |
-
"\n",
|
831 |
-
"\n",
|
832 |
-
"\u001b[0m\u001b[36;1m\u001b[1;3m[{'label': 'Creamy Vegan Saag Paneer (With Tofu) Recipe', 'url': 'https://www.seriouseats.com/recipes/2017/03/creamy-vegan-saag-paneer-tofu-recipe.html', 'ingredientLines': ['12 ounces (350g) extra-firm tofu', '1 tablespoon (15g) yellow miso paste', '3 tablespoons (45ml) lemon juice, divided, plus 1 tablespoon (5g) zest, from 2 to 3 lemons', '3 tablespoons (45ml) vegetable oil, divided', 'Kosher salt and freshly ground black pepper', '6 ounces almond, soy, rice, or cashew milk (2/3 cup; 170ml)', '6 ounces cauliflower florets or peeled sunchokes (170g; about 1/3 of a small head of cauliflower)', '4 medium cloves garlic (about 20g), finely minced', '1 (1-inch) knob ginger (about 20g), peeled and finely minced', '1 to 4 green or red Thai chilies (depending on your heat preference), stemmed and finely minced', '1 teaspoon ground coriander seed', '1 teaspoon ground cumin seed', '1 teaspoon ground turmeric', '1 cardamom pod, smashed', '8 ounces (225g) mature spinach, curly if available (see note)', '8 ounces (225g) arugula or mustard greens, tough mustard green stems removed and discarded (see note)'], 'totalTime': 60.0}, {'label': 'Scooped: Kaffir Lime, Ginger, Star Anise Sorbet Recipe', 'url': 'http://www.seriouseats.com/recipes/2010/08/kaffir-lime-ginger-anise-sorbet-recipe.html', 'ingredientLines': ['3 1/2 cups of coconut water (not coconut milk)', '12 kaffir lime leaves, slightly bruised in your palm', '2 small pieces of star anise', '1 tablespoon of ginger, shredded on a fine grater or microplane', '2 to 3 tablespoons of lime juice, to taste', '1 cup of sugar'], 'totalTime': 90.0}, {'label': 'Vegan Thai Curry', 'url': 'https://www.brokefoodies.com/vegan-thai-curry-recipe-keto/', 'ingredientLines': ['1 tofu pack 454g, cut into 16 cubes.', '2 Bell peppers (Red & Green) Cut into strips', '2 tbsp coconut oil', '1 tbsp tomato paste', '1 15 oz can coconut milk full fat', '2 tsp chili flakes', '1 tsp thai curry paste', '1 tbsp almond butter', 'Thumb sized piece of ginger peeled', '1 stalk of lemon grass cut into 3 pieces', '1 clove or garlic', '1/4 cup soy sauce'], 'totalTime': 0.0}]\u001b[0m\u001b[32;1m\u001b[1;3mI found a few vegan recipes that include lemon, ginger, and Thai flavors. Here are some options for you:\n",
|
833 |
-
"\n",
|
834 |
-
"1. [Creamy Vegan Saag Paneer (With Tofu)](https://www.seriouseats.com/recipes/2017/03/creamy-vegan-saag-paneer-tofu-recipe.html): This recipe features tofu, yellow miso paste, lemon juice and zest, vegetable oil, and various spices. It's a creamy and flavorful dish inspired by Indian cuisine.\n",
|
835 |
-
"\n",
|
836 |
-
"2. [Scooped: Kaffir Lime, Ginger, Star Anise Sorbet](http://www.seriouseats.com/recipes/2010/08/kaffir-lime-ginger-anise-sorbet-recipe.html): If you're looking for a refreshing dessert, this sorbet recipe combines coconut water, kaffir lime leaves, star anise, ginger, lime juice, and sugar. It's a unique and tangy treat.\n",
|
837 |
-
"\n",
|
838 |
-
"3. [Vegan Thai Curry](https://www.brokefoodies.com/vegan-thai-curry-recipe-keto/): This recipe includes tofu, bell peppers, coconut oil, tomato paste, coconut milk, chili flakes, Thai curry paste, almond butter, ginger, lemongrass, garlic, and soy sauce. It's a flavorful and aromatic curry dish.\n",
|
839 |
-
"\n",
|
840 |
-
"Please let me know if you'd like more information about any of these recipes or if you have any other preferences.\u001b[0m\n",
|
841 |
-
"\n",
|
842 |
-
"\u001b[1m> Finished chain.\u001b[0m\n"
|
843 |
-
]
|
844 |
}
|
845 |
],
|
846 |
"source": [
|
|
|
75 |
"metadata": {},
|
76 |
"outputs": [],
|
77 |
"source": [
|
78 |
+
"#| hide\n",
|
79 |
"from dotenv import load_dotenv"
|
80 |
]
|
81 |
},
|
|
|
764 |
"\n",
|
765 |
" msg = gr.Textbox()\n",
|
766 |
" # clear = gr.Button(\"Clear\")\n",
|
767 |
+
" gr.Markdown(\n",
|
768 |
+
" \"\"\"\n",
|
769 |
+
" **🔃Refresh the page to start from scratch🔃** \n",
|
770 |
+
" \n",
|
771 |
+
" Recipe search tool powered by the [Edamam API](https://www.edamam.com/) \n",
|
772 |
+
" \n",
|
773 |
+
" ![Edamam Logo](https://www.edamam.com/assets/img/small-logo.png)\n",
|
774 |
+
" \"\"\"\n",
|
775 |
+
" )\n",
|
776 |
" msg.submit(\n",
|
777 |
" fn=bot.respond, inputs=[msg, chatbot], outputs=[msg, chatbot], queue=False\n",
|
778 |
" )\n",
|
|
|
825 |
"execution_count": null,
|
826 |
"metadata": {},
|
827 |
"output_type": "execute_result"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
828 |
}
|
829 |
],
|
830 |
"source": [
|