From 2ec306e850fa146215fd787dbb3145572cd37160 Mon Sep 17 00:00:00 2001 From: Silen Naihin Date: Mon, 31 Jul 2023 13:28:01 +0100 Subject: [PATCH] linter fixes --- agbenchmark/reports/reports.py | 2 +- agbenchmark/utils/get_data_from_helicone.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/agbenchmark/reports/reports.py b/agbenchmark/reports/reports.py index 9abe5ea3..0cce471d 100644 --- a/agbenchmark/reports/reports.py +++ b/agbenchmark/reports/reports.py @@ -7,10 +7,10 @@ from typing import Any, Callable import pytest from agbenchmark.agent_interface import MOCK_FLAG -from agbenchmark.utils.get_data_from_helicone import get_data_from_helicone from agbenchmark.reports.ReportManager import ReportManager from agbenchmark.start_benchmark import CONFIG_PATH, REGRESSION_TESTS_PATH, REPORTS_PATH from agbenchmark.utils.data_types import DIFFICULTY_MAP, DifficultyLevel, SuiteConfig +from agbenchmark.utils.get_data_from_helicone import get_data_from_helicone from agbenchmark.utils.utils import ( AGENT_NAME, calculate_success_percentage, diff --git a/agbenchmark/utils/get_data_from_helicone.py b/agbenchmark/utils/get_data_from_helicone.py index f6e43e56..272593e4 100644 --- a/agbenchmark/utils/get_data_from_helicone.py +++ b/agbenchmark/utils/get_data_from_helicone.py @@ -42,6 +42,8 @@ query ExampleQuery($properties: [PropertyFilter!]){ operation_name = "ExampleQuery" + data = None + # Make the request try: response = requests.post( @@ -59,9 +61,7 @@ query ExampleQuery($properties: [PropertyFilter!]){ print(f"HTTP error occurred: {http_err}") except Exception as err: print(f"Other error occurred: {err}") - else: - if not data: - raise Exception("No data returned from Helicone") - return ( - data.get("data", {}).get("aggregatedHeliconeRequest", {}).get("cost", None) - ) + + if not data: + raise Exception("No data returned from Helicone") + return data.get("data", {}).get("aggregatedHeliconeRequest", {}).get("cost", None)