File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,12 @@ import {
58
58
onValue ,
59
59
off
60
60
} from 'firebase/database' ;
61
- import { getGenerativeModel , getVertexAI , InferenceMode , VertexAI } from 'firebase/vertexai' ;
61
+ import {
62
+ getGenerativeModel ,
63
+ getVertexAI ,
64
+ InferenceMode ,
65
+ VertexAI
66
+ } from 'firebase/vertexai' ;
62
67
import { getDataConnect , DataConnect } from 'firebase/data-connect' ;
63
68
64
69
/**
@@ -334,10 +339,12 @@ function callDataConnect(app) {
334
339
335
340
async function callVertex ( app ) {
336
341
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 ( ) )
342
+ const vertex = getVertexAI ( app ) ;
343
+ const model = getGenerativeModel ( vertex , {
344
+ mode : InferenceMode . PREFER_ON_DEVICE
345
+ } ) ;
346
+ const result = await model . generateContent ( "What is Roko's Basalisk?" ) ;
347
+ console . log ( result . response . text ( ) ) ;
341
348
console . log ( '[VERTEX] initialized' ) ;
342
349
}
343
350
You can’t perform that action at this time.
0 commit comments