File tree Expand file tree Collapse file tree 4 files changed +25
-0
lines changed Expand file tree Collapse file tree 4 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -337,6 +337,10 @@ export const VertexGoogleChatCompleteConfig: ProviderConfig = {
337
337
labels : {
338
338
param : 'labels' ,
339
339
} ,
340
+ thinking : {
341
+ param : 'generationConfig' ,
342
+ transform : ( params : Params ) => transformGenerationConfig ( params ) ,
343
+ } ,
340
344
} ;
341
345
342
346
interface AnthorpicTextContentItem {
Original file line number Diff line number Diff line change @@ -50,5 +50,12 @@ export function transformGenerationConfig(params: Params) {
50
50
generationConfig [ 'responseSchema' ] = schema ;
51
51
}
52
52
53
+ if ( params ?. thinking ) {
54
+ const thinkingConfig : Record < string , any > = { } ;
55
+ thinkingConfig [ 'include_thoughts' ] = true ;
56
+ thinkingConfig [ 'thinking_budget' ] = params . thinking . budget_tokens ;
57
+ generationConfig [ 'thinking_config' ] = thinkingConfig ;
58
+ }
59
+
53
60
return generationConfig ;
54
61
}
Original file line number Diff line number Diff line change @@ -71,6 +71,12 @@ const transformGenerationConfig = (params: Params) => {
71
71
}
72
72
generationConfig [ 'responseSchema' ] = schema ;
73
73
}
74
+ if ( params ?. thinking ) {
75
+ const thinkingConfig : Record < string , any > = { } ;
76
+ thinkingConfig [ 'include_thoughts' ] = true ;
77
+ thinkingConfig [ 'thinking_budget' ] = params . thinking . budget_tokens ;
78
+ generationConfig [ 'thinking_config' ] = thinkingConfig ;
79
+ }
74
80
return generationConfig ;
75
81
} ;
76
82
@@ -405,6 +411,10 @@ export const GoogleChatCompleteConfig: ProviderConfig = {
405
411
}
406
412
} ,
407
413
} ,
414
+ thinking : {
415
+ param : 'generationConfig' ,
416
+ transform : ( params : Params ) => transformGenerationConfig ( params ) ,
417
+ } ,
408
418
} ;
409
419
410
420
export interface GoogleErrorResponse {
Original file line number Diff line number Diff line change @@ -404,6 +404,10 @@ export interface Params {
404
404
// Anthropic specific
405
405
anthropic_beta ?: string ;
406
406
anthropic_version ?: string ;
407
+ thinking ?: {
408
+ type ?: string ;
409
+ budget_tokens : number ;
410
+ } ;
407
411
}
408
412
409
413
interface Examples {
You can’t perform that action at this time.
0 commit comments