AgentsSkillBase

setup

View as MarkdownOpen in Claude

Initialize the skill: validate environment variables, check packages, initialize API clients, and prepare resources. Called once when the skill is loaded.

This is an abstract method — you must implement it in every SkillBase subclass.

Returns

boolTrue if setup succeeded, False to indicate the skill should not be loaded.

Example

1import os
2from signalwire.core.skill_base import SkillBase
3
4class WeatherSkill(SkillBase):
5 SKILL_NAME = "weather"
6 SKILL_DESCRIPTION = "Provides weather information"
7 REQUIRED_PACKAGES = ["requests"]
8 REQUIRED_ENV_VARS = ["WEATHER_API_KEY"]
9
10 def setup(self) -> bool:
11 if not self.validate_packages():
12 return False
13 if not self.validate_env_vars():
14 return False
15 self.api_key = os.getenv("WEATHER_API_KEY")
16 return True
17
18 def register_tools(self):
19 pass # See register_tools page