aboutsummaryrefslogtreecommitdiff
path: root/benchmark/agbenchmark/reports/agent_benchmark_config.py
blob: 3b45ed713c9891fefa2f33537accb383082e2214 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import json
from pathlib import Path

from agbenchmark.utils.data_types import AgentBenchmarkConfig


def get_agent_benchmark_config() -> AgentBenchmarkConfig:
    agent_benchmark_config_path = str(Path.cwd() / "agbenchmark_config" / "config.json")
    try:
        with open(agent_benchmark_config_path, "r") as f:
            agent_benchmark_config = AgentBenchmarkConfig(**json.load(f))
            agent_benchmark_config.agent_benchmark_config_path = (
                agent_benchmark_config_path
            )
            return agent_benchmark_config
    except json.JSONDecodeError:
        print("Error: benchmark_config.json is not a valid JSON file.")
        raise