Skip to content

Commit 862866e

Browse files
committed
Fix e2e to use new AI package
1 parent be06e0a commit 862866e

File tree

4 files changed

+1128
-1078
lines changed

4 files changed

+1128
-1078
lines changed

e2e/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"author": "",
1818
"license": "ISC",
1919
"dependencies": {
20-
"firebase": "11.3.0"
20+
"firebase": "^11.8.0-20250512211235"
2121
},
2222
"devDependencies": {
2323
"@babel/core": "7.26.8",

e2e/sample-apps/modular.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ import {
5858
onValue,
5959
off
6060
} from 'firebase/database';
61-
import { getGenerativeModel, getAI } from 'firebase/ai';
61+
import { getGenerativeModel, getAI, VertexAIBackend } from 'firebase/ai';
6262
import { getDataConnect, DataConnect } from 'firebase/data-connect';
6363

6464
/**
@@ -312,7 +312,7 @@ function callPerformance(app) {
312312
*/
313313
async function callAI(app) {
314314
console.log('[AI] start');
315-
const ai = getAI(app);
315+
const ai = getAI(app, { backend: new VertexAIBackend() });
316316
const model = getGenerativeModel(ai, { model: 'gemini-1.5-flash' });
317317
const result = await model.countTokens('abcdefg');
318318
console.log(`[AI] counted tokens: ${result.totalTokens}`);

e2e/tests/modular.test.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,12 @@ import {
8686
StorageReference,
8787
deleteObject
8888
} from 'firebase/storage';
89-
import { getGenerativeModel, getAI, AI } from 'firebase/vertexai';
89+
import {
90+
getGenerativeModel,
91+
getAI,
92+
AI,
93+
VertexAIBackend
94+
} from 'firebase/vertexai';
9095
import { getDataConnect, DataConnect } from 'firebase/data-connect';
9196
import { config, testAccount } from '../firebase-config';
9297
import 'jest';
@@ -307,10 +312,10 @@ describe('MODULAR', () => {
307312
});
308313
});
309314

310-
describe.only('AI', () => {
315+
describe('AI', () => {
311316
let ai: AI;
312317
it('getVertexAI()', () => {
313-
ai = getAI(app);
318+
ai = getAI(app, { backend: new VertexAIBackend() });
314319
});
315320
it('getGenerativeModel() and countTokens()', async () => {
316321
const model = getGenerativeModel(ai, { model: 'gemini-1.5-flash' });

0 commit comments

Comments
 (0)