Skip to content

Fix Gemini generation config for PaLM2 support#565

Open
jonahsills wants to merge 1 commit into
arakoodev:tsfrom
jonahsills:codex/palm2-gemini-279
Open

Fix Gemini generation config for PaLM2 support#565
jonahsills wants to merge 1 commit into
arakoodev:tsfrom
jonahsills:codex/palm2-gemini-279

Conversation

@jonahsills
Copy link
Copy Markdown

@jonahsills jonahsills commented May 28, 2026

/claim #279

Summary

  • Fix the existing Gemini/PaLM-compatible provider so generation options are sent in Google's generationConfig request body instead of the Axios config object.
  • Export Gemini request/response TypeScript types and add a Palm2AI alias for the PaLM2/Gemini bounty API surface.
  • Add mocked unit coverage under src/ai/src/tests/palm2.
  • Add the required src/ai/src/testcases/palm2 Jsonnet prompt config.
  • Add a runnable Jsonnet-driven examples/palm2-chat example with no hardcoded prompt in TypeScript.

Requirement Checklist

  • Classes and TypeScript types added for PaLM2/Gemini API: yes
  • Unit testcases under a palm2 test path: yes
  • testcases/palm2 Jsonnet prompt config: yes
  • Example prompt lives in Jsonnet, not hardcoded in TypeScript: yes
  • Short demo included in this PR: yes
  • CLA signed and CI passing: yes

Validation

  • npx vitest run src/ai/src/tests/palm2/gemini.test.ts
  • npm run build
  • npm start from JS/edgechains/examples/palm2-chat

Demo

Short demo GIF:

PaLM2 Gemini demo

The example dry-runs without credentials and prints the Jsonnet-loaded chat options. Set GEMINI_API_KEY to call the live Google Generative Language API.

Full demo transcript, included so the output remains reviewable even if GitHub clips the embedded media:

EdgeChains #279 demo: PaLM2/Gemini Jsonnet example
Prompt, model, and generation settings are loaded from Jsonnet.

$ cd JS/edgechains/examples/palm2-chat
$ npm start

Loaded Jsonnet prompt:
Explain how EdgeChains can call Gemini through a typed provider in one sentence.

Loaded model:
gemini-pro

Dry-run request:
generationConfig.temperature = 0.2
generationConfig.maxOutputTokens = 128

No GEMINI_API_KEY found, so the example stops before the live API call.
Set GEMINI_API_KEY to call Google Generative Language API.

✓ npx vitest run src/ai/src/tests/palm2/gemini.test.ts

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 28, 2026

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@jonahsills
Copy link
Copy Markdown
Author

Short demo GIF for the PaLM2/Gemini Jsonnet example:

PaLM2 Gemini demo

The demo shows the example loading model, prompt, and generation settings from Jsonnet, then dry-running without credentials. Live API calls work by setting GEMINI_API_KEY.

@jonahsills
Copy link
Copy Markdown
Author

I have read the Arakoo CLA Document and I hereby sign the CLA

@jonahsills
Copy link
Copy Markdown
Author

recheck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant