@@ -58,6 +58,9 @@ import {
58
58
onValue ,
59
59
off
60
60
} from 'firebase/database' ;
61
+ import { getGenerativeModel , getVertexAI , VertexAI } from 'firebase/vertexai' ;
62
+ import { getDataConnect , DataConnect } from 'firebase/data-connect' ;
63
+
61
64
/**
62
65
* The config file should look like:
63
66
*
@@ -287,7 +290,7 @@ function callAppCheck(app) {
287
290
}
288
291
289
292
/**
290
- * Analytics smoke test.
293
+ * Performance smoke test.
291
294
* Just make sure some functions can be called without obvious errors.
292
295
*/
293
296
function callPerformance ( app ) {
@@ -303,6 +306,32 @@ function callPerformance(app) {
303
306
) ;
304
307
}
305
308
309
+ /**
310
+ * VertexAI smoke test.
311
+ * Just make sure some functions can be called without obvious errors.
312
+ */
313
+ async function callVertexAI ( app ) {
314
+ console . log ( '[VERTEXAI] start' ) ;
315
+ const vertexAI = getVertexAI ( app ) ;
316
+ const model = getGenerativeModel ( vertexAI , { model : 'gemini-1.5-flash' } ) ;
317
+ const result = await model . countTokens ( 'abcdefg' ) ;
318
+ console . log ( `[VERTEXAI] counted tokens: ${ result . totalTokens } ` ) ;
319
+ }
320
+
321
+ /**
322
+ * DataConnect smoke test.
323
+ * Just make sure some functions can be called without obvious errors.
324
+ */
325
+ function callDataConnect ( app ) {
326
+ console . log ( '[DATACONNECT] start' ) ;
327
+ getDataConnect ( app , {
328
+ location : 'a-location' ,
329
+ connector : 'a-connector' ,
330
+ service : 'service'
331
+ } ) ;
332
+ console . log ( '[DATACONNECT] initialized' ) ;
333
+ }
334
+
306
335
/**
307
336
* Run smoke tests for all products.
308
337
* Comment out any products you want to ignore.
@@ -321,6 +350,8 @@ async function main() {
321
350
callAnalytics ( app ) ;
322
351
callPerformance ( app ) ;
323
352
await callFunctions ( app ) ;
353
+ await callVertexAI ( app ) ;
354
+ callDataConnect ( app ) ;
324
355
await authLogout ( app ) ;
325
356
console . log ( 'DONE' ) ;
326
357
}
0 commit comments