Skip to content

feat: add Google PaLM 2 (Bison) API support #279#451

Open
Samir-atra wants to merge 1 commit intoarakoodev:tsfrom
Samir-atra:ts
Open

feat: add Google PaLM 2 (Bison) API support #279#451
Samir-atra wants to merge 1 commit intoarakoodev:tsfrom
Samir-atra:ts

Conversation

@Samir-atra
Copy link
Copy Markdown

@Samir-atra Samir-atra commented Apr 14, 2026

Pull Request: Add Google PaLM 2 (Bison) API Support (#279)

/claim #279

Overview

This PR adds full support for the Google PaLM 2 (Bison) API to the EdgeChains.js framework, fulfilling the requirements for bounty #279. This integration allows users to utilize text-bison and chat-bison models within the EdgeChains ecosystem.

Key Changes

  • New AI Provider: Implemented Palm2AI class in JS/edgechains/arakoodev/src/ai/src/lib/palm2/.
  • Fault Tolerance: Integrated @lifeomic/attempt for automatic retries and backoff, matching the framework's reliability standards.
  • Type Safety: Comprehensive TypeScript interfaces for all PaLM 2 request and response structures.
  • Jsonnet Integration: Demonstrated declarative prompt management via a new example.
  • One-Script Example: Added a complete Hono-based example in JS/edgechains/examples/palm2-chat/.

Important Note on Testing

The implementation has been fully validated using unit tests with mocks (see JS/edgechains/arakoodev/src/ai/src/tests/palm2.test.ts).

Note regarding live execution:
The legacy PaLM 2 (Bison) models used in this implementation are older models. During development, live end-to-end testing with a modern Gemini API key was not possible because Google has restricted access to the legacy v1beta2 Bison endpoints for newer projects/keys. However, the code follows the exact specifications for PaLM 2 payloads and has been verified against these specs via mocked responses.

Files Included

  • JS/edgechains/arakoodev/src/ai/src/lib/palm2/palm2.ts
  • JS/edgechains/arakoodev/src/ai/src/lib/palm2/types.ts
  • JS/edgechains/arakoodev/src/ai/src/tests/palm2.test.ts
  • JS/edgechains/examples/palm2-chat/* (Example project)
  • PALM2_BOUNTY_COMPLETION.md (Technical summary)

Verification

Run the following command to verify the implementation:

cd JS/edgechains/arakoodev
npm install
npx vitest src/ai/src/tests/palm2.test.ts

@github-actions
Copy link
Copy Markdown

CLA Assistant Lite bot: Thank you for your submission, we really appreciate it. Before we can accept your contribution, we ask that you sign the Arakoo Contributor License Agreement. You can sign the CLA by adding a new comment to this pull request and pasting exactly the following text.


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


You can retrigger this bot by commenting recheck in this Pull Request

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