-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat: Support Gemini via Vertex AI #2030
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this doesn't attempt to prune input tokens
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description of these properties could move out of the prompt and in to the schema
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_CREDENTIALS
environment variable.Example configuration: