Skip to content

Commit 8d6478c

Browse files
committed
fix: refactor thinkingConfig assignment for consistency in Gemini and Vertex handlers
1 parent 3c06d8f commit 8d6478c

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/api/providers/gemini.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,12 @@ export class GeminiHandler extends BaseProvider implements SingleCompletionHandl
141141
return {
142142
id,
143143
info,
144-
thinkingConfig: this.options.modelMaxThinkingTokens
145-
? { thinkingBudget: this.options.modelMaxThinkingTokens, includeThoughts: true }
146-
: undefined,
144+
thinkingConfig: {
145+
...(this.options.modelMaxThinkingTokens && {
146+
thinkingBudget: this.options.modelMaxThinkingTokens,
147+
}),
148+
includeThoughts: true,
149+
},
147150
maxOutputTokens: this.options.modelMaxTokens ?? info.maxTokens ?? undefined,
148151
}
149152
}

src/api/providers/vertex.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,12 @@ export class VertexHandler extends GeminiHandler implements SingleCompletionHand
2323
return {
2424
id,
2525
info,
26-
thinkingConfig: this.options.modelMaxThinkingTokens
27-
? { thinkingBudget: this.options.modelMaxThinkingTokens, includeThoughts: true }
28-
: undefined,
26+
thinkingConfig: {
27+
...(this.options.modelMaxThinkingTokens && {
28+
thinkingBudget: this.options.modelMaxThinkingTokens,
29+
}),
30+
includeThoughts: true,
31+
},
2932
maxOutputTokens: this.options.modelMaxTokens ?? info.maxTokens ?? undefined,
3033
}
3134
}

0 commit comments

Comments
 (0)