From fa63f63652a32bffea8ada9b7c1a4a561903fd28 Mon Sep 17 00:00:00 2001 From: Merwane Hamadi Date: Sun, 6 Aug 2023 11:28:52 -0700 Subject: [PATCH] Helicone Lock Manager fix Signed-off-by: Merwane Hamadi --- agbenchmark/generate_test.py | 4 +++- agbenchmark/start_benchmark.py | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/agbenchmark/generate_test.py b/agbenchmark/generate_test.py index 7586070b7c7..d38b5d17edb 100644 --- a/agbenchmark/generate_test.py +++ b/agbenchmark/generate_test.py @@ -1,5 +1,6 @@ import glob import importlib +import os import sys import types from collections import deque @@ -58,7 +59,8 @@ def create_single_test( def test_method(self, config: Dict[str, Any], request) -> None: # type: ignore from helicone.lock import HeliconeLockManager - HeliconeLockManager.write_custom_property("challenge", self.data.name) + if os.environ.get("HELICONE_API_KEY"): + HeliconeLockManager.write_custom_property("challenge", self.data.name) cutoff = self.data.cutoff or 60 self.setup_challenge(config, cutoff) diff --git a/agbenchmark/start_benchmark.py b/agbenchmark/start_benchmark.py index 88b00289dea..56ebed144f3 100644 --- a/agbenchmark/start_benchmark.py +++ b/agbenchmark/start_benchmark.py @@ -17,8 +17,10 @@ CURRENT_DIRECTORY = Path(__file__).resolve().parent BENCHMARK_START_TIME = datetime.now().strftime("%Y-%m-%d-%H:%M") - -HeliconeLockManager.write_custom_property("benchmark_start_time", BENCHMARK_START_TIME) +if os.environ.get("HELICONE_API_KEY"): + HeliconeLockManager.write_custom_property( + "benchmark_start_time", BENCHMARK_START_TIME + ) ( HOME_DIRECTORY,