Return mock weather for a city.
(city: str)
| 27 | |
| 28 | @tool(_description="Get the weather in a city") |
| 29 | def get_weather(city: str) -> str: |
| 30 | """Return mock weather for a city.""" |
| 31 | weather = { |
| 32 | "dhaka": "Sunny, 32°C", |
| 33 | "tokyo": "Cloudy, 18°C", |
| 34 | "london": "Rainy, 12°C", |
| 35 | "new york": "Clear, 25°C", |
| 36 | } |
| 37 | return weather.get(city.lower(), f"Weather unavailable for {city}") |
| 38 | |
| 39 | |
| 40 | @tool(_description="Look up the capital city of a country") |