Skip to content

Commit 1e487d5

Browse files
committed
Integrate with e2e test app
1 parent ff31b42 commit 1e487d5

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

e2e/sample-apps/modular.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,7 @@ import {
5858
onValue,
5959
off
6060
} from 'firebase/database';
61-
import {
62-
getGenerativeModel,
63-
getVertexAI,
64-
InferenceMode,
65-
VertexAI
66-
} from 'firebase/vertexai';
61+
import { getGenerativeModel, getVertexAI } from 'firebase/vertexai';
6762
import { getDataConnect, DataConnect } from 'firebase/data-connect';
6863

6964
/**
@@ -337,6 +332,15 @@ function callDataConnect(app) {
337332
console.log('[DATACONNECT] initialized');
338333
}
339334

335+
async function callVertex(app) {
336+
console.log('[VERTEX] start');
337+
const vertex = getVertexAI(app);
338+
const model = getGenerativeModel(vertex, { mode: 'prefer_on_device' });
339+
const result = await model.generateContent("What is Roko's Basalisk?");
340+
console.log(result.response.text());
341+
console.log('[VERTEX] initialized');
342+
}
343+
340344
/**
341345
* Run smoke tests for all products.
342346
* Comment out any products you want to ignore.
@@ -358,6 +362,7 @@ async function main() {
358362
await callVertexAI(app);
359363
callDataConnect(app);
360364
await authLogout(app);
365+
await callVertex(app);
361366
console.log('DONE');
362367
}
363368

0 commit comments

Comments
 (0)