internal_info.json dynamic changes (#163)

This commit is contained in:
Silen Naihin
2023-07-17 09:39:24 -04:00
committed by GitHub
parent ce4cefe7e7
commit dffc1dfd51
5 changed files with 77 additions and 93 deletions

View File

@@ -3,7 +3,7 @@ import os
import sys
import time
from datetime import datetime
from typing import Any, Dict
from typing import Any, Dict, Optional
from agbenchmark.utils import get_highest_success_difficulty
@@ -37,8 +37,18 @@ class ReportManager:
with open(self.filename, "w") as f:
json.dump(self.tests, f, indent=4)
def add_test(self, test_name: str, test_details: dict | list) -> None:
self.tests[test_name] = test_details
def add_test(
self,
test_name: str,
test_details: dict | list,
agent_name: Optional[str] = None,
) -> None:
if agent_name:
if agent_name not in self.tests:
self.tests[agent_name] = {}
self.tests[agent_name][test_name] = test_details
else:
self.tests[test_name] = test_details
self.save()