From a087ea9c31bfe04b0aeaf8dd2a74e3074d8a7213 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Tue, 22 Apr 2025 16:11:55 -0400 Subject: [PATCH] Update Vertex AI sample to use Firebase AI API --- vertexai/main.ts | 8 ++++---- vertexai/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vertexai/main.ts b/vertexai/main.ts index 78356cd29..08361dccb 100644 --- a/vertexai/main.ts +++ b/vertexai/main.ts @@ -21,7 +21,7 @@ import { initializeAppCheck, ReCaptchaEnterpriseProvider, } from "firebase/app-check"; -import { getVertexAI, getGenerativeModel } from "firebase/vertexai"; +import { getAI, getGenerativeModel } from "firebase/ai"; async function main() { const app = initializeApp(firebaseConfig); @@ -33,11 +33,11 @@ async function main() { provider: new ReCaptchaEnterpriseProvider(RECAPTCHA_ENTERPRISE_SITE_KEY), }); - // Get VertexAI instance - const vertexAI = getVertexAI(app); + // Get AI instance + const ai = getAI(app); // Get a Gemini model const model = getGenerativeModel( - vertexAI, + ai, { model: "gemini-2.0-flash" } ); // Call generateContent with a string or Content(s) diff --git a/vertexai/package.json b/vertexai/package.json index 6c859d63f..992a7c4c1 100644 --- a/vertexai/package.json +++ b/vertexai/package.json @@ -26,6 +26,6 @@ "format": "prettier --write ." }, "dependencies": { - "firebase": "^11.1.0" + "firebase": "^11.7.0" } }