File tree Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ import {
5858 onValue ,
5959 off
6060} from 'firebase/database' ;
61- import { getGenerativeModel , getVertexAI , VertexAI } from 'firebase/vertexai ' ;
61+ import { getGenerativeModel , getAI } from 'firebase/ai ' ;
6262import { getDataConnect , DataConnect } from 'firebase/data-connect' ;
6363
6464/**
@@ -307,15 +307,15 @@ function callPerformance(app) {
307307}
308308
309309/**
310- * VertexAI smoke test.
310+ * AI smoke test.
311311 * Just make sure some functions can be called without obvious errors.
312312 */
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' } ) ;
313+ async function callAI ( app ) {
314+ console . log ( '[AI ] start' ) ;
315+ const ai = getAI ( app ) ;
316+ const model = getGenerativeModel ( ai , { model : 'gemini-1.5-flash' } ) ;
317317 const result = await model . countTokens ( 'abcdefg' ) ;
318- console . log ( `[VERTEXAI ] counted tokens: ${ result . totalTokens } ` ) ;
318+ console . log ( `[AI ] counted tokens: ${ result . totalTokens } ` ) ;
319319}
320320
321321/**
@@ -350,7 +350,7 @@ async function main() {
350350 callAnalytics ( app ) ;
351351 callPerformance ( app ) ;
352352 await callFunctions ( app ) ;
353- await callVertexAI ( app ) ;
353+ await callAI ( app ) ;
354354 callDataConnect ( app ) ;
355355 await authLogout ( app ) ;
356356 console . log ( 'DONE' ) ;
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ import {
8686 StorageReference ,
8787 deleteObject
8888} from 'firebase/storage' ;
89- import { getGenerativeModel , getVertexAI , VertexAI } from 'firebase/vertexai' ;
89+ import { getGenerativeModel , getAI , AI } from 'firebase/vertexai' ;
9090import { getDataConnect , DataConnect } from 'firebase/data-connect' ;
9191import { config , testAccount } from '../firebase-config' ;
9292import 'jest' ;
@@ -307,13 +307,13 @@ describe('MODULAR', () => {
307307 } ) ;
308308 } ) ;
309309
310- describe ( 'VERTEXAI ', ( ) => {
311- let vertexAI : VertexAI ;
310+ describe . only ( 'AI ', ( ) => {
311+ let ai : AI ;
312312 it ( 'getVertexAI()' , ( ) => {
313- vertexAI = getVertexAI ( app ) ;
313+ ai = getAI ( app ) ;
314314 } ) ;
315315 it ( 'getGenerativeModel() and countTokens()' , async ( ) => {
316- const model = getGenerativeModel ( vertexAI , { model : 'gemini-1.5-flash' } ) ;
316+ const model = getGenerativeModel ( ai , { model : 'gemini-1.5-flash' } ) ;
317317 expect ( model . model ) . toMatch ( / g e m i n i - 1 .5 - f l a s h $ / ) ;
318318 const result = await model . countTokens ( 'abcdefg' ) ;
319319 expect ( result . totalTokens ) . toBeTruthy ;
You can’t perform that action at this time.
0 commit comments