(agents, trial_n)
| 21 | return prefix.strip('\n').strip() + '\n' + suffix.strip('\n').strip() |
| 22 | |
| 23 | def log_trial(agents, trial_n): |
| 24 | correct, incorrect, not_finish = summarize_trial(agents) |
| 25 | |
| 26 | log = f""" |
| 27 | ######################################## |
| 28 | BEGIN TRIAL {trial_n} |
| 29 | Trial summary: Correct: {len(correct)}, Incorrect: {len(incorrect)} , Not Finished: {len(not_finish)} |
| 30 | ####################################### |
| 31 | """ |
| 32 | |
| 33 | log += '------------- BEGIN CORRECT AGENTS -------------\n\n' |
| 34 | for agent in correct: |
| 35 | # log += remove_fewshot(agent._build_agent_prompt()) + f'\nCorrect answer: {agent.key}\n\n' |
| 36 | log += agent._build_agent_prompt() + f'\nCorrect answer: {agent.key}\n\n' |
| 37 | |
| 38 | log += '------------- BEGIN INCORRECT AGENTS -----------\n\n' |
| 39 | for agent in incorrect: |
| 40 | # log += remove_fewshot(agent._build_agent_prompt()) + f'\nCorrect answer: {agent.key}\n\n' |
| 41 | log += agent._build_agent_prompt() + f'\nCorrect answer: {agent.key}\n\n' |
| 42 | |
| 43 | log += '------------- BEGIN NOT_FINISH AGENTS -----------\n\n' |
| 44 | for agent in not_finish: |
| 45 | log += agent._build_agent_prompt() + f'\nCorrect answer: {agent.key}\n\n' |
| 46 | |
| 47 | return log |
| 48 | |
| 49 | def summarize_trial_detailed(agents): |
| 50 | correct = [a.is_correct() for a in agents] |
nothing calls this directly
no test coverage detected