@ai-sdk/amazon-bedrock 4.0.119 → 4.0.121

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.119" : "0.0.0-test";
38
+ var VERSION = true ? "4.0.121" : "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.119" : "0.0.0-test";
26
+ var VERSION = true ? "4.0.121" : "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.119",
3
+ "version": "4.0.121",
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/provider": "3.0.10",
48
- "@ai-sdk/openai": "3.0.73",
49
- "@ai-sdk/anthropic": "3.0.85",
50
- "@ai-sdk/provider-utils": "4.0.30"
47
+ "@ai-sdk/anthropic": "3.0.86",
48
+ "@ai-sdk/openai": "3.0.74",
49
+ "@ai-sdk/provider-utils": "4.0.30",
50
+ "@ai-sdk/provider": "3.0.10"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/node": "20.17.24",
@@ -133,6 +133,12 @@ export async function prepareTools({
133
133
  ? functionTools.filter(t => t.name === toolChoice.toolName)
134
134
  : functionTools;
135
135
 
136
+ // Bedrock's Messages API rejects `strict` on tools for these models.
137
+ // https://docs.aws.amazon.com/bedrock/latest/userguide/count-tokens.html
138
+ const supportsStrictOnTools =
139
+ !modelId.includes('claude-opus-4-7') &&
140
+ !modelId.includes('claude-opus-4-8');
141
+
136
142
  for (const tool of filteredFunctionTools) {
137
143
  bedrockTools.push({
138
144
  toolSpec: {
@@ -140,7 +146,9 @@ export async function prepareTools({
140
146
  ...(tool.description?.trim() !== ''
141
147
  ? { description: tool.description }
142
148
  : {}),
143
- ...(tool.strict != null ? { strict: tool.strict } : {}),
149
+ ...(tool.strict != null && supportsStrictOnTools
150
+ ? { strict: tool.strict }
151
+ : {}),
144
152
  inputSchema: {
145
153
  json: tool.inputSchema as JSONObject,
146
154
  },