File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -43,13 +43,14 @@ export interface BedrockChatCompletionsParams extends Params {
43
43
}
44
44
45
45
export interface BedrockConverseAnthropicChatCompletionsParams
46
- extends BedrockChatCompletionsParams {
46
+ extends Omit < BedrockChatCompletionsParams , 'anthropic_beta' > {
47
47
anthropic_version ?: string ;
48
48
user ?: string ;
49
49
thinking ?: {
50
50
type : string ;
51
51
budget_tokens : number ;
52
52
} ;
53
+ anthropic_beta ?: string | string [ ] ;
53
54
}
54
55
55
56
export interface BedrockConverseCohereChatCompletionsParams
@@ -717,7 +718,9 @@ export const BedrockConverseAnthropicChatCompleteConfig: ProviderConfig = {
717
718
transformAnthropicAdditionalModelRequestFields ( params ) ,
718
719
} ,
719
720
anthropic_beta : {
720
- param : 'anthropic_beta' ,
721
+ param : 'additionalModelRequestFields' ,
722
+ transform : ( params : BedrockConverseAnthropicChatCompletionsParams ) =>
723
+ transformAnthropicAdditionalModelRequestFields ( params ) ,
721
724
} ,
722
725
} ;
723
726
Original file line number Diff line number Diff line change @@ -120,6 +120,15 @@ export const transformAnthropicAdditionalModelRequestFields = (
120
120
if ( params [ 'thinking' ] ) {
121
121
additionalModelRequestFields [ 'thinking' ] = params [ 'thinking' ] ;
122
122
}
123
+ if ( params [ 'anthropic_beta' ] ) {
124
+ if ( typeof params [ 'anthropic_beta' ] === 'string' ) {
125
+ additionalModelRequestFields [ 'anthropic_beta' ] = [
126
+ params [ 'anthropic_beta' ] ,
127
+ ] ;
128
+ } else {
129
+ additionalModelRequestFields [ 'anthropic_beta' ] = params [ 'anthropic_beta' ] ;
130
+ }
131
+ }
123
132
return additionalModelRequestFields ;
124
133
} ;
125
134
You can’t perform that action at this time.
0 commit comments