-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add google support for llm-client (aka llm-polyglot) #69
Conversation
…ray for generateContentStream; add tests
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…bject for non-streaming completions
Cool stuff @jcamera! Have you thought about how this might interact with/support the caching features that Gemini has? It'd be an awesome capability to add. |
Hey thank you @ZECTBynmo! I'm just getting my feet wet here, but I did look at an example using GoogleAICacheManager. We could totally add methods on the Google provider to support this, and use the same input data types as the chat completion. |
Awesome! |
Hi @ZECTBynmo, fyi I added some pieces to allow using the Google cache manager. (A paid account is needed to use it) Added an example in /examples. I'd be curious to learn about your use cases, and happy to help if any issues! 🙂 |
llm-polyglot support for Google AI
This is using Google AI SDK (aka Gemini API) for Javascript - https://github.com/google-gemini/generative-ai-js
Be sure to set GOOGLE_API_KEY in your environment for use.
Features added:
systemInstruction
fieldcreateCacheManager
and used by passing in the cache name from the response intochat.completions.create
by setting it in{ additionalProperties: cacheName }}
(note: this requires a paid account)Note: polyfill added due to missing support for TextEncoderStream in bun.js (oven-sh/bun#5648)
we may also consider using their Vertex AI API which has some tentative support for using OpenAI libraries with Gemini - https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/call-gemini-using-openai-library
or directly using their Gemini Rest API - https://ai.google.dev/api/rest
Feedback is welcome :-)