@@ -131,18 +131,21 @@ describe('Count Tokens', () => {
131
131
modality : Modality . IMAGE ,
132
132
tokenCount : 258
133
133
} ) ;
134
- } else if ( testConfig . ai . backend . backendType === BackendType . VERTEX_AI ) {
134
+ } else if (
135
+ testConfig . ai . backend . backendType === BackendType . VERTEX_AI
136
+ ) {
135
137
const expectedImageTokens = 258 ;
136
138
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 ) ;
143
141
// 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
+ ) ;
146
149
}
147
150
} ) ;
148
151
@@ -242,7 +245,9 @@ describe('Count Tokens', () => {
242
245
tokenCount : 3
243
246
} ) ;
244
247
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.
246
251
expect ( audioDetails ) . to . deep . equal ( { modality : Modality . AUDIO } ) ; // Incorrect behavior because there's no tokenCount
247
252
}
248
253
} ) ;
0 commit comments