Skip to content

Commit 15d114c

Browse files
committed
Integrate with e2e test app
1 parent 25c6397 commit 15d114c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

e2e/sample-apps/modular.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ import {
5858
onValue,
5959
off
6060
} from 'firebase/database';
61-
import { getGenerativeModel, getVertexAI, VertexAI } from 'firebase/vertexai';
61+
import { getGenerativeModel, getVertexAI, InferenceMode, VertexAI } from 'firebase/vertexai';
6262
import { getDataConnect, DataConnect } from 'firebase/data-connect';
6363

6464
/**
@@ -332,6 +332,15 @@ function callDataConnect(app) {
332332
console.log('[DATACONNECT] initialized');
333333
}
334334

335+
async function callVertex(app) {
336+
console.log('[VERTEX] start');
337+
const vertex = getVertexAI(app)
338+
const model = getGenerativeModel(vertex, {mode: InferenceMode.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+
335344
/**
336345
* Run smoke tests for all products.
337346
* Comment out any products you want to ignore.
@@ -353,6 +362,7 @@ async function main() {
353362
await callVertexAI(app);
354363
callDataConnect(app);
355364
await authLogout(app);
365+
await callVertex(app);
356366
console.log('DONE');
357367
}
358368

0 commit comments

Comments
 (0)