FredF
Convex Community6mo ago
3 replies
Fred

Using ai-sdk/vertex-ai with agents

Hey, I'm trying to use agents in an environment where I can really only use vertex-ai.

I created the agent like this in convex/agents/coordinator.ts
import { Agent } from "@convex-dev/agent"
import { vertex } from "@ai-sdk/google-vertex"
import { components } from "../_generated/api"

export const agent = new Agent(components.agent, {
    chat: vertex.languageModel("claude-sonnet-4@20250514"),
    instructions: "You are a technical project manager. You are given a task and are responsible for coordinating the exploration, and then definition of tasks related to it."
})


However, when I run bun convex dev (or the equivalent with npx) I get
import { Agent } from "@convex-dev/agent"
import { vertex } from "@ai-sdk/google-vertex"
import { components } from "../_generated/api"

export const agent = new Agent(components.agent, {
    chat: vertex.languageModel("claude-sonnet-4@20250514"),
    instructions: "You are a technical project manager. You are given a task and are responsible for coordinating the exploration, and then definition of tasks related to it."
})


Is there any example of the agents using vertex-ai that I could look at? Or any pointers as to what might be wrong?
Was this page helpful?