Skip to content

Commit af5945b

Browse files
fix: gemini thinking config (#3380)
Co-authored-by: Eduard Wayland <[email protected]>
1 parent 812b22c commit af5945b

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

js/plugins/googleai/src/gemini.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,29 @@ export const GeminiConfigSchema = GenerationCommonConfigSchema.extend({
215215
'Retrieve public web data for grounding, powered by Google Search.'
216216
)
217217
.optional(),
218+
thinkingConfig: z
219+
.object({
220+
includeThoughts: z
221+
.boolean()
222+
.describe(
223+
'Indicates whether to include thoughts in the response.' +
224+
'If true, thoughts are returned only when available.'
225+
)
226+
.optional(),
227+
thinkingBudget: z
228+
.number()
229+
.min(0)
230+
.max(24576)
231+
.describe(
232+
'The thinking budget parameter gives the model guidance on the ' +
233+
'number of thinking tokens it can use when generating a response. ' +
234+
'A greater number of tokens is typically associated with more detailed ' +
235+
'thinking, which is needed for solving more complex tasks. ' +
236+
'Setting the thinking budget to 0 disables thinking.'
237+
)
238+
.optional(),
239+
})
240+
.optional(),
218241
}).passthrough();
219242
export type GeminiConfig = z.infer<typeof GeminiConfigSchema>;
220243

js/plugins/vertexai/src/gemini.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,29 @@ export const GeminiConfigSchema = GenerationCommonConfigSchema.extend({
261261
'With NONE, the model is prohibited from making function calls.'
262262
)
263263
.optional(),
264+
thinkingConfig: z
265+
.object({
266+
includeThoughts: z
267+
.boolean()
268+
.describe(
269+
'Indicates whether to include thoughts in the response.' +
270+
'If true, thoughts are returned only when available.'
271+
)
272+
.optional(),
273+
thinkingBudget: z
274+
.number()
275+
.min(0)
276+
.max(24576)
277+
.describe(
278+
'The thinking budget parameter gives the model guidance on the ' +
279+
'number of thinking tokens it can use when generating a response. ' +
280+
'A greater number of tokens is typically associated with more detailed ' +
281+
'thinking, which is needed for solving more complex tasks. ' +
282+
'Setting the thinking budget to 0 disables thinking.'
283+
)
284+
.optional(),
285+
})
286+
.optional(),
264287
}).passthrough();
265288

266289
/**

0 commit comments

Comments
 (0)