Return the capital city of a country.
(country: str)
| 39 | |
| 40 | @tool(_description="Look up the capital city of a country") |
| 41 | def get_capital(country: str) -> str: |
| 42 | """Return the capital city of a country.""" |
| 43 | capitals = { |
| 44 | "bangladesh": "Dhaka", |
| 45 | "japan": "Tokyo", |
| 46 | "usa": "Washington D.C.", |
| 47 | "india": "New Delhi", |
| 48 | "uk": "London", |
| 49 | } |
| 50 | return capitals.get(country.lower(), f"Capital not found for {country}") |
| 51 | |
| 52 | |
| 53 | @tool(_description="Look up the population of a country") |