linter fixes

This commit is contained in:
Silen Naihin
2023-07-31 13:28:01 +01:00
parent db49e8de15
commit 2ec306e850
2 changed files with 7 additions and 7 deletions

View File

@@ -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,

View File

@@ -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)