File tree Expand file tree Collapse file tree 2 files changed +50
-4
lines changed Expand file tree Collapse file tree 2 files changed +50
-4
lines changed Original file line number Diff line number Diff line change 17
17
import {
18
18
EnhancedGenerateContentResponse ,
19
19
FileDataPart ,
20
- FunctionCallingMode ,
21
20
FunctionCallPart ,
21
+ FunctionCallingMode ,
22
22
FunctionDeclaration ,
23
23
FunctionResponsePart ,
24
24
GenerateContentCandidate as GeminiCandidate ,
@@ -37,27 +37,27 @@ import {
37
37
ToolConfig ,
38
38
} from '@google/generative-ai' ;
39
39
import {
40
- Genkit ,
41
40
GENKIT_CLIENT_HEADER ,
41
+ Genkit ,
42
42
GenkitError ,
43
43
JSONSchema ,
44
44
z ,
45
45
} from 'genkit' ;
46
46
import {
47
47
CandidateData ,
48
48
GenerationCommonConfigSchema ,
49
- getBasicUsageStats ,
50
49
MediaPart ,
51
50
MessageData ,
52
51
ModelAction ,
53
52
ModelInfo ,
54
53
ModelMiddleware ,
55
- modelRef ,
56
54
ModelReference ,
57
55
Part ,
58
56
ToolDefinitionSchema ,
59
57
ToolRequestPart ,
60
58
ToolResponsePart ,
59
+ getBasicUsageStats ,
60
+ modelRef ,
61
61
} from 'genkit/model' ;
62
62
import {
63
63
downloadRequestMedia ,
@@ -132,6 +132,29 @@ export const GeminiConfigSchema = GenerationCommonConfigSchema.extend({
132
132
"'gemini-2.0-flash-exp' model at present."
133
133
)
134
134
. optional ( ) ,
135
+ thinkingConfig : z
136
+ . object ( {
137
+ includeThoughts : z
138
+ . boolean ( )
139
+ . describe (
140
+ 'Indicates whether to include thoughts in the response.' +
141
+ 'If true, thoughts are returned only when available.'
142
+ )
143
+ . optional ( ) ,
144
+ thinkingBudget : z
145
+ . number ( )
146
+ . min ( 0 )
147
+ . max ( 24576 )
148
+ . describe (
149
+ 'The thinking budget parameter gives the model guidance on the ' +
150
+ 'number of thinking tokens it can use when generating a response. ' +
151
+ 'A greater number of tokens is typically associated with more detailed ' +
152
+ 'thinking, which is needed for solving more complex tasks. ' +
153
+ 'Setting the thinking budget to 0 disables thinking.'
154
+ )
155
+ . optional ( ) ,
156
+ } )
157
+ . optional ( ) ,
135
158
} ) . passthrough ( ) ;
136
159
export type GeminiConfig = z . infer < typeof GeminiConfigSchema > ;
137
160
Original file line number Diff line number Diff line change @@ -267,6 +267,29 @@ export const GeminiConfigSchema = GenerationCommonConfigSchema.extend({
267
267
'With NONE, the model is prohibited from making function calls.'
268
268
)
269
269
. optional ( ) ,
270
+ thinkingConfig : z
271
+ . object ( {
272
+ includeThoughts : z
273
+ . boolean ( )
274
+ . describe (
275
+ 'Indicates whether to include thoughts in the response.' +
276
+ 'If true, thoughts are returned only when available.'
277
+ )
278
+ . optional ( ) ,
279
+ thinkingBudget : z
280
+ . number ( )
281
+ . min ( 0 )
282
+ . max ( 24576 )
283
+ . describe (
284
+ 'The thinking budget parameter gives the model guidance on the ' +
285
+ 'number of thinking tokens it can use when generating a response. ' +
286
+ 'A greater number of tokens is typically associated with more detailed ' +
287
+ 'thinking, which is needed for solving more complex tasks. ' +
288
+ 'Setting the thinking budget to 0 disables thinking.'
289
+ )
290
+ . optional ( ) ,
291
+ } )
292
+ . optional ( ) ,
270
293
} ) . passthrough ( ) ;
271
294
272
295
/**
You can’t perform that action at this time.
0 commit comments