Skip to content

feat: add Google PaLM 2 API support#620

Open
cwjcwj95 wants to merge 1 commit into
arakoodev:tsfrom
cwjcwj95:ts
Open

feat: add Google PaLM 2 API support#620
cwjcwj95 wants to merge 1 commit into
arakoodev:tsfrom
cwjcwj95:ts

Conversation

@cwjcwj95

Copy link
Copy Markdown

Summary

This PR adds Google PaLM 2 API support to the EdgeChains JavaScript SDK.

Changes

  • Palm2AI class (lib/palm2/palm2.ts): Core API client with generateText, chat, and generateEmbeddings methods
  • TypeScript types (types/index.ts): Added Palm2Model union type for all supported models
  • Unit tests (tests/palm2.test.ts): 8 test cases covering text generation, default params, error handling, retry logic, embeddings, and chat alias
  • Jsonnet example (examples/palm2-chat/): Complete example with main.jsonnet, secrets.jsonnet, TypeScript callback, and README
  • Export (index.ts): Exported Palm2AI from main entry point

Supported Models

  • text-bison-001 (default)
  • text-bison-002
  • text-bison
  • text-unicorn-001
  • chat-bison-001
  • chat-bison-002
  • chat-bison

API Usage

import { Palm2AI } from "@arakoodev/edgechains.js/ai";

const palm2 = new Palm2AI({ apiKey: "your-api-key" });
const response = await palm2.chat({ prompt: "Hello, how are you?" });
console.log(response.content);

Closes #279

- Add Palm2AI class with generateText, chat, and generateEmbeddings methods
- Add Palm2Model types to types/index.ts
- Add unit tests in tests/palm2.test.ts
- Add jsonnet example in examples/palm2-chat/
- Export Palm2AI from index.ts

Closes arakoodev#279
@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


EdgeChains Bot seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request

@cwjcwj95

Copy link
Copy Markdown
Author

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

@cwjcwj95

Copy link
Copy Markdown
Author

recheck

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BOUNTY: add support for Google Palm2 API in javascript/typescript

1 participant