-
-
Notifications
You must be signed in to change notification settings - Fork 984
Expand file tree
/
Copy pathagent_with_skills.py
More file actions
32 lines (25 loc) · 930 Bytes
/
Copy pathagent_with_skills.py
File metadata and controls
32 lines (25 loc) · 930 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""
Agent Skills Example
This example shows how to use Agent Skills - modular, reusable capabilities
defined in SKILL.md files. Skills are automatically loaded and the agent follows
their instructions when relevant.
Note: This example uses the example_skills directory in the root of the repo.
To use your own skills, create a skills directory and point to it.
"""
from pathlib import Path
from swarms import Agent
# Get path to example_skills directory (2 levels up from this file)
repo_root = Path(__file__).parent.parent.parent
skills_path = repo_root / "example_skills"
# Create an agent with skills
agent = Agent(
agent_name="Financial Analyst",
model_name="gpt-4o",
max_loops=1,
skills_dir=str(skills_path),
)
# The agent automatically uses the financial-analysis skill for this task
response = agent.run(
"Analyze Apple's financials and provide a DCF valuation framework"
)
print(response)