File tree 2 files changed +10
-6
lines changed
langchain-google-common/src/utils
langchain-google-webauth/src/tests
2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -1422,10 +1422,8 @@ export function getGeminiAPI(config?: GeminiAPIConfig): GoogleAIAPI {
1422
1422
}
1423
1423
1424
1424
// Add thinking configuration if explicitly set
1425
- if (
1426
- typeof parameters . maxReasoningTokens !== "undefined" &&
1427
- parameters . maxReasoningTokens !== 0
1428
- ) {
1425
+ // Note that you cannot have thinkingBudget set to 0 and includeThoughts true
1426
+ if ( typeof parameters . maxReasoningTokens !== "undefined" ) {
1429
1427
ret . thinkingConfig = {
1430
1428
thinkingBudget : parameters . maxReasoningTokens ,
1431
1429
// TODO: Expose this configuration to the user once google fully supports it
Original file line number Diff line number Diff line change @@ -357,12 +357,12 @@ const testGeminiModelNames = [
357
357
apiVersion : "v1" ,
358
358
} ,
359
359
{
360
- modelName : "gemini-2.5-pro-exp-03-25 " ,
360
+ modelName : "gemini-2.5-pro-preview-05-06 " ,
361
361
platformType : "gai" ,
362
362
apiVersion : "v1beta" ,
363
363
} ,
364
364
{
365
- modelName : "gemini-2.5-pro-exp-03-25 " ,
365
+ modelName : "gemini-2.5-pro-preview-05-06 " ,
366
366
platformType : "gcp" ,
367
367
apiVersion : "v1" ,
368
368
} ,
@@ -380,6 +380,7 @@ const testGeminiModelDelay: Record<string, number> = {
380
380
"gemini-2.0-flash-exp" : 10000 ,
381
381
"gemini-2.0-flash-thinking-exp-1219" : 10000 ,
382
382
"gemini-2.5-pro-exp-03-25" : 10000 ,
383
+ "gemini-2.5-pro-preview-05-06" : 10000 ,
383
384
"gemini-2.5-flash-preview-04-17" : 10000 ,
384
385
} ;
385
386
@@ -1007,6 +1008,11 @@ describe.each(testGeminiModelNames)(
1007
1008
) ;
1008
1009
console . log ( res ) ;
1009
1010
expect ( res . content ) . toMatch ( / ^ 1 \/ 6 / ) ;
1011
+ expect ( res ) . toHaveProperty ( "usage_metadata" ) ;
1012
+ expect ( res . usage_metadata ) . toHaveProperty ( "output_token_details" ) ;
1013
+ expect ( res . usage_metadata ! . output_token_details ) . not . toHaveProperty (
1014
+ "reasoning"
1015
+ ) ;
1010
1016
} ) ;
1011
1017
}
1012
1018
) ;
You can’t perform that action at this time.
0 commit comments