@@ -131,18 +131,21 @@ describe('Count Tokens', () => {
131131 modality : Modality . IMAGE ,
132132 tokenCount : 258
133133 } ) ;
134- } else if ( testConfig . ai . backend . backendType === BackendType . VERTEX_AI ) {
134+ } else if (
135+ testConfig . ai . backend . backendType === BackendType . VERTEX_AI
136+ ) {
135137 const expectedImageTokens = 258 ;
136138 expect ( response . totalTokens ) . to . equal ( expectedImageTokens ) ;
137- expect (
138- response . totalBillableCharacters ,
139- ) . to . be . undefined ; // Incorrect behavior
140- expect (
141- response . promptTokensDetails ! . length ,
142- ) . to . equal ( 1 ) ;
139+ expect ( response . totalBillableCharacters ) . to . be . undefined ; // Incorrect behavior
140+ expect ( response . promptTokensDetails ! . length ) . to . equal ( 1 ) ;
143141 // Note: No text tokens are present for Vertex AI with image-only input.
144- expect ( response . promptTokensDetails ! [ 0 ] ) . to . deep . equal ( { modality : Modality . IMAGE , tokenCount : 258 } )
145- expect ( response . promptTokensDetails ! [ 0 ] . tokenCount ) . to . equal ( expectedImageTokens ) ;
142+ expect ( response . promptTokensDetails ! [ 0 ] ) . to . deep . equal ( {
143+ modality : Modality . IMAGE ,
144+ tokenCount : 258
145+ } ) ;
146+ expect ( response . promptTokensDetails ! [ 0 ] . tokenCount ) . to . equal (
147+ expectedImageTokens
148+ ) ;
146149 }
147150 } ) ;
148151
@@ -242,7 +245,9 @@ describe('Count Tokens', () => {
242245 tokenCount : 3
243246 } ) ;
244247 const expectedText = 'Describe these:' ;
245- expect ( response . totalBillableCharacters ) . to . equal ( expectedText . length - 1 ) ; // Note: BillableCharacters observed as (text length - 1) for Vertex AI.
248+ expect ( response . totalBillableCharacters ) . to . equal (
249+ expectedText . length - 1
250+ ) ; // Note: BillableCharacters observed as (text length - 1) for Vertex AI.
246251 expect ( audioDetails ) . to . deep . equal ( { modality : Modality . AUDIO } ) ; // Incorrect behavior because there's no tokenCount
247252 }
248253 } ) ;
0 commit comments