The vertex model doesn't work on vercel edge. This is cause by the auth-library not being compatible with the edge. This could be easily replaced by a vanilla js script:
const { expires_in, access_token } = await generateToken({
client_email:process.env.GOOGLE_CLOUD_CLIENT_EMAIL,
private_key: process.env.GOOGLE_CLOUD_PRIVATE_KEY?.replace(/\\n/gm, "\n"), // Fix issue with new line
private_key_id: process.env.GOOGLE_CLOUD_PRIVATE_KEY_ID,
scopes: ["https://www.googleapis.com/auth/cloud-platform"]
})
Use Case
Would be great to decouple vertex and auto so that we can use our custom auth script like the one above or simply add the script above directly in the ai-sdk model so that it would work on vercel edge.
Feature Description
The vertex model doesn't work on vercel edge. This is cause by the auth-library not being compatible with the edge. This could be easily replaced by a vanilla js script:
It can easily be used like this:
Use Case
Would be great to decouple vertex and auto so that we can use our custom auth script like the one above or simply add the script above directly in the ai-sdk model so that it would work on vercel edge.
Additional context
No response