From 9d75712bae06a20c1dacc3a3ea2872f608239170 Mon Sep 17 00:00:00 2001 From: Silen Naihin Date: Mon, 31 Jul 2023 14:02:46 +0100 Subject: [PATCH] ci ofr auth --- .github/workflows/ci.yml | 12 ++++++++---- agbenchmark/utils/get_data_from_helicone.py | 14 ++++++++++++-- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cfc9c824..d51b5c4d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -281,8 +281,12 @@ jobs: - name: Generate charts run: | python agbenchmark/reports/processing/gen_combined_chart.py - env: - REPORT_LOCATION: 'reports' + + - name: Upload reports + if: always() + uses: actions/upload-artifact@v3 + with: + path: reports/combined_charts/* - name: Authenticate and Push to Branch if: (success() || failure()) && (github.event_name != 'pull_request') @@ -290,8 +294,8 @@ jobs: git config --global user.email "github-bot@agpt.co" git config --global user.name "Auto-GPT-Bot" - git add reports/*.png || echo "nothing to commit" - commit_message="Update radar charts - $(date +'%Y%m%d%H%M%S')" + git add reports/combined_charts/* || echo "nothing to commit" + commit_message="Add combined charts - $(date +'%Y%m%d%H%M%S')" git commit -m "${commit_message}" git stash current_branch=${{ github.ref_name }} diff --git a/agbenchmark/utils/get_data_from_helicone.py b/agbenchmark/utils/get_data_from_helicone.py index 68d885a5..1fa6e0e4 100644 --- a/agbenchmark/utils/get_data_from_helicone.py +++ b/agbenchmark/utils/get_data_from_helicone.py @@ -1,5 +1,5 @@ -import os import json +import os from typing import Optional import requests @@ -57,6 +57,10 @@ query ExampleQuery($properties: [PropertyFilter!]){ }, ) response.raise_for_status() # Raises a HTTPError if the response was an unsuccessful status code + + print(f"Response status code: {response.status_code}") + print(f"Response text: {response.text}") + data = response.json() except requests.HTTPError as http_err: print(f"HTTP error occurred: {http_err}") @@ -68,4 +72,10 @@ query ExampleQuery($properties: [PropertyFilter!]){ print(f"Other error occurred: {err}") raise - return data.get("data", {}).get("aggregatedHeliconeRequest", {}).get("cost", None) + print("this is the data!", data) + try: + return ( + data.get("data", {}).get("aggregatedHeliconeRequest", {}).get("cost", None) + ) + except Exception as err: + print(f"Error occurred: {err}")