Skip to content

Commit 62f6523

Browse files
authored
fix(google-common): don't set includeThoughts (#8123)
1 parent 5b515c4 commit 62f6523

File tree

1 file changed

+6
-2
lines changed
  • libs/langchain-google-common/src/utils

1 file changed

+6
-2
lines changed

libs/langchain-google-common/src/utils/gemini.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,10 +1378,14 @@ export function getGeminiAPI(config?: GeminiAPIConfig): GoogleAIAPI {
13781378
}
13791379

13801380
// Add thinking configuration if explicitly set
1381-
if (typeof parameters.maxReasoningTokens !== "undefined") {
1381+
if (
1382+
typeof parameters.maxReasoningTokens !== "undefined" &&
1383+
parameters.maxReasoningTokens !== 0
1384+
) {
13821385
ret.thinkingConfig = {
13831386
thinkingBudget: parameters.maxReasoningTokens,
1384-
includeThoughts: true,
1387+
// TODO: Expose this configuration to the user once google fully supports it
1388+
includeThoughts: false,
13851389
};
13861390
}
13871391

0 commit comments

Comments
 (0)