Adding Skills
Adding Skills
Add skills to your agents with add_skill(). Pass configuration parameters to customize behavior.
Basic Usage
Add a skill with no configuration:
With Configuration
Pass parameters as a dictionary:
Method Chaining
add_skill() returns self for chaining:
Multiple Skills
Add as many skills as needed:
Checking Loaded Skills
Removing Skills
Multi-Instance Skills
Some skills support multiple instances:
SWAIG Fields
Add extra SWAIG metadata to skill functions:
Error Handling
Skills may fail to load:
Common errors:
Skills with Environment Variables
Some skills read from environment variables:
Complete Example
Skills like web_search and joke require additional configuration or API keys. See the Built-in Skills section for details on each skill’s requirements.
Best Practices
DO:
- Add skills in init before prompt configuration
- Use environment variables for API keys
- Check skill availability with has_skill() if conditional
- Update prompts to mention skill capabilities
DON’T:
- Hardcode API keys in source code
- Add duplicate skills (unless multi-instance)
- Assume skills are available without checking
- Forget to handle skill loading errors