@ai-sdk/amazon-bedrock 3.0.115 → 3.0.116

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,11 @@
1
1
  # @ai-sdk/amazon-bedrock
2
2
 
3
+ ## 3.0.116
4
+
5
+ ### Patch Changes
6
+
7
+ - 0ecface: fix(bedrock): wrap invalid tool input in object
8
+
3
9
  ## 3.0.115
4
10
 
5
11
  ### 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 ? "3.0.115" : "0.0.0-test";
38
+ var VERSION = true ? "3.0.116" : "0.0.0-test";
39
39
 
40
40
  // src/bedrock-sigv4-fetch.ts
41
41
  function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {
@@ -24,7 +24,7 @@ import {
24
24
  import { AwsV4Signer } from "aws4fetch";
25
25
 
26
26
  // src/version.ts
27
- var VERSION = true ? "3.0.115" : "0.0.0-test";
27
+ var VERSION = true ? "3.0.116" : "0.0.0-test";
28
28
 
29
29
  // src/bedrock-sigv4-fetch.ts
30
30
  function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ module.exports = __toCommonJS(index_exports);
30
30
  var import_provider_utils8 = require("@ai-sdk/provider-utils");
31
31
 
32
32
  // src/version.ts
33
- var VERSION = true ? "3.0.115" : "0.0.0-test";
33
+ var VERSION = true ? "3.0.116" : "0.0.0-test";
34
34
 
35
35
  // src/bedrock-provider.ts
36
36
  var import_internal3 = require("@ai-sdk/anthropic/internal");
@@ -606,7 +606,7 @@ async function convertToBedrockChatMessages(prompt) {
606
606
  toolUse: {
607
607
  toolUseId: part.toolCallId,
608
608
  name: sanitizeToolName(part.toolName),
609
- input: part.input
609
+ input: toBedrockToolInput(part.input)
610
610
  }
611
611
  });
612
612
  break;
@@ -628,6 +628,9 @@ async function convertToBedrockChatMessages(prompt) {
628
628
  }
629
629
  return { system, messages };
630
630
  }
631
+ function toBedrockToolInput(input) {
632
+ return typeof input === "object" && input !== null && !Array.isArray(input) ? input : { rawInvalidInput: input };
633
+ }
631
634
  function getBedrockImageFormat(mimeType) {
632
635
  if (!mimeType) {
633
636
  throw new import_provider3.UnsupportedFunctionalityError({