WeatherApiSkill

View as MarkdownOpen in Claude

Get current weather conditions for any location using the OpenWeatherMap API.

Class: WeatherApiSkill

Tools: get_weather

Env vars: WEATHER_API_KEY

api_key
stringRequired

OpenWeatherMap API key. Falls back to the WEATHER_API_KEY environment variable.

units
stringDefaults to metric

Temperature units: "metric" (Celsius), "imperial" (Fahrenheit), or "standard" (Kelvin).

1import { AgentBase, WeatherApiSkill } from '@signalwire/sdk';
2
3const agent = new AgentBase({ name: 'assistant', route: '/assistant' });
4agent.setPromptText('You are a helpful assistant.');
5
6await agent.addSkill(new WeatherApiSkill({
7 units: 'imperial',
8}));
9
10agent.run();