@ai-sdk/amazon-bedrock 4.0.180 → 4.0.182

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,7 +35,7 @@ var import_provider_utils = require("@ai-sdk/provider-utils");
35
35
  var import_aws4fetch = require("aws4fetch");
36
36
 
37
37
  // src/version.ts
38
- var VERSION = true ? "4.0.180" : "0.0.0-test";
38
+ var VERSION = true ? "4.0.182" : "0.0.0-test";
39
39
 
40
40
  // src/bedrock-sigv4-fetch.ts
41
41
  function createSigV4FetchFunction(getCredentials, fetch, service = "bedrock") {
@@ -23,7 +23,7 @@ import {
23
23
  import { AwsV4Signer } from "aws4fetch";
24
24
 
25
25
  // src/version.ts
26
- var VERSION = true ? "4.0.180" : "0.0.0-test";
26
+ var VERSION = true ? "4.0.182" : "0.0.0-test";
27
27
 
28
28
  // src/bedrock-sigv4-fetch.ts
29
29
  function createSigV4FetchFunction(getCredentials, fetch, service = "bedrock") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/amazon-bedrock",
3
- "version": "4.0.180",
3
+ "version": "4.0.182",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -44,10 +44,10 @@
44
44
  "@smithy/eventstream-codec": "^4.0.1",
45
45
  "@smithy/util-utf8": "^4.0.0",
46
46
  "aws4fetch": "^1.0.20",
47
- "@ai-sdk/anthropic": "3.0.120",
48
- "@ai-sdk/openai": "3.0.115",
49
- "@ai-sdk/provider": "3.0.16",
50
- "@ai-sdk/provider-utils": "4.0.52"
47
+ "@ai-sdk/anthropic": "3.0.122",
48
+ "@ai-sdk/openai": "3.0.117",
49
+ "@ai-sdk/provider": "3.0.17",
50
+ "@ai-sdk/provider-utils": "4.0.54"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/node": "20.17.24",
@@ -1,6 +1,8 @@
1
1
  export type BedrockAnthropicModelId =
2
2
  | 'anthropic.claude-sonnet-5'
3
3
  | 'anthropic.claude-fable-5'
4
+ | 'anthropic.claude-opus-5'
5
+ | 'anthropic.claude-opus-5-5'
4
6
  | 'anthropic.claude-opus-4-8'
5
7
  | 'anthropic.claude-opus-4-7'
6
8
  | 'anthropic.claude-opus-4-6-v1'
@@ -20,6 +22,8 @@ export type BedrockAnthropicModelId =
20
22
  | 'anthropic.claude-3-haiku-20240307-v1:0'
21
23
  | 'us.anthropic.claude-sonnet-5'
22
24
  | 'us.anthropic.claude-fable-5'
25
+ | 'us.anthropic.claude-opus-5'
26
+ | 'us.anthropic.claude-opus-5-5'
23
27
  | 'us.anthropic.claude-opus-4-8'
24
28
  | 'us.anthropic.claude-opus-4-7'
25
29
  | 'us.anthropic.claude-opus-4-6-v1'
@@ -184,8 +184,10 @@ export class BedrockChatLanguageModel implements LanguageModelV3 {
184
184
  bedrockOptions.reasoningConfig?.type === 'enabled' ||
185
185
  bedrockOptions.reasoningConfig?.type === 'adaptive';
186
186
 
187
- const { supportsStructuredOutput: modelSupportsStructuredOutput } =
188
- getModelCapabilities(this.modelId);
187
+ const {
188
+ supportsStructuredOutput: modelSupportsStructuredOutput,
189
+ rejectsForcedToolUse,
190
+ } = getModelCapabilities(this.modelId);
189
191
 
190
192
  const structuredOutputMode =
191
193
  bedrockOptions.structuredOutputMode ??
@@ -234,13 +236,14 @@ export class BedrockChatLanguageModel implements LanguageModelV3 {
234
236
 
235
237
  const useJsonInstructionForStructuredOutput =
236
238
  !useNativeStructuredOutput &&
237
- structuredOutputMode !== 'jsonTool' &&
238
239
  isAnthropicModel &&
239
- !supportsStrictTools(this.modelId) &&
240
240
  responseFormat?.type === 'json' &&
241
241
  responseFormat.schema != null &&
242
- tools != null &&
243
- tools.length > 0;
242
+ (rejectsForcedToolUse ||
243
+ (structuredOutputMode !== 'jsonTool' &&
244
+ !supportsStrictTools(this.modelId) &&
245
+ tools != null &&
246
+ tools.length > 0));
244
247
 
245
248
  const jsonResponseTool: LanguageModelV3FunctionTool | undefined =
246
249
  responseFormat?.type === 'json' &&
@@ -9,6 +9,8 @@ export type BedrockChatModelId =
9
9
  | 'anthropic.claude-instant-v1'
10
10
  | 'anthropic.claude-sonnet-5'
11
11
  | 'anthropic.claude-fable-5'
12
+ | 'anthropic.claude-opus-5'
13
+ | 'anthropic.claude-opus-5-5'
12
14
  | 'anthropic.claude-opus-4-8'
13
15
  | 'anthropic.claude-opus-4-7'
14
16
  | 'anthropic.claude-opus-4-6-v1'
@@ -60,6 +62,8 @@ export type BedrockChatModelId =
60
62
  | 'us.anthropic.claude-3-7-sonnet-20250219-v1:0'
61
63
  | 'us.anthropic.claude-sonnet-5'
62
64
  | 'us.anthropic.claude-fable-5'
65
+ | 'us.anthropic.claude-opus-5'
66
+ | 'us.anthropic.claude-opus-5-5'
63
67
  | 'us.anthropic.claude-opus-4-8'
64
68
  | 'us.anthropic.claude-opus-4-7'
65
69
  | 'us.anthropic.claude-opus-4-6-v1'