You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit introduces comprehensive skill loading functionality to the generic agent:
Core Features:
- Added SKILL_FOLDERS configuration to load custom skills from specified directories
- Implemented load_skills_content() function to read skill files (SKILL.md, *.py, *.md)
- Enhanced system prompt to include loaded skill descriptions and capabilities
- Updated agent card to display available skills alongside MCP servers
Error Handling:
- Graceful degradation when MCP servers are unavailable
- Warning messages instead of failures for missing skill folders
- Continues operation with partial skill loading if some skills fail
Testing:
- Added comprehensive test suite in tests/ directory
- Includes test_skill_loading.py for full integration tests
- Includes test_skill_loading_simple.py for basic functionality tests
- Added run_skill_test.sh script for easy test execution
- Created tests/README.md with testing documentation
Documentation:
- Updated README.md with skill loading information
- Added testing section with quick start guide
- Documented SKILL_FOLDERS environment variable
Code Quality:
- Fixed trailing whitespace and newline issues in multiple files
- Added proper logging throughout skill loading process
- Improved error messages for better debugging
Signed-off-by: Eran Raichstein <eranra@il.ibm.com>
logger.warning(f"Failed to load MCP tools: {e}. Agent will work without MCP tools.")
225
+
tools= []
226
+
llm_with_tools=llm
78
227
79
-
# System message
80
-
sys_msg=SystemMessage(
81
-
content="You are the **Generic Assistant**, a multi-purpose, tool-based expert. Your primary directive is to fulfill user requests by effectively utilizing the available **MCP tools**. You will select the most appropriate tool(s) based on the user's need (e.g., weather, calculations, data retrieval) and strictly adhere to their output to generate your final answer. Be precise and concise."
82
-
)
228
+
# Load skills content if available
229
+
skills_content=load_skills_content()
230
+
231
+
# Build system message
232
+
base_instruction="You are the **Generic Assistant**, a multi-purpose, tool-based expert. Your primary directive is to fulfill user requests by effectively utilizing the available **MCP tools**. You will select the most appropriate tool(s) based on the user's need (e.g., weather, calculations, data retrieval) and strictly adhere to their output to generate your final answer. Be precise and concise."
233
+
234
+
ifskills_content:
235
+
system_content=f"{base_instruction}\n\n## Available Skills\n\nYou have access to the following specialized skills. Use them when the user's request matches the skill's capabilities:{skills_content}"
0 commit comments