From 6088fde03e2d693f8a03942e5507b1c6bf27c17d Mon Sep 17 00:00:00 2001 From: Mark McDonald Date: Thu, 30 Apr 2026 10:55:32 +0800 Subject: [PATCH 1/9] fix: use maintainer approval instead of a CI environment --- .github/workflows/ci.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4f713a..20e4dd7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,8 +19,6 @@ on: jobs: test-go: runs-on: ubuntu-latest - # This gates the job until a maintainer approves - environment: CI steps: - uses: actions/checkout@v4 with: @@ -40,7 +38,6 @@ jobs: test-java: runs-on: ubuntu-latest - environment: CI steps: - uses: actions/checkout@v4 with: @@ -60,7 +57,6 @@ jobs: test-javascript: runs-on: ubuntu-latest - environment: CI steps: - uses: actions/checkout@v4 with: @@ -83,7 +79,6 @@ jobs: test-python: runs-on: ubuntu-latest - environment: CI steps: - uses: actions/checkout@v4 with: From 87ace1699b658cb5cbe9864def006c9f2ceb0843 Mon Sep 17 00:00:00 2001 From: Mark McDonald Date: Thu, 30 Apr 2026 11:04:54 +0800 Subject: [PATCH 2/9] fix: use JDK24 for java tests --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20e4dd7..399ac59 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,10 +43,10 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha || github.event.inputs.ref || github.ref }} persist-credentials: false - - name: Set up JDK 21 + - name: Set up JDK 24 uses: actions/setup-java@v4 with: - java-version: '21' + java-version: '24' distribution: 'temurin' cache: maven - name: Run Java tests From 13a9984735f2a66766acfa017f139b0a6d1cdf12 Mon Sep 17 00:00:00 2001 From: Mark McDonald Date: Thu, 30 Apr 2026 11:08:15 +0800 Subject: [PATCH 3/9] fix: google_api_key -> gemini_api_key --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 399ac59..9aa35c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: - name: Run Go tests working-directory: ./go env: - GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} + GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} run: go test ./... test-java: @@ -52,7 +52,7 @@ jobs: - name: Run Java tests working-directory: ./java env: - GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} + GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} run: mvn -B test test-javascript: @@ -74,7 +74,7 @@ jobs: - name: Run JavaScript tests working-directory: ./javascript env: - GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} + GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} run: node --test *.test.js test-python: @@ -94,5 +94,5 @@ jobs: - name: Run Python tests working-directory: ./python env: - GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} + GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} run: pytest . From b2942ca4f3fdb796baa364b28ec5554ff96e9471 Mon Sep 17 00:00:00 2001 From: Mark McDonald Date: Thu, 30 Apr 2026 11:08:36 +0800 Subject: [PATCH 4/9] fix: use python unittest framework --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9aa35c1..369ddd5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,4 +95,5 @@ jobs: working-directory: ./python env: GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} - run: pytest . + # Discover and run all .py files as tests + run: python -m unittest discover -p "*.py" From c249e4611e27f2cb033690ad852616c00467f9c7 Mon Sep 17 00:00:00 2001 From: Mark McDonald Date: Thu, 30 Apr 2026 11:08:55 +0800 Subject: [PATCH 5/9] fix: remove api key check from 1 test that has it --- javascript/grounding.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/javascript/grounding.js b/javascript/grounding.js index 0920ec6..9fb4a95 100644 --- a/javascript/grounding.js +++ b/javascript/grounding.js @@ -17,12 +17,6 @@ import { GoogleGenAI } from "@google/genai"; -// Ensure the API key is set in your environment variables -if (!process.env.GEMINI_API_KEY) { - throw new Error("GEMINI_API_KEY environment variable not set."); -} - -// Define the thinking model centrally const MODEL_ID = "gemini-2.5-flash"; const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY }); From b4b227d33438c513af6a315fcb27fcdc2e7792dc Mon Sep 17 00:00:00 2001 From: Mark McDonald Date: Thu, 30 Apr 2026 11:19:59 +0800 Subject: [PATCH 6/9] fix: java needs to use GOOGLE_API_KEY --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 369ddd5..081a8fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,7 +52,7 @@ jobs: - name: Run Java tests working-directory: ./java env: - GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} + GOOGLE_API_KEY: ${{ secrets.GEMINI_API_KEY }} run: mvn -B test test-javascript: From 780ddf6d9f660a2310c011efe7b7dd3318a5bda7 Mon Sep 17 00:00:00 2001 From: Mark McDonald Date: Thu, 30 Apr 2026 11:58:40 +0800 Subject: [PATCH 7/9] fix: increase go test timeout so they can all run --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 081a8fd..dc8bd39 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,7 @@ jobs: working-directory: ./go env: GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} - run: go test ./... + run: go test -timeout 20m ./... test-java: runs-on: ubuntu-latest From 66d6d06feb4fec1919c9cea6cd078911c7606baa Mon Sep 17 00:00:00 2001 From: Mark McDonald Date: Thu, 30 Apr 2026 11:59:20 +0800 Subject: [PATCH 8/9] fix: increase token count for model param tests to ensure they don't fail on MAX_TOKENS --- go/configure_model_parameters.go | 3 +-- .../main/java/com/example/gemini/ConfigureModelParameters.java | 2 +- javascript/configure_model_parameters.js | 2 +- python/configure_model_parameters.py | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/go/configure_model_parameters.go b/go/configure_model_parameters.go index bdfdf6f..c205cf4 100644 --- a/go/configure_model_parameters.go +++ b/go/configure_model_parameters.go @@ -21,9 +21,8 @@ func ConfigureModelParameters() (*genai.GenerateContentResponse, error) { // Create local variables for parameters. candidateCount := int32(1) - maxOutputTokens := int32(20) + maxOutputTokens := int32(200) temperature := float32(1.0) - response, err := client.Models.GenerateContent( ctx, "gemini-2.5-flash", diff --git a/java/src/main/java/com/example/gemini/ConfigureModelParameters.java b/java/src/main/java/com/example/gemini/ConfigureModelParameters.java index dbcd38e..6396b19 100644 --- a/java/src/main/java/com/example/gemini/ConfigureModelParameters.java +++ b/java/src/main/java/com/example/gemini/ConfigureModelParameters.java @@ -32,7 +32,7 @@ public class ConfigureModelParameters { GenerateContentConfig.builder() .candidateCount(1) .stopSequences(List.of("x")) - .maxOutputTokens(20) + .maxOutputTokens(200) .temperature(1.0F) .build(); diff --git a/javascript/configure_model_parameters.js b/javascript/configure_model_parameters.js index 41b50b6..ad2059b 100644 --- a/javascript/configure_model_parameters.js +++ b/javascript/configure_model_parameters.js @@ -29,7 +29,7 @@ export async function configureModelParameters() { config: { candidateCount: 1, stopSequences: ["x"], - maxOutputTokens: 20, + maxOutputTokens: 200, temperature: 1.0, }, }); diff --git a/python/configure_model_parameters.py b/python/configure_model_parameters.py index 48726ee..cdad8d6 100644 --- a/python/configure_model_parameters.py +++ b/python/configure_model_parameters.py @@ -29,7 +29,7 @@ def test_configure_model_parameters(self): config=types.GenerateContentConfig( candidate_count=1, stop_sequences=["x"], - max_output_tokens=20, + max_output_tokens=200, temperature=1.0, ), ) From c292fb100dd3b61b05d4ed899c317e9068f0bedb Mon Sep 17 00:00:00 2001 From: Mark McDonald Date: Thu, 30 Apr 2026 12:37:12 +0800 Subject: [PATCH 9/9] Revert "fix: increase token count for model param tests to ensure they don't fail on MAX_TOKENS" This reverts commit 66d6d06feb4fec1919c9cea6cd078911c7606baa. --- go/configure_model_parameters.go | 3 ++- .../main/java/com/example/gemini/ConfigureModelParameters.java | 2 +- javascript/configure_model_parameters.js | 2 +- python/configure_model_parameters.py | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/go/configure_model_parameters.go b/go/configure_model_parameters.go index c205cf4..bdfdf6f 100644 --- a/go/configure_model_parameters.go +++ b/go/configure_model_parameters.go @@ -21,8 +21,9 @@ func ConfigureModelParameters() (*genai.GenerateContentResponse, error) { // Create local variables for parameters. candidateCount := int32(1) - maxOutputTokens := int32(200) + maxOutputTokens := int32(20) temperature := float32(1.0) + response, err := client.Models.GenerateContent( ctx, "gemini-2.5-flash", diff --git a/java/src/main/java/com/example/gemini/ConfigureModelParameters.java b/java/src/main/java/com/example/gemini/ConfigureModelParameters.java index 6396b19..dbcd38e 100644 --- a/java/src/main/java/com/example/gemini/ConfigureModelParameters.java +++ b/java/src/main/java/com/example/gemini/ConfigureModelParameters.java @@ -32,7 +32,7 @@ public class ConfigureModelParameters { GenerateContentConfig.builder() .candidateCount(1) .stopSequences(List.of("x")) - .maxOutputTokens(200) + .maxOutputTokens(20) .temperature(1.0F) .build(); diff --git a/javascript/configure_model_parameters.js b/javascript/configure_model_parameters.js index ad2059b..41b50b6 100644 --- a/javascript/configure_model_parameters.js +++ b/javascript/configure_model_parameters.js @@ -29,7 +29,7 @@ export async function configureModelParameters() { config: { candidateCount: 1, stopSequences: ["x"], - maxOutputTokens: 200, + maxOutputTokens: 20, temperature: 1.0, }, }); diff --git a/python/configure_model_parameters.py b/python/configure_model_parameters.py index cdad8d6..48726ee 100644 --- a/python/configure_model_parameters.py +++ b/python/configure_model_parameters.py @@ -29,7 +29,7 @@ def test_configure_model_parameters(self): config=types.GenerateContentConfig( candidate_count=1, stop_sequences=["x"], - max_output_tokens=200, + max_output_tokens=20, temperature=1.0, ), )