From afadd8458f6da2e9a9371bd490615d818d505db1 Mon Sep 17 00:00:00 2001 From: Merwane Hamadi Date: Sun, 6 Aug 2023 12:20:21 -0700 Subject: [PATCH] Remove graphql logs Signed-off-by: Merwane Hamadi --- agbenchmark/agent_interface.py | 4 ++++ agbenchmark/utils/get_data_from_helicone.py | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/agbenchmark/agent_interface.py b/agbenchmark/agent_interface.py index 402120e8f3a..6b2d5bbe745 100644 --- a/agbenchmark/agent_interface.py +++ b/agbenchmark/agent_interface.py @@ -14,6 +14,10 @@ mock_test_str = os.getenv("MOCK_TEST") MOCK_FLAG = mock_test_str.lower() == "true" if mock_test_str else False +helicone_graphql_logs = os.getenv("HELICONE_GRAPHQL_LOGS") +HELICONE_GRAPHQL_LOGS = ( + helicone_graphql_logs.lower() == "true" if helicone_graphql_logs else False +) def run_agent( diff --git a/agbenchmark/utils/get_data_from_helicone.py b/agbenchmark/utils/get_data_from_helicone.py index 0de17cd3f50..51a24065dda 100644 --- a/agbenchmark/utils/get_data_from_helicone.py +++ b/agbenchmark/utils/get_data_from_helicone.py @@ -4,6 +4,7 @@ import requests +from agbenchmark.agent_interface import HELICONE_GRAPHQL_LOGS from agbenchmark.start_benchmark import BENCHMARK_START_TIME @@ -22,7 +23,6 @@ def get_data_from_helicone(challenge: str) -> Optional[float]: } } """ - print(query) variables = { "properties": [ @@ -37,8 +37,9 @@ def get_data_from_helicone(challenge: str) -> Optional[float]: {"value": {"equals": challenge}, "name": "challenge"}, ] } - - print(json.dumps(variables, indent=4)) + if HELICONE_GRAPHQL_LOGS: + print(query) + print(json.dumps(variables, indent=4)) operation_name = "ExampleQuery"