@ai-sdk/amazon-bedrock 4.0.168 → 4.0.169

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.168" : "0.0.0-test";
38
+ var VERSION = true ? "4.0.169" : "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.168" : "0.0.0-test";
26
+ var VERSION = true ? "4.0.169" : "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.168",
3
+ "version": "4.0.169",
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.115",
47
+ "@ai-sdk/anthropic": "3.0.116",
48
48
  "@ai-sdk/openai": "3.0.106",
49
49
  "@ai-sdk/provider": "3.0.15",
50
50
  "@ai-sdk/provider-utils": "4.0.50"
@@ -61,6 +61,10 @@ type BedrockChatConfig = {
61
61
  generateId: () => string;
62
62
  };
63
63
 
64
+ function isJsonResponseToolName(name: string): boolean {
65
+ return name === 'json' || name === 'json<|channel|>commentary';
66
+ }
67
+
64
68
  const anthropicProviderOptions = z.object({
65
69
  disableParallelToolUse: z.boolean().optional(),
66
70
  structuredOutputMode: z.enum(['outputFormat', 'jsonTool', 'auto']).optional(),
@@ -612,7 +616,7 @@ export class BedrockChatLanguageModel implements LanguageModelV3 {
612
616
  // tool calls
613
617
  if (part.toolUse) {
614
618
  const isJsonResponseTool =
615
- usesJsonResponseTool && part.toolUse.name === 'json';
619
+ usesJsonResponseTool && isJsonResponseToolName(part.toolUse.name);
616
620
 
617
621
  if (isJsonResponseTool) {
618
622
  isJsonResponseFromTool = true;
@@ -1070,7 +1074,7 @@ export class BedrockChatLanguageModel implements LanguageModelV3 {
1070
1074
  const toolUse = contentBlockStart.start.toolUse;
1071
1075
  const blockIndex = contentBlockStart.contentBlockIndex!;
1072
1076
  const isJsonResponseTool =
1073
- usesJsonResponseTool && toolUse.name === 'json';
1077
+ usesJsonResponseTool && isJsonResponseToolName(toolUse.name);
1074
1078
 
1075
1079
  const normalizedToolCallId = normalizeToolCallId(
1076
1080
  toolUse.toolUseId!,