add cost to summary (#5473)

This commit is contained in:
Engel Nyst 2024-12-09 20:14:03 +01:00 committed by GitHub
parent 2874041381
commit 455e667739
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -128,6 +128,11 @@ def process_file(file_path):
for error, count in error_counter.items()
},
},
'costs': {
'main_agent': sum(main_agent_cost),
'editor': sum(editor_cost),
'total': sum(main_agent_cost) + sum(editor_cost),
},
'statistics': {
'avg_turns': sum(num_turns) / num_lines if num_lines > 0 else 0,
'costs': {
@ -251,6 +256,7 @@ if __name__ == '__main__':
print(
f"Number of unfinished runs: {result['unfinished_runs']['count']} / {result['total_instances']} ({result['unfinished_runs']['percentage']:.2f}%)"
)
print(f"Total cost: {result['costs']['total']:.2f} USD")
print('## Statistics')
print(
f"Avg. num of turns per instance: {result['statistics']['avg_turns']:.2f}"