@ai-sdk/amazon-bedrock 4.0.137 → 4.0.138

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.137" : "0.0.0-test";
38
+ var VERSION = true ? "4.0.138" : "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.137" : "0.0.0-test";
26
+ var VERSION = true ? "4.0.138" : "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.137",
3
+ "version": "4.0.138",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -44,7 +44,7 @@
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.98",
47
+ "@ai-sdk/anthropic": "3.0.99",
48
48
  "@ai-sdk/openai": "3.0.86",
49
49
  "@ai-sdk/provider": "3.0.14",
50
50
  "@ai-sdk/provider-utils": "4.0.40"
@@ -24,6 +24,7 @@ import {
24
24
  type ParseResult,
25
25
  type Resolvable,
26
26
  } from '@ai-sdk/provider-utils';
27
+ import { sanitizeJsonSchema } from '@ai-sdk/anthropic/internal';
27
28
  import { z } from 'zod/v4';
28
29
  import {
29
30
  BEDROCK_STOP_REASONS,
@@ -316,7 +317,7 @@ export class BedrockChatLanguageModel implements LanguageModelV3 {
316
317
  ...bedrockOptions.additionalModelRequestFields?.output_config,
317
318
  format: {
318
319
  type: 'json_schema',
319
- schema: responseFormat!.schema,
320
+ schema: sanitizeJsonSchema(responseFormat!.schema!),
320
321
  },
321
322
  },
322
323
  };
@@ -1041,10 +1042,7 @@ export class BedrockChatLanguageModel implements LanguageModelV3 {
1041
1042
  }
1042
1043
 
1043
1044
  private getUrl(modelId: string) {
1044
- const encodedModelId = modelId.startsWith('arn:')
1045
- ? encodeURIComponent(modelId).replace(/%3A/g, ':').replace(/%2F/g, '/')
1046
- : encodeURIComponent(modelId);
1047
- return `${this.config.baseUrl()}/model/${encodedModelId}`;
1045
+ return `${this.config.baseUrl()}/model/${encodeURIComponent(modelId)}`;
1048
1046
  }
1049
1047
  }
1050
1048