@@ -58,6 +58,9 @@ import {
5858 onValue ,
5959 off
6060} from 'firebase/database' ;
61+ import { getGenerativeModel , getVertexAI , VertexAI } from 'firebase/vertexai' ;
62+ import { getDataConnect , DataConnect } from 'firebase/data-connect' ;
63+
6164/**
6265 * The config file should look like:
6366 *
@@ -287,7 +290,7 @@ function callAppCheck(app) {
287290}
288291
289292/**
290- * Analytics smoke test.
293+ * Performance smoke test.
291294 * Just make sure some functions can be called without obvious errors.
292295 */
293296function callPerformance ( app ) {
@@ -303,6 +306,32 @@ function callPerformance(app) {
303306 ) ;
304307}
305308
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+
306335/**
307336 * Run smoke tests for all products.
308337 * Comment out any products you want to ignore.
@@ -321,6 +350,8 @@ async function main() {
321350 callAnalytics ( app ) ;
322351 callPerformance ( app ) ;
323352 await callFunctions ( app ) ;
353+ await callVertexAI ( app ) ;
354+ callDataConnect ( app ) ;
324355 await authLogout ( app ) ;
325356 console . log ( 'DONE' ) ;
326357}
0 commit comments