(agent, file_path)
| 55 | return correct, reward, error, halted, incorrect |
| 56 | |
| 57 | def log_agent(agent, file_path): |
| 58 | question = agent.question |
| 59 | g_truth = agent.key |
| 60 | correct = agent.is_correct() |
| 61 | reward = agent.reward()[0] |
| 62 | halted = agent.is_halted() |
| 63 | error = agent.run_error |
| 64 | prompt = agent._build_agent_prompt() |
| 65 | save_dict = {"question":question, "answer":g_truth, "correct":correct, "reward":reward, |
| 66 | "halted":halted, "error":error,"prompt":prompt} |
| 67 | with open(file_path, 'w') as f: |
| 68 | json.dump(save_dict, f) |
| 69 | f.write("\n") |
| 70 | |
| 71 | |
| 72 | def get_all_agent_sessions(file_name): |
nothing calls this directly
no test coverage detected