Skip to content

Commit 269c0f0

Browse files
authored
Merge pull request #1079 from narengogi/fix/anthropic-beta-bedrock
support anthropic_beta as a top level parameter for anthropic on bedr…
2 parents a719d7b + a4c96a3 commit 269c0f0

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/providers/bedrock/chatComplete.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,14 @@ export interface BedrockChatCompletionsParams extends Params {
4949
}
5050

5151
export interface BedrockConverseAnthropicChatCompletionsParams
52-
extends BedrockChatCompletionsParams {
52+
extends Omit<BedrockChatCompletionsParams, 'anthropic_beta'> {
5353
anthropic_version?: string;
5454
user?: string;
5555
thinking?: {
5656
type: string;
5757
budget_tokens: number;
5858
};
59+
anthropic_beta?: string | string[];
5960
}
6061

6162
export interface BedrockConverseCohereChatCompletionsParams

src/providers/bedrock/utils.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,15 @@ export const transformAnthropicAdditionalModelRequestFields = (
127127
if (params['thinking']) {
128128
additionalModelRequestFields['thinking'] = params['thinking'];
129129
}
130+
if (params['anthropic_beta']) {
131+
if (typeof params['anthropic_beta'] === 'string') {
132+
additionalModelRequestFields['anthropic_beta'] = [
133+
params['anthropic_beta'],
134+
];
135+
} else {
136+
additionalModelRequestFields['anthropic_beta'] = params['anthropic_beta'];
137+
}
138+
}
130139
return additionalModelRequestFields;
131140
};
132141

0 commit comments

Comments
 (0)