from signalwire.core.skill_base import SkillBase
from signalwire import FunctionResult
class WeatherSkill(SkillBase):
SKILL_NAME = "weather"
SKILL_DESCRIPTION = "Provides weather information"
def setup(self) -> bool:
return True
def register_tools(self):
self.define_tool(
name="get_weather",
description="Get current weather for a location",
handler=self._handle_weather,
parameters={
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City name"
}
},
"required": ["location"]
}
)
def _handle_weather(self, args, raw_data):
location = args.get("location")
return FunctionResult(f"Weather in {location}: sunny, 72F")