MCPcopy Create free account
hub / github.com/aiwaves-cn/agents / dump

Method dump

src/agents/task/solution.py:110–134  ·  view source on GitHub ↗

Save the solution configuration to a file.

(self, base_path)

Source from the content-addressed store, hash-verified

108 pass
109
110 def dump(self, base_path):
111 """Save the solution configuration to a file."""
112 # get the base path, create the directory if it does not exist
113 base_path = str(base_path)
114 if base_path.endswith("solution.json"):
115 base_path = base_path[:-13]
116 os.makedirs(base_path, exist_ok=True)
117
118 # get the path of the configuration files
119 solution_path = f"{base_path}/solution.json"
120 sop_path = f"{base_path}/sop.json"
121 task_path = f"{base_path}/task.json"
122 agent_team_path = f"{base_path}/agent_team.json"
123
124 # save solution configuration
125 solution_config = copy.deepcopy(self.config)
126 solution_config.task = task_path
127 solution_config.agent_team = agent_team_path
128 solution_config.sop = sop_path
129 solution_config.dump(solution_path)
130
131 # save task, agent_team, and sop configurations
132 self.task.dump(task_path)
133 self.agent_team.dump(agent_team_path)
134 self.sop.dump(sop_path)

Callers 3

optimizeMethod · 0.95
optimizeMethod · 0.95
optimizeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected