Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,6 +37,9 @@ def get_city_weather(city:str)-> str: #it's import to specify the return type
|
|
| 37 |
except requests.exceptions.RequestException as e:
|
| 38 |
return f"Error: Unable to fetch weather data. {e}"
|
| 39 |
|
|
|
|
|
|
|
|
|
|
| 40 |
@tool
|
| 41 |
def get_current_time_in_timezone(timezone: str) -> str:
|
| 42 |
"""A tool that fetches the current local time in a specified timezone.
|
|
|
|
| 37 |
except requests.exceptions.RequestException as e:
|
| 38 |
return f"Error: Unable to fetch weather data. {e}"
|
| 39 |
|
| 40 |
+
weather_tool = get_city_weather
|
| 41 |
+
agent = CodeAgent(tools=[weather_tool])
|
| 42 |
+
|
| 43 |
@tool
|
| 44 |
def get_current_time_in_timezone(timezone: str) -> str:
|
| 45 |
"""A tool that fetches the current local time in a specified timezone.
|