@ai-sdk/amazon-bedrock 4.0.161 → 4.0.165
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 +33 -0
- package/dist/anthropic/index.js +1 -1
- package/dist/anthropic/index.mjs +1 -1
- package/dist/index.js +111 -55
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +111 -55
- package/dist/index.mjs.map +1 -1
- package/dist/mantle/index.js +1 -1
- package/dist/mantle/index.mjs +1 -1
- package/package.json +4 -4
- package/src/bedrock-chat-language-model.ts +49 -19
- package/src/bedrock-prepare-tools.ts +30 -1
- package/src/convert-bedrock-usage.ts +7 -1
- package/src/convert-to-bedrock-chat-messages.ts +65 -37
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @ai-sdk/amazon-bedrock
|
|
2
2
|
|
|
3
|
+
## 4.0.165
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- da1ce8f: Forward the Anthropic option for disabling parallel tool use through Amazon Bedrock without sending conflicting tool choice fields.
|
|
8
|
+
- Updated dependencies [426c9b3]
|
|
9
|
+
- Updated dependencies [34d045d]
|
|
10
|
+
- @ai-sdk/openai@3.0.104
|
|
11
|
+
|
|
12
|
+
## 4.0.164
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- d69e9a1: Omit assistant messages that become empty after unsupported reasoning content is removed.
|
|
17
|
+
- Updated dependencies [9a521b9]
|
|
18
|
+
- @ai-sdk/openai@3.0.103
|
|
19
|
+
- @ai-sdk/provider-utils@4.0.49
|
|
20
|
+
- @ai-sdk/anthropic@3.0.114
|
|
21
|
+
|
|
22
|
+
## 4.0.163
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- 1eb654d: Preserve complete Amazon Bedrock Converse usage objects in raw usage metadata.
|
|
27
|
+
|
|
28
|
+
## 4.0.162
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- 46e5f91: Send nested reasoning effort for CRIS-prefixed OpenAI GPT-5.x Converse requests while preserving the flat gpt-oss format.
|
|
33
|
+
- Updated dependencies [087d7e2]
|
|
34
|
+
- @ai-sdk/openai@3.0.102
|
|
35
|
+
|
|
3
36
|
## 4.0.161
|
|
4
37
|
|
|
5
38
|
### Patch Changes
|
package/dist/anthropic/index.js
CHANGED
|
@@ -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.
|
|
38
|
+
var VERSION = true ? "4.0.165" : "0.0.0-test";
|
|
39
39
|
|
|
40
40
|
// src/bedrock-sigv4-fetch.ts
|
|
41
41
|
function createSigV4FetchFunction(getCredentials, fetch, service = "bedrock") {
|
package/dist/anthropic/index.mjs
CHANGED
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
import { AwsV4Signer } from "aws4fetch";
|
|
25
25
|
|
|
26
26
|
// src/version.ts
|
|
27
|
-
var VERSION = true ? "4.0.
|
|
27
|
+
var VERSION = true ? "4.0.165" : "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
|
@@ -241,7 +241,8 @@ var import_internal = require("@ai-sdk/anthropic/internal");
|
|
|
241
241
|
async function prepareTools({
|
|
242
242
|
tools,
|
|
243
243
|
toolChoice,
|
|
244
|
-
modelId
|
|
244
|
+
modelId,
|
|
245
|
+
disableParallelToolUse
|
|
245
246
|
}) {
|
|
246
247
|
var _a;
|
|
247
248
|
const toolWarnings = [];
|
|
@@ -287,6 +288,7 @@ async function prepareTools({
|
|
|
287
288
|
} = await (0, import_internal.prepareTools)({
|
|
288
289
|
tools: ProviderTools,
|
|
289
290
|
toolChoice,
|
|
291
|
+
disableParallelToolUse,
|
|
290
292
|
supportsStructuredOutput: false,
|
|
291
293
|
supportsStrictTools: false
|
|
292
294
|
});
|
|
@@ -342,8 +344,17 @@ async function prepareTools({
|
|
|
342
344
|
}
|
|
343
345
|
});
|
|
344
346
|
}
|
|
347
|
+
if (isAnthropicModel && !usingAnthropicTools && disableParallelToolUse && bedrockTools.length > 0 && (toolChoice == null ? void 0 : toolChoice.type) !== "none") {
|
|
348
|
+
additionalTools = {
|
|
349
|
+
tool_choice: (toolChoice == null ? void 0 : toolChoice.type) === "required" ? { type: "any", disable_parallel_tool_use: true } : (toolChoice == null ? void 0 : toolChoice.type) === "tool" ? {
|
|
350
|
+
type: "tool",
|
|
351
|
+
name: toolChoice.toolName,
|
|
352
|
+
disable_parallel_tool_use: true
|
|
353
|
+
} : { type: "auto", disable_parallel_tool_use: true }
|
|
354
|
+
};
|
|
355
|
+
}
|
|
345
356
|
let bedrockToolChoice = void 0;
|
|
346
|
-
if (!usingAnthropicTools && bedrockTools.length > 0 && toolChoice) {
|
|
357
|
+
if (!usingAnthropicTools && (additionalTools == null ? void 0 : additionalTools.tool_choice) == null && bedrockTools.length > 0 && toolChoice) {
|
|
347
358
|
const type = toolChoice.type;
|
|
348
359
|
switch (type) {
|
|
349
360
|
case "auto":
|
|
@@ -688,7 +699,12 @@ async function convertToBedrockChatMessages(prompt, isMistral = false) {
|
|
|
688
699
|
}
|
|
689
700
|
pushCachePoint(bedrockContent, providerOptions);
|
|
690
701
|
}
|
|
691
|
-
messages.
|
|
702
|
+
const previousMessage = messages.at(-1);
|
|
703
|
+
if ((previousMessage == null ? void 0 : previousMessage.role) === "user") {
|
|
704
|
+
previousMessage.content.push(...bedrockContent);
|
|
705
|
+
} else {
|
|
706
|
+
messages.push({ role: "user", content: bedrockContent });
|
|
707
|
+
}
|
|
692
708
|
break;
|
|
693
709
|
}
|
|
694
710
|
case "assistant": {
|
|
@@ -697,15 +713,56 @@ async function convertToBedrockChatMessages(prompt, isMistral = false) {
|
|
|
697
713
|
const message = block.messages[j];
|
|
698
714
|
const isLastMessage = j === block.messages.length - 1;
|
|
699
715
|
const { content } = message;
|
|
700
|
-
const
|
|
701
|
-
(part) =>
|
|
716
|
+
const convertedReasoningContent = await Promise.all(
|
|
717
|
+
content.map(async (part) => {
|
|
718
|
+
if (part.type !== "reasoning") {
|
|
719
|
+
return void 0;
|
|
720
|
+
}
|
|
721
|
+
const metadata = await (0, import_provider_utils3.parseProviderOptions)({
|
|
722
|
+
provider: "bedrock",
|
|
723
|
+
providerOptions: part.providerOptions,
|
|
724
|
+
schema: bedrockReasoningMetadataSchema
|
|
725
|
+
});
|
|
726
|
+
if ((metadata == null ? void 0 : metadata.signature) != null) {
|
|
727
|
+
return {
|
|
728
|
+
reasoningContent: {
|
|
729
|
+
reasoningText: {
|
|
730
|
+
// do not trim reasoning text when a signature is present:
|
|
731
|
+
// the signature validates the exact original bytes
|
|
732
|
+
text: part.text,
|
|
733
|
+
signature: metadata.signature
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
if ((metadata == null ? void 0 : metadata.redactedContent) != null) {
|
|
739
|
+
return {
|
|
740
|
+
reasoningContent: {
|
|
741
|
+
redactedContent: metadata.redactedContent
|
|
742
|
+
}
|
|
743
|
+
};
|
|
744
|
+
}
|
|
745
|
+
if ((metadata == null ? void 0 : metadata.redactedData) != null) {
|
|
746
|
+
return {
|
|
747
|
+
reasoningContent: {
|
|
748
|
+
redactedReasoning: {
|
|
749
|
+
data: metadata.redactedData
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
};
|
|
753
|
+
}
|
|
754
|
+
return void 0;
|
|
755
|
+
})
|
|
756
|
+
);
|
|
757
|
+
const hasReplayableReasoningBlocks = convertedReasoningContent.some(
|
|
758
|
+
(part) => part != null
|
|
702
759
|
);
|
|
703
760
|
for (let k = 0; k < content.length; k++) {
|
|
704
761
|
const part = content[k];
|
|
705
762
|
const isLastContentPart = k === content.length - 1;
|
|
706
763
|
switch (part.type) {
|
|
707
764
|
case "text": {
|
|
708
|
-
if (!part.text.trim() && !
|
|
765
|
+
if (!part.text.trim() && !hasReplayableReasoningBlocks) {
|
|
709
766
|
break;
|
|
710
767
|
}
|
|
711
768
|
bedrockContent.push({
|
|
@@ -724,34 +781,9 @@ async function convertToBedrockChatMessages(prompt, isMistral = false) {
|
|
|
724
781
|
break;
|
|
725
782
|
}
|
|
726
783
|
case "reasoning": {
|
|
727
|
-
const
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
schema: bedrockReasoningMetadataSchema
|
|
731
|
-
});
|
|
732
|
-
if ((reasoningMetadata == null ? void 0 : reasoningMetadata.signature) != null) {
|
|
733
|
-
bedrockContent.push({
|
|
734
|
-
reasoningContent: {
|
|
735
|
-
reasoningText: {
|
|
736
|
-
text: part.text,
|
|
737
|
-
signature: reasoningMetadata.signature
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
});
|
|
741
|
-
} else if ((reasoningMetadata == null ? void 0 : reasoningMetadata.redactedContent) != null) {
|
|
742
|
-
bedrockContent.push({
|
|
743
|
-
reasoningContent: {
|
|
744
|
-
redactedContent: reasoningMetadata.redactedContent
|
|
745
|
-
}
|
|
746
|
-
});
|
|
747
|
-
} else if ((reasoningMetadata == null ? void 0 : reasoningMetadata.redactedData) != null) {
|
|
748
|
-
bedrockContent.push({
|
|
749
|
-
reasoningContent: {
|
|
750
|
-
redactedReasoning: {
|
|
751
|
-
data: reasoningMetadata.redactedData
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
});
|
|
784
|
+
const convertedPart = convertedReasoningContent[k];
|
|
785
|
+
if (convertedPart != null) {
|
|
786
|
+
bedrockContent.push(convertedPart);
|
|
755
787
|
}
|
|
756
788
|
break;
|
|
757
789
|
}
|
|
@@ -770,7 +802,9 @@ async function convertToBedrockChatMessages(prompt, isMistral = false) {
|
|
|
770
802
|
}
|
|
771
803
|
pushCachePoint(bedrockContent, message.providerOptions);
|
|
772
804
|
}
|
|
773
|
-
|
|
805
|
+
if (bedrockContent.length > 0) {
|
|
806
|
+
messages.push({ role: "assistant", content: bedrockContent });
|
|
807
|
+
}
|
|
774
808
|
break;
|
|
775
809
|
}
|
|
776
810
|
default: {
|
|
@@ -879,6 +913,9 @@ function mapBedrockFinishReason(finishReason, isJsonResponseFromTool) {
|
|
|
879
913
|
}
|
|
880
914
|
|
|
881
915
|
// src/bedrock-chat-language-model.ts
|
|
916
|
+
var anthropicProviderOptions = import_v44.z.object({
|
|
917
|
+
disableParallelToolUse: import_v44.z.boolean().optional()
|
|
918
|
+
});
|
|
882
919
|
var BedrockChatLanguageModel = class {
|
|
883
920
|
constructor(modelId, config) {
|
|
884
921
|
this.modelId = modelId;
|
|
@@ -904,12 +941,17 @@ var BedrockChatLanguageModel = class {
|
|
|
904
941
|
toolChoice,
|
|
905
942
|
providerOptions
|
|
906
943
|
}) {
|
|
907
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
944
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
908
945
|
const bedrockOptions = (_a = await (0, import_provider_utils4.parseProviderOptions)({
|
|
909
946
|
provider: "bedrock",
|
|
910
947
|
providerOptions,
|
|
911
948
|
schema: amazonBedrockLanguageModelOptions
|
|
912
949
|
})) != null ? _a : {};
|
|
950
|
+
const anthropicOptions = await (0, import_provider_utils4.parseProviderOptions)({
|
|
951
|
+
provider: "anthropic",
|
|
952
|
+
providerOptions,
|
|
953
|
+
schema: anthropicProviderOptions
|
|
954
|
+
});
|
|
913
955
|
const warnings = [];
|
|
914
956
|
if (frequencyPenalty != null) {
|
|
915
957
|
warnings.push({
|
|
@@ -952,7 +994,10 @@ var BedrockChatLanguageModel = class {
|
|
|
952
994
|
});
|
|
953
995
|
}
|
|
954
996
|
const isAnthropicModel = this.modelId.includes("anthropic");
|
|
955
|
-
const
|
|
997
|
+
const openAIModelId = (_b = /^(?:[^.]+\.)?(openai\..+)$/.exec(this.modelId)) == null ? void 0 : _b[1];
|
|
998
|
+
const isOpenAIModel = openAIModelId != null;
|
|
999
|
+
const isOpenAIGptOssModel = (_c = openAIModelId == null ? void 0 : openAIModelId.startsWith("openai.gpt-oss-")) != null ? _c : false;
|
|
1000
|
+
const isThinkingEnabled = ((_d = bedrockOptions.reasoningConfig) == null ? void 0 : _d.type) === "enabled" || ((_e = bedrockOptions.reasoningConfig) == null ? void 0 : _e.type) === "adaptive";
|
|
956
1001
|
const { supportsStructuredOutput: modelSupportsStructuredOutput } = (0, import_internal2.getModelCapabilities)(this.modelId);
|
|
957
1002
|
const useNativeStructuredOutput = isAnthropicModel && supportsNativeStructuredOutput(this.modelId) && (modelSupportsStructuredOutput || isThinkingEnabled) && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null;
|
|
958
1003
|
const useJsonInstructionForStructuredOutput = isAnthropicModel && !supportsStrictTools(this.modelId) && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && tools != null && tools.length > 0;
|
|
@@ -965,7 +1010,8 @@ var BedrockChatLanguageModel = class {
|
|
|
965
1010
|
const { toolConfig, additionalTools, toolWarnings, betas } = await prepareTools({
|
|
966
1011
|
tools: jsonResponseTool ? [...tools != null ? tools : [], jsonResponseTool] : tools,
|
|
967
1012
|
toolChoice: jsonResponseTool != null ? { type: "required" } : toolChoice,
|
|
968
|
-
modelId: this.modelId
|
|
1013
|
+
modelId: this.modelId,
|
|
1014
|
+
disableParallelToolUse: anthropicOptions == null ? void 0 : anthropicOptions.disableParallelToolUse
|
|
969
1015
|
});
|
|
970
1016
|
warnings.push(...toolWarnings);
|
|
971
1017
|
if (additionalTools) {
|
|
@@ -975,16 +1021,16 @@ var BedrockChatLanguageModel = class {
|
|
|
975
1021
|
};
|
|
976
1022
|
}
|
|
977
1023
|
if (betas.size > 0 || bedrockOptions.anthropicBeta) {
|
|
978
|
-
const existingBetas = (
|
|
1024
|
+
const existingBetas = (_f = bedrockOptions.anthropicBeta) != null ? _f : [];
|
|
979
1025
|
const mergedBetas = betas.size > 0 ? [...existingBetas, ...Array.from(betas)] : existingBetas;
|
|
980
1026
|
bedrockOptions.additionalModelRequestFields = {
|
|
981
1027
|
...bedrockOptions.additionalModelRequestFields,
|
|
982
1028
|
anthropic_beta: mergedBetas
|
|
983
1029
|
};
|
|
984
1030
|
}
|
|
985
|
-
const thinkingType = (
|
|
986
|
-
const thinkingBudget = thinkingType === "enabled" ? (
|
|
987
|
-
const thinkingDisplay = thinkingType === "adaptive" ? (
|
|
1031
|
+
const thinkingType = (_g = bedrockOptions.reasoningConfig) == null ? void 0 : _g.type;
|
|
1032
|
+
const thinkingBudget = thinkingType === "enabled" ? (_h = bedrockOptions.reasoningConfig) == null ? void 0 : _h.budgetTokens : void 0;
|
|
1033
|
+
const thinkingDisplay = thinkingType === "adaptive" ? (_i = bedrockOptions.reasoningConfig) == null ? void 0 : _i.display : void 0;
|
|
988
1034
|
const isAnthropicThinkingEnabled = isAnthropicModel && isThinkingEnabled;
|
|
989
1035
|
const inferenceConfig = {
|
|
990
1036
|
...maxOutputTokens != null && { maxTokens: maxOutputTokens },
|
|
@@ -1017,7 +1063,7 @@ var BedrockChatLanguageModel = class {
|
|
|
1017
1063
|
};
|
|
1018
1064
|
}
|
|
1019
1065
|
} else if (!isAnthropicModel) {
|
|
1020
|
-
if (((
|
|
1066
|
+
if (((_j = bedrockOptions.reasoningConfig) == null ? void 0 : _j.budgetTokens) != null) {
|
|
1021
1067
|
warnings.push({
|
|
1022
1068
|
type: "unsupported",
|
|
1023
1069
|
feature: "budgetTokens",
|
|
@@ -1032,21 +1078,26 @@ var BedrockChatLanguageModel = class {
|
|
|
1032
1078
|
});
|
|
1033
1079
|
}
|
|
1034
1080
|
}
|
|
1035
|
-
const maxReasoningEffort = (
|
|
1036
|
-
const isOpenAIModel = this.modelId.startsWith("openai.");
|
|
1081
|
+
const maxReasoningEffort = (_k = bedrockOptions.reasoningConfig) == null ? void 0 : _k.maxReasoningEffort;
|
|
1037
1082
|
if (maxReasoningEffort != null) {
|
|
1038
1083
|
if (isAnthropicModel) {
|
|
1039
1084
|
bedrockOptions.additionalModelRequestFields = {
|
|
1040
1085
|
...bedrockOptions.additionalModelRequestFields,
|
|
1041
1086
|
output_config: {
|
|
1042
|
-
...(
|
|
1087
|
+
...(_l = bedrockOptions.additionalModelRequestFields) == null ? void 0 : _l.output_config,
|
|
1043
1088
|
effort: maxReasoningEffort
|
|
1044
1089
|
}
|
|
1045
1090
|
};
|
|
1046
1091
|
} else if (isOpenAIModel) {
|
|
1047
|
-
bedrockOptions.additionalModelRequestFields = {
|
|
1092
|
+
bedrockOptions.additionalModelRequestFields = isOpenAIGptOssModel ? {
|
|
1048
1093
|
...bedrockOptions.additionalModelRequestFields,
|
|
1049
1094
|
reasoning_effort: maxReasoningEffort
|
|
1095
|
+
} : {
|
|
1096
|
+
...bedrockOptions.additionalModelRequestFields,
|
|
1097
|
+
reasoning: {
|
|
1098
|
+
...(_m = bedrockOptions.additionalModelRequestFields) == null ? void 0 : _m.reasoning,
|
|
1099
|
+
effort: maxReasoningEffort
|
|
1100
|
+
}
|
|
1050
1101
|
};
|
|
1051
1102
|
} else {
|
|
1052
1103
|
bedrockOptions.additionalModelRequestFields = {
|
|
@@ -1063,7 +1114,7 @@ var BedrockChatLanguageModel = class {
|
|
|
1063
1114
|
bedrockOptions.additionalModelRequestFields = {
|
|
1064
1115
|
...bedrockOptions.additionalModelRequestFields,
|
|
1065
1116
|
output_config: {
|
|
1066
|
-
...(
|
|
1117
|
+
...(_n = bedrockOptions.additionalModelRequestFields) == null ? void 0 : _n.output_config,
|
|
1067
1118
|
format: {
|
|
1068
1119
|
type: "json_schema",
|
|
1069
1120
|
schema: (0, import_internal2.sanitizeJsonSchema)(responseFormat.schema)
|
|
@@ -1095,7 +1146,7 @@ var BedrockChatLanguageModel = class {
|
|
|
1095
1146
|
details: "topK is not supported when thinking is enabled"
|
|
1096
1147
|
});
|
|
1097
1148
|
}
|
|
1098
|
-
const hasAnyTools = ((
|
|
1149
|
+
const hasAnyTools = ((_p = (_o = toolConfig.tools) == null ? void 0 : _o.length) != null ? _p : 0) > 0 || additionalTools;
|
|
1099
1150
|
let filteredPrompt = prompt;
|
|
1100
1151
|
if (!hasAnyTools) {
|
|
1101
1152
|
const hasToolContent = prompt.some(
|
|
@@ -1725,6 +1776,10 @@ var BedrockReasoningTextSchema = import_v44.z.object({
|
|
|
1725
1776
|
var BedrockRedactedReasoningSchema = import_v44.z.object({
|
|
1726
1777
|
data: import_v44.z.string()
|
|
1727
1778
|
});
|
|
1779
|
+
var AmazonBedrockCacheDetailSchema = import_v44.z.object({
|
|
1780
|
+
inputTokens: import_v44.z.number(),
|
|
1781
|
+
ttl: import_v44.z.string()
|
|
1782
|
+
}).catchall(import_v44.z.json());
|
|
1728
1783
|
var BedrockResponseSchema = import_v44.z.object({
|
|
1729
1784
|
metrics: import_v44.z.object({
|
|
1730
1785
|
latencyMs: import_v44.z.number()
|
|
@@ -1766,8 +1821,8 @@ var BedrockResponseSchema = import_v44.z.object({
|
|
|
1766
1821
|
totalTokens: import_v44.z.number(),
|
|
1767
1822
|
cacheReadInputTokens: import_v44.z.number().nullish(),
|
|
1768
1823
|
cacheWriteInputTokens: import_v44.z.number().nullish(),
|
|
1769
|
-
cacheDetails: import_v44.z.array(
|
|
1770
|
-
})
|
|
1824
|
+
cacheDetails: import_v44.z.array(AmazonBedrockCacheDetailSchema).nullish()
|
|
1825
|
+
}).catchall(import_v44.z.json())
|
|
1771
1826
|
});
|
|
1772
1827
|
var BedrockStreamSchema = import_v44.z.object({
|
|
1773
1828
|
contentBlockDelta: import_v44.z.object({
|
|
@@ -1815,10 +1870,11 @@ var BedrockStreamSchema = import_v44.z.object({
|
|
|
1815
1870
|
usage: import_v44.z.object({
|
|
1816
1871
|
cacheReadInputTokens: import_v44.z.number().nullish(),
|
|
1817
1872
|
cacheWriteInputTokens: import_v44.z.number().nullish(),
|
|
1818
|
-
cacheDetails: import_v44.z.array(
|
|
1873
|
+
cacheDetails: import_v44.z.array(AmazonBedrockCacheDetailSchema).nullish(),
|
|
1819
1874
|
inputTokens: import_v44.z.number(),
|
|
1820
|
-
outputTokens: import_v44.z.number()
|
|
1821
|
-
|
|
1875
|
+
outputTokens: import_v44.z.number(),
|
|
1876
|
+
totalTokens: import_v44.z.number().optional()
|
|
1877
|
+
}).catchall(import_v44.z.json()).nullish()
|
|
1822
1878
|
}).nullish(),
|
|
1823
1879
|
modelStreamErrorException: import_v44.z.record(import_v44.z.string(), import_v44.z.unknown()).nullish(),
|
|
1824
1880
|
serviceUnavailableException: import_v44.z.record(import_v44.z.string(), import_v44.z.unknown()).nullish(),
|
|
@@ -2230,7 +2286,7 @@ var import_provider_utils7 = require("@ai-sdk/provider-utils");
|
|
|
2230
2286
|
var import_aws4fetch = require("aws4fetch");
|
|
2231
2287
|
|
|
2232
2288
|
// src/version.ts
|
|
2233
|
-
var VERSION = true ? "4.0.
|
|
2289
|
+
var VERSION = true ? "4.0.165" : "0.0.0-test";
|
|
2234
2290
|
|
|
2235
2291
|
// src/bedrock-sigv4-fetch.ts
|
|
2236
2292
|
function createSigV4FetchFunction(getCredentials, fetch, service = "bedrock") {
|