From 005c295a0c3955f6592e3073078c313d47c07a77 Mon Sep 17 00:00:00 2001 From: Harsh Kumar Date: Tue, 3 Mar 2026 16:59:25 +0530 Subject: [PATCH 1/2] Deprecate GOOGLE_APPLICATION_CREDENTIALS in favor of GOOGLE_API_KEY MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GOOGLE_APPLICATION_CREDENTIALS is not referenced in any Python code — the backend and evaluation modules already use GOOGLE_API_KEY exclusively. Remove stale references from env templates, CI workflow, docs, and the seed-credentials Makefile target. Also removes unused GOOGLE_PROJECT_ID and GOOGLE_CLOUD_LOCATION. Signed-off-by: Harsh Kumar Patwa Signed-off-by: Harsh Kumar --- .github/workflows/ci-secret.yaml | 9 ------- Makefile | 6 ----- backend/.env.example | 3 --- backend/README.md | 27 ++++--------------- .../script_based_evaluation/.env.sample | 2 +- evaluation/script_based_evaluation/README.md | 5 +--- 6 files changed, 7 insertions(+), 45 deletions(-) diff --git a/.github/workflows/ci-secret.yaml b/.github/workflows/ci-secret.yaml index b8e94209..f9d72f43 100644 --- a/.github/workflows/ci-secret.yaml +++ b/.github/workflows/ci-secret.yaml @@ -45,20 +45,11 @@ jobs: run: | cp backend/.env.example backend/.env sed -i 's|{{GOOGLE_API_KEY}}|${{ secrets.GOOGLE_API_KEY }}|g' backend/.env - sed -i 's|{{GOOGLE_PROJECT_ID}}|${{ secrets.GOOGLE_PROJECT_ID }}|g' backend/.env - sed -i 's|{{PATH_TO_GOOGLE_APPLICATION_CREDENTIALS}}|src/secret.json|g' backend/.env sed -i 's|HF_TOKEN=|HF_TOKEN=${{ secrets.HF_TOKEN }}|g' backend/.env cp backend/.env.example evaluation/.env sed -i 's|{{GOOGLE_API_KEY}}|${{ secrets.GOOGLE_API_KEY }}|g' evaluation/.env - sed -i 's|{{GOOGLE_PROJECT_ID}}|${{ secrets.GOOGLE_PROJECT_ID }}|g' evaluation/.env - sed -i 's|{{PATH_TO_GOOGLE_APPLICATION_CREDENTIALS}}|src/secret.json|g' evaluation/.env sed -i 's|HF_TOKEN=|HF_TOKEN=${{ secrets.HF_TOKEN }}|g' evaluation/.env - - name: Copy Google credentials - env: - GOOGLE_SECRET_JSON: ${{ secrets.PATH_TO_GOOGLE_APPLICATION_CREDENTIALS }} - run: | - make seed-credentials - name: Build Docker image run: | make docker-up diff --git a/Makefile b/Makefile index aef86261..a20525fb 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,4 @@ FOLDERS=backend frontend evaluation -GOOGLE_SECRET_JSON?=$(HOME)/secret.json .PHONY: init init: @@ -34,11 +33,6 @@ docker-dev: @docker compose -f docker-compose.yml -f docker-compose.dev.yml up --build --wait # --- Development Commands --- -.PHONY: seed-credentials -seed-credentials: - @cp $(GOOGLE_SECRET_JSON) backend/src - @cp $(GOOGLE_SECRET_JSON) evaluation/auto_evaluation/src - .PHONY: changelog changelog: @git log --pretty=format:"%h%x09%an%x09%ad%x09%s" --date=short --since="2024-06-01" > CHANGELOG.md diff --git a/backend/.env.example b/backend/.env.example index 5ce3d60e..bd4168db 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -1,7 +1,4 @@ GOOGLE_API_KEY={{GOOGLE_API_KEY}} -GOOGLE_PROJECT_ID={{GOOGLE_PROJECT_ID}} -GOOGLE_APPLICATION_CREDENTIALS={{PATH_TO_GOOGLE_APPLICATION_CREDENTIALS}} -GOOGLE_CLOUD_LOCATION=us-central1 # Backend endpoint URL BACKEND_ENDPOINT=http://localhost:8000 diff --git a/backend/README.md b/backend/README.md index 9470f09c..3cf61b38 100644 --- a/backend/README.md +++ b/backend/README.md @@ -14,37 +14,20 @@ cp .env.example .env ``` -### Setting Up Google API Key and Credentials Variables - -There are 2 variables that needs to be set up +### Setting Up Google API Key - `GOOGLE_API_KEY` -This key is used to access the various google cloud functions. +This key is used to access the Google Gemini API. - Go to [Google Cloud Console](https://console.cloud.google.com/) - Create new project or select existing one - Enable required APIs: - Google Gemini API - - Vertex AI API - Go to APIs & Services > Credentials - Click "Create Credentials" > "API Key" - - Copy the generated key and it to the `.env` file - -- `GOOGLE_APPLICATION_CREDENTIALS` - Since most of the GCP functions / services would be used by our app, we need to have a special credential that would allow `ORAssistant`'s access to the GCP - Steps to set up Service Account Credentials: - - In Google Cloud Console, go to IAM & Admin > Service Accounts - - Click "Create Service Account" - Fill in service account details - - Grant required roles: - - Vertex AI User - - Vertex AI Service Agent - - Create key (JSON format) - - Download JSON file - - Store securely and add path to .env: - `GOOGLE_APPLICATION_CREDENTIALS=/path/to/credentials.json` - -**NOTE**: The user might need billing to be set up on google cloud account and make sure to name the file as `credentials.json` as this would be ignored by `.git` and wouldn't be exposed on Github + - Copy the generated key and add it to the `.env` file + +**NOTE**: The user might need billing to be set up on their Google Cloud account. ### Running ORAssistant with a Local Ollama Model diff --git a/evaluation/script_based_evaluation/.env.sample b/evaluation/script_based_evaluation/.env.sample index 7182ea5c..6f9ebd32 100644 --- a/evaluation/script_based_evaluation/.env.sample +++ b/evaluation/script_based_evaluation/.env.sample @@ -1,2 +1,2 @@ -GOOGLE_APPLICATION_CREDENTIALS={{GOOGLE_APPLICATION_CREDENTIALS}} +GOOGLE_API_KEY={{GOOGLE_API_KEY}} OPENAI_API_KEY={{OPENAI_API_KEY}} \ No newline at end of file diff --git a/evaluation/script_based_evaluation/README.md b/evaluation/script_based_evaluation/README.md index 8abd4e02..0030684b 100644 --- a/evaluation/script_based_evaluation/README.md +++ b/evaluation/script_based_evaluation/README.md @@ -18,12 +18,9 @@ This project automates the evaluation of language model responses using classifi Create a `.env` file in the root directory with the following variables: ```plaintext -GOOGLE_APPLICATION_CREDENTIALS=path/to/secret.json +GOOGLE_API_KEY=your_google_api_key OPENAI_API_KEY=your_openai_api_key # Required if testing against OpenAI models ``` -### Required Files - -- `secret.json`: Ensure you have a Google Vertex AI subscription and the necessary credentials file. ### Data Files From 0c2db56ec284fcdd0385f6c60322b22e96f9935b Mon Sep 17 00:00:00 2001 From: Harsh Kumar Date: Tue, 3 Mar 2026 18:32:23 +0530 Subject: [PATCH 2/2] Clean up stale --creds-path and secret.json references in eval README Remove references to --creds-path flag and secret.json that no longer exist in the evaluation scripts. Signed-off-by: Harsh Kumar Patwa Signed-off-by: Harsh Kumar --- evaluation/script_based_evaluation/README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/evaluation/script_based_evaluation/README.md b/evaluation/script_based_evaluation/README.md index 0030684b..7e3b439a 100644 --- a/evaluation/script_based_evaluation/README.md +++ b/evaluation/script_based_evaluation/README.md @@ -19,7 +19,7 @@ This project automates the evaluation of language model responses using classifi Create a `.env` file in the root directory with the following variables: ```plaintext GOOGLE_API_KEY=your_google_api_key -OPENAI_API_KEY=your_openai_api_key # Required if testing against OpenAI models +OPENAI_API_KEY=your_openai_api_key ``` ### Data Files @@ -43,11 +43,10 @@ OPENAI_API_KEY=your_openai_api_key # Required if testing against OpenAI models Use the following command to execute the script with customizable options: ```bash - python script.py --env-path /path/to/.env --creds-path /path/to/secret.json --iterations 10 --llms "base-gemini-1.5-flash,base-gpt-4o" --agent-retrievers "v1=http://url1.com,v2=http://url2.com" + python main.py --env-path /path/to/.env --iterations 10 --llms "base-gemini-1.5-flash,base-gpt-4o" --agent-retrievers "v1=http://url1.com,v2=http://url2.com" ``` - `--env-path`: Path to the `.env` file. - - `--creds-path`: Path to the `secret.json` file. - `--iterations`: Number of iterations per question. - `--llms`: Comma-separated list of LLMs to test. - `--agent-retrievers`: Comma-separated list of agent-retriever names and URLs. @@ -70,10 +69,10 @@ python main.py - Tests all available LLMs. - No additional agent-retrievers. -### b. Specify .env and secret.json Paths +### b. Specify .env Path ```bash -python main.py --env-path /path/to/.env --creds-path /path/to/secret.json +python main.py --env-path /path/to/.env ``` ### c. Customize Iterations and Select Specific LLMs @@ -93,7 +92,6 @@ python main.py --agent-retrievers "v1=http://url1.com,v2=http://url2.com" ```bash python main.py \ --env-path /path/to/.env \ - --creds-path /path/to/secret.json \ --iterations 10 \ --llms "base-gemini-1.5-flash,base-gpt-4o" \ --agent-retrievers "v1=http://url1.com,v2=http://url2.com"