@ai-sdk/amazon-bedrock 4.0.143 → 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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @ai-sdk/amazon-bedrock
2
2
 
3
+ ## 4.0.145
4
+
5
+ ### Patch Changes
6
+
7
+ - 6077642: fix(amazon-bedrock): warn when unsupported strict tools are omitted and align structured output fallback routing
8
+
9
+ ## 4.0.144
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [9ecdefe]
14
+ - @ai-sdk/provider-utils@4.0.41
15
+ - @ai-sdk/anthropic@3.0.104
16
+ - @ai-sdk/openai@3.0.90
17
+
3
18
  ## 4.0.143
4
19
 
5
20
  ### Patch Changes
@@ -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.143" : "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") {
@@ -24,7 +24,7 @@ import {
24
24
  import { AwsV4Signer } from "aws4fetch";
25
25
 
26
26
  // src/version.ts
27
- var VERSION = true ? "4.0.143" : "0.0.0-test";
27
+ var VERSION = true ? "4.0.145" : "0.0.0-test";
28
28
 
29
29
  // src/bedrock-sigv4-fetch.ts
30
30
  function createSigV4FetchFunction(getCredentials, fetch, service = "bedrock") {
package/dist/index.js CHANGED
@@ -315,6 +315,13 @@ async function prepareTools({
315
315
  const filteredFunctionTools = (toolChoice == null ? void 0 : toolChoice.type) === "tool" ? functionTools.filter((t) => t.name === toolChoice.toolName) : functionTools;
316
316
  const supportsStrictOnTools = supportsStrictTools(modelId);
317
317
  for (const tool of filteredFunctionTools) {
318
+ if (!supportsStrictOnTools && tool.strict != null) {
319
+ toolWarnings.push({
320
+ type: "unsupported",
321
+ feature: "strict",
322
+ 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.`
323
+ });
324
+ }
318
325
  bedrockTools.push({
319
326
  toolSpec: {
320
327
  name: tool.name,
@@ -929,7 +936,7 @@ var BedrockChatLanguageModel = class {
929
936
  const isThinkingEnabled = ((_b = bedrockOptions.reasoningConfig) == null ? void 0 : _b.type) === "enabled" || ((_c = bedrockOptions.reasoningConfig) == null ? void 0 : _c.type) === "adaptive";
930
937
  const { supportsStructuredOutput: modelSupportsStructuredOutput } = (0, import_internal2.getModelCapabilities)(this.modelId);
931
938
  const useNativeStructuredOutput = isAnthropicModel && supportsNativeStructuredOutput(this.modelId) && (modelSupportsStructuredOutput || isThinkingEnabled) && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null;
932
- const useJsonInstructionForStructuredOutput = isAnthropicModel && (this.modelId.includes("claude-opus-4-7") || this.modelId.includes("claude-opus-4-8")) && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && tools != null && tools.length > 0;
939
+ const useJsonInstructionForStructuredOutput = isAnthropicModel && !supportsStrictTools(this.modelId) && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && tools != null && tools.length > 0;
933
940
  const jsonResponseTool = (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && !useNativeStructuredOutput && !useJsonInstructionForStructuredOutput ? {
934
941
  type: "function",
935
942
  name: "json",
@@ -2158,7 +2165,7 @@ var import_provider_utils7 = require("@ai-sdk/provider-utils");
2158
2165
  var import_aws4fetch = require("aws4fetch");
2159
2166
 
2160
2167
  // src/version.ts
2161
- var VERSION = true ? "4.0.143" : "0.0.0-test";
2168
+ var VERSION = true ? "4.0.145" : "0.0.0-test";
2162
2169
 
2163
2170
  // src/bedrock-sigv4-fetch.ts
2164
2171
  function createSigV4FetchFunction(getCredentials, fetch, service = "bedrock") {