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 {
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' ;
6762import { 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
You can’t perform that action at this time.
0 commit comments