ZaidZ
Convex Community6mo ago
2 replies
Zaid

Upgrading AI SDK to v5 in Convex RAG component

I am trying to do the following in my rag.ts:
export const rag = new RAG(components.rag, {
  textEmbeddingModel: google.textEmbeddingModel("gemini-embedding-001"),
  embeddingDimension: 2048,
});



I want to use the new gemini-embedding-001 model for my application but I cannot do so because of this error:
"Uncaught AI_UnsupportedModelVersionError: Unsupported model version. AI SDK 4 only supports models that implement specification version "v1". Please upgrade to AI SDK 5 to use this model."

I see that the convex rag component uses "ai": "^4.3.16" which might need a upgrade to v5 for compatibility.

My project is using:
    "ai": "^5.0.0",
    "@ai-sdk/google": "^2.0.0",


Let me know if you need more information about my project.
Was this page helpful?