File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -58,12 +58,7 @@ import {
58
58
onValue ,
59
59
off
60
60
} from 'firebase/database' ;
61
- import {
62
- getGenerativeModel ,
63
- getVertexAI ,
64
- InferenceMode ,
65
- VertexAI
66
- } from 'firebase/vertexai' ;
61
+ import { getGenerativeModel , getVertexAI } from 'firebase/vertexai' ;
67
62
import { getDataConnect , DataConnect } from 'firebase/data-connect' ;
68
63
69
64
/**
@@ -337,6 +332,15 @@ function callDataConnect(app) {
337
332
console . log ( '[DATACONNECT] initialized' ) ;
338
333
}
339
334
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
+
340
344
/**
341
345
* Run smoke tests for all products.
342
346
* Comment out any products you want to ignore.
@@ -358,6 +362,7 @@ async function main() {
358
362
await callVertexAI ( app ) ;
359
363
callDataConnect ( app ) ;
360
364
await authLogout ( app ) ;
365
+ await callVertex ( app ) ;
361
366
console . log ( 'DONE' ) ;
362
367
}
363
368
You can’t perform that action at this time.
0 commit comments