@ai-sdk/amazon-bedrock 4.0.144 → 4.0.145

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.144" : "0.0.0-test";
38
+ var VERSION = true ? "4.0.145" : "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.144" : "0.0.0-test";
26
+ var VERSION = true ? "4.0.145" : "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.144",
3
+ "version": "4.0.145",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -44,18 +44,18 @@
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.104",
48
- "@ai-sdk/openai": "3.0.90",
49
47
  "@ai-sdk/provider": "3.0.14",
50
- "@ai-sdk/provider-utils": "4.0.41"
48
+ "@ai-sdk/anthropic": "3.0.104",
49
+ "@ai-sdk/provider-utils": "4.0.41",
50
+ "@ai-sdk/openai": "3.0.90"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/node": "20.17.24",
54
54
  "tsup": "^8.3.0",
55
55
  "typescript": "5.8.3",
56
56
  "zod": "3.25.76",
57
- "@ai-sdk/test-server": "1.0.6",
58
- "@vercel/ai-tsconfig": "0.0.0"
57
+ "@vercel/ai-tsconfig": "0.0.0",
58
+ "@ai-sdk/test-server": "1.0.6"
59
59
  },
60
60
  "peerDependencies": {
61
61
  "zod": "^3.25.76 || ^4.1.8"
@@ -38,7 +38,10 @@ import {
38
38
  amazonBedrockLanguageModelOptions,
39
39
  type BedrockChatModelId,
40
40
  } from './bedrock-chat-options';
41
- import { supportsNativeStructuredOutput } from './bedrock-anthropic-model-support';
41
+ import {
42
+ supportsNativeStructuredOutput,
43
+ supportsStrictTools,
44
+ } from './bedrock-anthropic-model-support';
42
45
  import { BedrockErrorSchema } from './bedrock-error';
43
46
  import { createBedrockEventStreamResponseHandler } from './bedrock-event-stream-response-handler';
44
47
  import { prepareTools } from './bedrock-prepare-tools';
@@ -164,8 +167,7 @@ export class BedrockChatLanguageModel implements LanguageModelV3 {
164
167
 
165
168
  const useJsonInstructionForStructuredOutput =
166
169
  isAnthropicModel &&
167
- (this.modelId.includes('claude-opus-4-7') ||
168
- this.modelId.includes('claude-opus-4-8')) &&
170
+ !supportsStrictTools(this.modelId) &&
169
171
  responseFormat?.type === 'json' &&
170
172
  responseFormat.schema != null &&
171
173
  tools != null &&
@@ -137,6 +137,14 @@ export async function prepareTools({
137
137
  const supportsStrictOnTools = supportsStrictTools(modelId);
138
138
 
139
139
  for (const tool of filteredFunctionTools) {
140
+ if (!supportsStrictOnTools && tool.strict != null) {
141
+ toolWarnings.push({
142
+ type: 'unsupported',
143
+ feature: 'strict',
144
+ details: `Tool '${tool.name}' has strict: ${tool.strict}, but strict mode is not supported by this model on Amazon Bedrock. The strict property will be ignored.`,
145
+ });
146
+ }
147
+
140
148
  bedrockTools.push({
141
149
  toolSpec: {
142
150
  name: tool.name,