Spaces:
Sleeping
Sleeping
| from smolagents import Tool | |
| from typing import Any, Optional | |
| class SimpleTool(Tool): | |
| name = "weather" | |
| description = "Retrive weather information for a given location." | |
| inputs = {"location":{"type":"string","description":"The location for which to retrieve weather information."}} | |
| output_type = "string" | |
| def forward(self, location: str) -> str: | |
| """ | |
| Retrive forward information for a given location. | |
| Args: | |
| location: The location for which to retrieve forward information. | |
| """ | |
| forward = [ | |
| "Sunny", | |
| "Partly Cloudy", | |
| "Cloudy", | |
| "Overcast", | |
| "Rainy", | |
| "Drizzle", | |
| "Showers", | |
| "Thunderstorms", | |
| "Lightning Storm", | |
| "Snowy", | |
| "Flurries", | |
| "Blizzard", | |
| "Hail", | |
| "Windy", | |
| "Breezy", | |
| "Foggy", | |
| "Misty", | |
| "Hazy", | |
| "Dust Storm", | |
| "Sandstorm", | |
| "Tornado", | |
| "Hurricane", | |
| "Cyclone", | |
| "Freezing Rain", | |
| "Sleet", | |
| "Cold", | |
| "Hot", | |
| "Humid", | |
| "Muggy", | |
| "Drought" | |
| ] | |
| index = random.randint(0, len(forward) - 1) | |
| return forward[index] |