@ai-sdk/amazon-bedrock 4.0.154 → 4.0.156

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,18 @@
1
1
  # @ai-sdk/amazon-bedrock
2
2
 
3
+ ## 4.0.156
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [91880b9]
8
+ - @ai-sdk/openai@3.0.98
9
+
10
+ ## 4.0.155
11
+
12
+ ### Patch Changes
13
+
14
+ - 4b4dc23: fix(bedrock): wrap invalid tool input in object
15
+
3
16
  ## 4.0.154
4
17
 
5
18
  ### 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.154" : "0.0.0-test";
38
+ var VERSION = true ? "4.0.156" : "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.154" : "0.0.0-test";
27
+ var VERSION = true ? "4.0.156" : "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
@@ -744,7 +744,7 @@ async function convertToBedrockChatMessages(prompt, isMistral = false) {
744
744
  toolUse: {
745
745
  toolUseId: normalizeToolCallId(part.toolCallId, isMistral),
746
746
  name: sanitizeToolName(part.toolName),
747
- input: part.input
747
+ input: toBedrockToolInput(part.input)
748
748
  }
749
749
  });
750
750
  break;
@@ -765,6 +765,9 @@ async function convertToBedrockChatMessages(prompt, isMistral = false) {
765
765
  }
766
766
  return { system, messages };
767
767
  }
768
+ function toBedrockToolInput(input) {
769
+ return typeof input === "object" && input !== null && !Array.isArray(input) ? input : { rawInvalidInput: input };
770
+ }
768
771
  function getBedrockImageFormat(mimeType) {
769
772
  if (!mimeType) {
770
773
  throw new import_provider3.UnsupportedFunctionalityError({
@@ -2165,7 +2168,7 @@ var import_provider_utils7 = require("@ai-sdk/provider-utils");
2165
2168
  var import_aws4fetch = require("aws4fetch");
2166
2169
 
2167
2170
  // src/version.ts
2168
- var VERSION = true ? "4.0.154" : "0.0.0-test";
2171
+ var VERSION = true ? "4.0.156" : "0.0.0-test";
2169
2172
 
2170
2173
  // src/bedrock-sigv4-fetch.ts
2171
2174
  function createSigV4FetchFunction(getCredentials, fetch, service = "bedrock") {