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

Method dump

ms_agent/skill/spec.py:31–60  ·  view source on GitHub ↗

Dump the spec to the specified output directory. Args: output_dir (str): The directory to dump the spec files. Returns: str: The path to the dumped spec directory.

(self, output_dir: str)

Source from the content-addressed store, hash-verified

29 self.implementation = DEFAULT_IMPLEMENTATION
30
31 def dump(self, output_dir: str) -> str:
32 """
33 Dump the spec to the specified output directory.
34
35 Args:
36 output_dir (str): The directory to dump the spec files.
37
38 Returns:
39 str: The path to the dumped spec directory.
40 """
41 output_path: str = os.path.join(output_dir, '.spec')
42 os.makedirs(output_path, exist_ok=True)
43
44 with open(
45 os.path.join(output_path, 'plan.md'), 'w',
46 encoding='utf-8') as f:
47 f.write(self.plan)
48
49 with open(
50 os.path.join(output_path, 'tasks.md'), 'w',
51 encoding='utf-8') as f:
52 f.write(self.tasks)
53
54 with open(
55 os.path.join(output_path, 'implementation.md'),
56 'w',
57 encoding='utf-8') as f:
58 f.write(self.implementation)
59
60 return output_path
61
62
63if __name__ == '__main__':

Callers 14

on_task_endMethod · 0.80
on_task_endMethod · 0.80
setUpMethod · 0.80
save_historyFunction · 0.80
append_statsFunction · 0.80
save_cacheMethod · 0.80
save_session_dataFunction · 0.80
_dump_todo_fileMethod · 0.80

Calls 1

writeMethod · 0.80

Tested by 1

setUpMethod · 0.64