Isaac I. Nwankwo commited on
Update app.py
Browse filesAdd new tool 'suggest_clothing' which suggest clothing according to the temperature in the city at a time.
app.py
CHANGED
|
@@ -7,16 +7,21 @@ from tools.final_answer import FinalAnswerTool
|
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
| 10 |
-
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 11 |
@tool
|
| 12 |
-
def
|
| 13 |
-
|
| 14 |
-
"""A tool that does nothing yet
|
| 15 |
Args:
|
| 16 |
-
|
| 17 |
-
|
| 18 |
"""
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
@tool
|
| 22 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
|
|
|
| 10 |
@tool
|
| 11 |
+
def suggest_clothing(city: str, temperature: int) -> str:
|
| 12 |
+
"""Suggest what to wear based on the temperature in a city.
|
|
|
|
| 13 |
Args:
|
| 14 |
+
city: The name of the city.
|
| 15 |
+
temperature: The current temperature.
|
| 16 |
"""
|
| 17 |
+
if temperature < 10:
|
| 18 |
+
return f"In {city}, it's {temperature}°C. It is recommended to wear a heavy jacket to stay warm and comfortable"
|
| 19 |
+
elif 10 <= temperature < 20:
|
| 20 |
+
return f"In {city}, it's {temperature}°C. it is recommended to wear a light jacket or sweater. "
|
| 21 |
+
elif 20 <= temperature < 30:
|
| 22 |
+
return f"In {city}, it's {temperature}°C. Wear comfortable clothes, like a t-shirt."
|
| 23 |
+
else:
|
| 24 |
+
return f"in {city}, it's {temperature}°C. Stay hydrated and wear breathable clothing!"
|
| 25 |
|
| 26 |
@tool
|
| 27 |
def get_current_time_in_timezone(timezone: str) -> str:
|