Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Delete reports #201

Merged
merged 2 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agbenchmark/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import time
from pathlib import Path # noqa
from typing import Any, Dict, Generator
from helicone.lock import HeliconeLockManager

import pytest
from helicone.lock import HeliconeLockManager

from agbenchmark.reports.reports import (
finalize_reports,
Expand Down
4 changes: 2 additions & 2 deletions agbenchmark/start_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
from datetime import datetime
from pathlib import Path
from typing import Any
from helicone.lock import HeliconeLockManager
from agbenchmark.utils.utils import AGENT_NAME, calculate_dynamic_paths

import click
import pytest
from helicone.lock import HeliconeLockManager

from agbenchmark.utils.utils import AGENT_NAME, calculate_dynamic_paths

CURRENT_DIRECTORY = Path(__file__).resolve().parent
BENCHMARK_START_TIME = datetime.now().strftime("%Y-%m-%d-%H:%M")
Expand Down
34 changes: 11 additions & 23 deletions get_data_from_helicone.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
import requests

# Define the endpoint of your GraphQL server
url = 'https://www.helicone.ai/api/graphql'
url = "https://www.helicone.ai/api/graphql"

# Set the headers, usually you'd need to set the content type and possibly an authorization token
headers = {
"authorization": "Bearer sk-"
}
headers = {"authorization": "Bearer sk-"}

# Define the query, variables, and operation name
query = """
Expand All @@ -23,35 +21,25 @@
"""

variables = {
"limit": 100,
"filters": [
{
"property": {
"value": {
"equals": "beebot"
},
"name": "agent"
}
}
]
"limit": 100,
"filters": [{"property": {"value": {"equals": "beebot"}, "name": "agent"}}],
}

operation_name = "ExampleQuery"

# Make the request
response = requests.post(url, headers=headers, json={
"query": query,
"variables": variables,
"operationName": operation_name
})
response = requests.post(
url,
headers=headers,
json={"query": query, "variables": variables, "operationName": operation_name},
)
data = response.json()
total_tokens_sum = 0

for item in data['data']['heliconeRequest']:
total_tokens_sum += item['responseBody']['usage']['total_tokens']
for item in data["data"]["heliconeRequest"]:
total_tokens_sum += item["responseBody"]["usage"]["total_tokens"]

# Extract the data from the response (consider adding error checks)

print(json.dumps(data, indent=4, ensure_ascii=False))
print(total_tokens_sum)

32 changes: 0 additions & 32 deletions reports/Auto-GPT/file44_07-26-20-34.json

This file was deleted.

31 changes: 0 additions & 31 deletions reports/Auto-GPT/file45_07-26-20-34.json

This file was deleted.

Loading