File tree 2 files changed +13
-13
lines changed
2 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ import {
58
58
onValue ,
59
59
off
60
60
} from 'firebase/database' ;
61
- import { getGenerativeModel , getVertexAI , VertexAI } from 'firebase/vertexai ' ;
61
+ import { getGenerativeModel , getAI } from 'firebase/ai ' ;
62
62
import { getDataConnect , DataConnect } from 'firebase/data-connect' ;
63
63
64
64
/**
@@ -307,15 +307,15 @@ function callPerformance(app) {
307
307
}
308
308
309
309
/**
310
- * VertexAI smoke test.
310
+ * AI smoke test.
311
311
* Just make sure some functions can be called without obvious errors.
312
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' } ) ;
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' } ) ;
317
317
const result = await model . countTokens ( 'abcdefg' ) ;
318
- console . log ( `[VERTEXAI ] counted tokens: ${ result . totalTokens } ` ) ;
318
+ console . log ( `[AI ] counted tokens: ${ result . totalTokens } ` ) ;
319
319
}
320
320
321
321
/**
@@ -350,7 +350,7 @@ async function main() {
350
350
callAnalytics ( app ) ;
351
351
callPerformance ( app ) ;
352
352
await callFunctions ( app ) ;
353
- await callVertexAI ( app ) ;
353
+ await callAI ( app ) ;
354
354
callDataConnect ( app ) ;
355
355
await authLogout ( app ) ;
356
356
console . log ( 'DONE' ) ;
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ import {
86
86
StorageReference ,
87
87
deleteObject
88
88
} from 'firebase/storage' ;
89
- import { getGenerativeModel , getVertexAI , VertexAI } from 'firebase/vertexai' ;
89
+ import { getGenerativeModel , getAI , AI } from 'firebase/vertexai' ;
90
90
import { getDataConnect , DataConnect } from 'firebase/data-connect' ;
91
91
import { config , testAccount } from '../firebase-config' ;
92
92
import 'jest' ;
@@ -307,13 +307,13 @@ describe('MODULAR', () => {
307
307
} ) ;
308
308
} ) ;
309
309
310
- describe ( 'VERTEXAI ', ( ) => {
311
- let vertexAI : VertexAI ;
310
+ describe . only ( 'AI ', ( ) => {
311
+ let ai : AI ;
312
312
it ( 'getVertexAI()' , ( ) => {
313
- vertexAI = getVertexAI ( app ) ;
313
+ ai = getAI ( app ) ;
314
314
} ) ;
315
315
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' } ) ;
317
317
expect ( model . model ) . toMatch ( / g e m i n i - 1 .5 - f l a s h $ / ) ;
318
318
const result = await model . countTokens ( 'abcdefg' ) ;
319
319
expect ( result . totalTokens ) . toBeTruthy ;
You can’t perform that action at this time.
0 commit comments