@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/dist/index.mjs CHANGED
@@ -748,7 +748,7 @@ async function convertToBedrockChatMessages(prompt, isMistral = false) {
748
748
  toolUse: {
749
749
  toolUseId: normalizeToolCallId(part.toolCallId, isMistral),
750
750
  name: sanitizeToolName(part.toolName),
751
- input: part.input
751
+ input: toBedrockToolInput(part.input)
752
752
  }
753
753
  });
754
754
  break;
@@ -769,6 +769,9 @@ async function convertToBedrockChatMessages(prompt, isMistral = false) {
769
769
  }
770
770
  return { system, messages };
771
771
  }
772
+ function toBedrockToolInput(input) {
773
+ return typeof input === "object" && input !== null && !Array.isArray(input) ? input : { rawInvalidInput: input };
774
+ }
772
775
  function getBedrockImageFormat(mimeType) {
773
776
  if (!mimeType) {
774
777
  throw new UnsupportedFunctionalityError2({
@@ -2190,7 +2193,7 @@ import {
2190
2193
  import { AwsV4Signer } from "aws4fetch";
2191
2194
 
2192
2195
  // src/version.ts
2193
- var VERSION = true ? "4.0.154" : "0.0.0-test";
2196
+ var VERSION = true ? "4.0.156" : "0.0.0-test";
2194
2197
 
2195
2198
  // src/bedrock-sigv4-fetch.ts
2196
2199
  function createSigV4FetchFunction(getCredentials, fetch, service = "bedrock") {