Save the result to the result file
(self, plan: str, result: str, spend: float)
| 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}") |