mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-21 06:04:44 +00:00
Add Vertex AI provider with ADC support
- Implement google-vertex provider in packages/ai - Support ADC (Application Default Credentials) via @google/generative-ai - Add Gemini model catalog for Vertex AI - Update packages/coding-agent to handle google-vertex provider
This commit is contained in:
parent
d747ec6e23
commit
214e7dae15
11 changed files with 788 additions and 4 deletions
|
|
@ -368,6 +368,46 @@ describe("Generate E2E Tests", () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe("Google Vertex Provider (gemini-3-flash-preview)", () => {
|
||||
const vertexProject = process.env.GOOGLE_CLOUD_PROJECT || process.env.GCLOUD_PROJECT;
|
||||
const vertexLocation = process.env.GOOGLE_CLOUD_LOCATION;
|
||||
const isVertexConfigured = Boolean(vertexProject && vertexLocation);
|
||||
const vertexOptions = { project: vertexProject, location: vertexLocation } as const;
|
||||
const llm = getModel("google-vertex", "gemini-3-flash-preview");
|
||||
|
||||
it.skipIf(!isVertexConfigured)("should complete basic text generation", { retry: 3 }, async () => {
|
||||
await basicTextGeneration(llm, vertexOptions);
|
||||
});
|
||||
|
||||
it.skipIf(!isVertexConfigured)("should handle tool calling", { retry: 3 }, async () => {
|
||||
await handleToolCall(llm, vertexOptions);
|
||||
});
|
||||
|
||||
it.skipIf(!isVertexConfigured)("should handle thinking", { retry: 3 }, async () => {
|
||||
const { ThinkingLevel } = await import("@google/genai");
|
||||
await handleThinking(llm, {
|
||||
...vertexOptions,
|
||||
thinking: { enabled: true, budgetTokens: 1024, level: ThinkingLevel.LOW },
|
||||
});
|
||||
});
|
||||
|
||||
it.skipIf(!isVertexConfigured)("should handle streaming", { retry: 3 }, async () => {
|
||||
await handleStreaming(llm, vertexOptions);
|
||||
});
|
||||
|
||||
it.skipIf(!isVertexConfigured)("should handle multi-turn with thinking and tools", { retry: 3 }, async () => {
|
||||
const { ThinkingLevel } = await import("@google/genai");
|
||||
await multiTurn(llm, {
|
||||
...vertexOptions,
|
||||
thinking: { enabled: true, budgetTokens: 1024, level: ThinkingLevel.MEDIUM },
|
||||
});
|
||||
});
|
||||
|
||||
it.skipIf(!isVertexConfigured)("should handle image input", { retry: 3 }, async () => {
|
||||
await handleImage(llm, vertexOptions);
|
||||
});
|
||||
});
|
||||
|
||||
describe.skipIf(!process.env.OPENAI_API_KEY)("OpenAI Completions Provider (gpt-4o-mini)", () => {
|
||||
const llm: Model<"openai-completions"> = { ...getModel("openai", "gpt-4o-mini"), api: "openai-completions" };
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue