MCPcopy Create free account
hub / github.com/Tencent/digitalhuman / save_result

Method save_result

HATE/basic_hate/agentverse/tasksolving.py:99–106  ·  view source on GitHub ↗

Save the result to the result file

(self, plan: str, result: str, spend: float)

Source from the content-addressed store, hash-verified

97 self.environment.reset()
98
99 def save_result(self, plan: str, result: str, spend: float):
100 """Save the result to the result file"""
101 result_file_path = "./results/" + self.task + ".txt"
102 os.makedirs(os.path.dirname(result_file_path), exist_ok=True)
103 with open(result_file_path, "w") as f:
104 f.write("[Final Plan]\n" + plan + "\n\n")
105 f.write("[Result]\n" + result)
106 f.write(f"[Spent]\n${spend}")

Callers 1

runMethod · 0.95

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected