Spaces:
Sleeping
Sleeping
File size: 537 Bytes
5a57989 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
from typing import Any, Optional
from smolagents.tools import Tool
class WeatherTool(Tool):
name = "weather_tool"
description = """
This is a tool to get weather information about a particular city"""
inputs = {'city': {'type': 'string', 'description': 'City you wish to find out weather information for.'}}
output_type = "string"
def forward(self, city: str):
return f"The current weather in {city} is 25 degrees celsius."
def __init__(self, *args, **kwargs):
self.is_initialized = False
|