feat: Support Gemini via Vertex AI#2030
Conversation
kgilpin
left a comment
There was a problem hiding this comment.
Thanks! There are some build errors so I flipped this to Draft, temporarily.
|
Tests still failing. |
f8a16c3 to
aa92192
Compare
|
I forked the library that was ESM-only and added a CommonJS build (kriasoft/web-auth-library#32) — hopefully this will make it work without fuss. |
|
Thanks @dividedmind Do you have thoughts on the error we were seeing in the benchmark? Would really like to get a clean run though with Gemini. |
aa92192 to
a31dfaa
Compare
You mean the recitation problem? I'm looking at it next. |
99e51f5 to
f798f3e
Compare
| if (attempt < maxAttempts - 1 && tokens.length === 0) { | ||
| const nextAttempt = CompletionRetryDelay * 2 ** attempt; | ||
| warn(`Received ${JSON.stringify(cause)}, retrying in ${nextAttempt}ms`); | ||
| await new Promise<void>((resolve) => { | ||
| setTimeout(resolve, nextAttempt); | ||
| }); | ||
| continue; | ||
| } |
There was a problem hiding this comment.
Note that this doesn't attempt to prune input tokens
There was a problem hiding this comment.
No, I figured it's unlikely to be necessary with 2M token input limit...
| context: z.string(), | ||
| instructions: z.string(), | ||
| terms: z.array(z.string()), |
There was a problem hiding this comment.
The description of these properties could move out of the prompt and in to the schema
There was a problem hiding this comment.
True, although I tried to change it as little as possible as not to break anything.
Note: I needed to use a forked version of web-auth-library due to the latter only supporting ESM upstream.
This is less error-prone and doesn't seem to trigger watchdogs on Gemini flash that easily.
f798f3e to
f1e6372
Compare
|
🎉 This PR is included in version @appland/navie-v1.34.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Note to access the API you have to create a service account at https://console.cloud.google.com/apis/credentials — after creation you'll get a JSON file with credentials. This JSON has to be put into
GOOGLE_WEB_CREDENTIALSenvironment variable.Example configuration: