MCPcopy Create free account
hub / github.com/modelscope/ms-agent / reload_skill

Method reload_skill

ms_agent/skill/loader.py:205–227  ·  view source on GitHub ↗

Reload a skill from its directory. Args: skill_path: Path to skill directory Returns: Reloaded SkillSchema object if successful, None otherwise

(self, skill_path: str)

Source from the content-addressed store, hash-verified

203 return self.loaded_skills.copy()
204
205 def reload_skill(self, skill_path: str) -> Optional[SkillSchema]:
206 """
207 Reload a skill from its directory.
208
209 Args:
210 skill_path: Path to skill directory
211
212 Returns:
213 Reloaded SkillSchema object if successful, None otherwise
214 """
215 path_obj = Path(skill_path)
216
217 if not self._is_skill_directory(path_obj):
218 logger.error(f'Not a valid skill directory: {skill_path}')
219 return None
220
221 skill = self._load_single_skill(path_obj)
222 if skill:
223 skill_key: str = self._get_skill_key(skill=skill)
224 self.loaded_skills[skill_key] = skill
225 logger.info(f'Successfully reloaded skill: {skill.name}')
226
227 return skill
228
229
230def load_skills(

Callers

nothing calls this directly

Calls 3

_is_skill_directoryMethod · 0.95
_load_single_skillMethod · 0.95
_get_skill_keyMethod · 0.95

Tested by

no test coverage detected