@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.
- package/CHANGELOG.md +8 -0
- package/dist/anthropic/index.js +1 -1
- package/dist/anthropic/index.mjs +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -3
- package/dist/index.mjs.map +1 -1
- package/dist/mantle/index.js +1 -1
- package/dist/mantle/index.mjs +1 -1
- package/package.json +2 -2
- package/src/bedrock-chat-language-model.ts +6 -2
package/dist/index.mjs
CHANGED
|
@@ -931,6 +931,9 @@ function mapBedrockFinishReason(finishReason, isJsonResponseFromTool) {
|
|
|
931
931
|
}
|
|
932
932
|
|
|
933
933
|
// src/bedrock-chat-language-model.ts
|
|
934
|
+
function isJsonResponseToolName(name) {
|
|
935
|
+
return name === "json" || name === "json<|channel|>commentary";
|
|
936
|
+
}
|
|
934
937
|
var anthropicProviderOptions = z4.object({
|
|
935
938
|
disableParallelToolUse: z4.boolean().optional(),
|
|
936
939
|
structuredOutputMode: z4.enum(["outputFormat", "jsonTool", "auto"]).optional()
|
|
@@ -1332,7 +1335,7 @@ var BedrockChatLanguageModel = class {
|
|
|
1332
1335
|
}
|
|
1333
1336
|
}
|
|
1334
1337
|
if (part.toolUse) {
|
|
1335
|
-
const isJsonResponseTool = usesJsonResponseTool && part.toolUse.name
|
|
1338
|
+
const isJsonResponseTool = usesJsonResponseTool && isJsonResponseToolName(part.toolUse.name);
|
|
1336
1339
|
if (isJsonResponseTool) {
|
|
1337
1340
|
isJsonResponseFromTool = true;
|
|
1338
1341
|
content.push({
|
|
@@ -1667,7 +1670,7 @@ var BedrockChatLanguageModel = class {
|
|
|
1667
1670
|
if (((_q = contentBlockStart == null ? void 0 : contentBlockStart.start) == null ? void 0 : _q.toolUse) != null) {
|
|
1668
1671
|
const toolUse = contentBlockStart.start.toolUse;
|
|
1669
1672
|
const blockIndex = contentBlockStart.contentBlockIndex;
|
|
1670
|
-
const isJsonResponseTool = usesJsonResponseTool && toolUse.name
|
|
1673
|
+
const isJsonResponseTool = usesJsonResponseTool && isJsonResponseToolName(toolUse.name);
|
|
1671
1674
|
const normalizedToolCallId = normalizeToolCallId(
|
|
1672
1675
|
toolUse.toolUseId,
|
|
1673
1676
|
isMistral
|
|
@@ -2354,7 +2357,7 @@ import {
|
|
|
2354
2357
|
import { AwsV4Signer } from "aws4fetch";
|
|
2355
2358
|
|
|
2356
2359
|
// src/version.ts
|
|
2357
|
-
var VERSION = true ? "4.0.
|
|
2360
|
+
var VERSION = true ? "4.0.169" : "0.0.0-test";
|
|
2358
2361
|
|
|
2359
2362
|
// src/bedrock-sigv4-fetch.ts
|
|
2360
2363
|
function createSigV4FetchFunction(getCredentials, fetch, service = "bedrock") {
|