Skip to content

Commit b1ec422

Browse files
committed
modify demo of skill agent.
1 parent 2421ce9 commit b1ec422

1 file changed

Lines changed: 8 additions & 41 deletions

File tree

Lines changed: 8 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,7 @@
1-
"""
2-
SkillAgent demo - Direct path-based skill loading.
3-
4-
This demonstrates the simplified skill management architecture:
5-
6-
1. SkillAgent accepts skill directory paths directly via `skills` parameter
7-
2. No need for SkillSource components or global registry
8-
3. Skills are loaded directly from specified paths during initialization
9-
10-
KEY CONCEPT:
11-
- skills=["./path/to/skills1", "./path/to/skills2"] - Direct path binding
12-
- Each path can be a single skill folder or parent directory containing multiple skills
13-
- SKILL.md files define skill metadata (name, description, etc.)
14-
15-
Usage:
16-
1. Manual activation: /<skill-name> [task]
17-
2. Natural language: "I want to create a skill..." (requires enable_selector=True)
18-
3. List skills: "What skills do you have?"
19-
"""
201
import asyncio
212
import os
22-
import sys
23-
24-
project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))
25-
sys.path.insert(0, project_root)
263

27-
from oxygent import MAS, Config, oxy, preset_tools
4+
from oxygent import MAS, oxy, preset_tools
285

296

307
async def main():
@@ -35,29 +12,19 @@ async def main():
3512
base_url=os.getenv("DEFAULT_LLM_BASE_URL"),
3613
model_name=os.getenv("DEFAULT_LLM_MODEL_NAME"),
3714
),
38-
39-
# Direct path binding - no SkillSource needed
15+
preset_tools.file_tools,
16+
preset_tools.shell_tools,
4017
oxy.SkillAgent(
41-
name="master_agent",
18+
name="skill_agent",
4219
llm_model="default_llm",
43-
enable_selector=True,
44-
tools=["view_text_file", "execute_shell_command"],
45-
# Direct skill paths - each can be a single skill folder or parent directory
46-
skills=[
47-
".oxygent/skills",
48-
],
20+
tools=["view_text_file", "execute_shell_command"], # required
21+
skills=[".oxygent/skills"], # A single skill folder or parent directory
4922
),
50-
51-
preset_tools.file_tools,
52-
preset_tools.shell_tools,
5323
]
5424

5525
async with MAS(oxy_space=oxy_space) as mas:
56-
first_query = (
57-
"What skills do you have?\n"
58-
)
59-
await mas.start_web_service(first_query=first_query)
26+
await mas.start_web_service(first_query="What skills do you have?")
6027

6128

6229
if __name__ == "__main__":
63-
asyncio.run(main())
30+
asyncio.run(main())

0 commit comments

Comments
 (0)