import { SkillBase, type SkillToolDefinition, type ParameterSchemaEntry } from '@signalwire/sdk';
class WeatherSkill extends SkillBase {
static override SKILL_NAME = 'weather';
static override SKILL_DESCRIPTION = 'Provides weather information';
static override getParameterSchema(): Record<string, ParameterSchemaEntry> {
return {
...super.getParameterSchema(),
units: {
type: 'string',
description: 'Temperature units',
default: 'fahrenheit',
enum: ['fahrenheit', 'celsius'],
},
api_key: {
type: 'string',
description: 'Weather API key',
required: true,
hidden: true,
env_var: 'WEATHER_API_KEY',
},
};
}
override getTools(): SkillToolDefinition[] {
return [];
}
}
// Inspect the schema (includes base params swaig_fields, skip_prompt)
console.log(WeatherSkill.getParameterSchema());
// { swaig_fields: { ... }, skip_prompt: { ... }, units: { ... }, api_key: { ... } }