@aws-sdk/client-bedrock-runtime 3.705.0 → 3.709.0
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-cjs/index.js +248 -24
- package/dist-es/commands/ApplyGuardrailCommand.js +2 -1
- package/dist-es/commands/ConverseCommand.js +2 -2
- package/dist-es/models/models_0.js +112 -4
- package/dist-es/protocols/Aws_restJson1.js +94 -6
- package/dist-types/commands/ApplyGuardrailCommand.d.ts +14 -0
- package/dist-types/commands/ConverseCommand.d.ts +29 -0
- package/dist-types/commands/ConverseStreamCommand.d.ts +23 -0
- package/dist-types/models/models_0.d.ts +232 -2
- package/dist-types/ts3.4/models/models_0.d.ts +119 -0
- package/package.json +39 -39
package/dist-cjs/index.js
CHANGED
|
@@ -23,6 +23,7 @@ var src_exports = {};
|
|
|
23
23
|
__export(src_exports, {
|
|
24
24
|
AccessDeniedException: () => AccessDeniedException,
|
|
25
25
|
ApplyGuardrailCommand: () => ApplyGuardrailCommand,
|
|
26
|
+
ApplyGuardrailRequestFilterSensitiveLog: () => ApplyGuardrailRequestFilterSensitiveLog,
|
|
26
27
|
AsyncInvokeOutputDataConfig: () => AsyncInvokeOutputDataConfig,
|
|
27
28
|
AsyncInvokeStatus: () => AsyncInvokeStatus,
|
|
28
29
|
AsyncInvokeSummaryFilterSensitiveLog: () => AsyncInvokeSummaryFilterSensitiveLog,
|
|
@@ -32,11 +33,14 @@ __export(src_exports, {
|
|
|
32
33
|
ConflictException: () => ConflictException,
|
|
33
34
|
ContentBlock: () => ContentBlock,
|
|
34
35
|
ContentBlockDelta: () => ContentBlockDelta,
|
|
36
|
+
ContentBlockFilterSensitiveLog: () => ContentBlockFilterSensitiveLog,
|
|
35
37
|
ContentBlockStart: () => ContentBlockStart,
|
|
36
38
|
ConversationRole: () => ConversationRole,
|
|
37
39
|
ConverseCommand: () => ConverseCommand,
|
|
38
40
|
ConverseOutput: () => ConverseOutput,
|
|
41
|
+
ConverseOutputFilterSensitiveLog: () => ConverseOutputFilterSensitiveLog,
|
|
39
42
|
ConverseRequestFilterSensitiveLog: () => ConverseRequestFilterSensitiveLog,
|
|
43
|
+
ConverseResponseFilterSensitiveLog: () => ConverseResponseFilterSensitiveLog,
|
|
40
44
|
ConverseStreamCommand: () => ConverseStreamCommand,
|
|
41
45
|
ConverseStreamOutput: () => ConverseStreamOutput,
|
|
42
46
|
ConverseStreamOutputFilterSensitiveLog: () => ConverseStreamOutputFilterSensitiveLog,
|
|
@@ -48,6 +52,7 @@ __export(src_exports, {
|
|
|
48
52
|
GetAsyncInvokeResponseFilterSensitiveLog: () => GetAsyncInvokeResponseFilterSensitiveLog,
|
|
49
53
|
GuardrailAction: () => GuardrailAction,
|
|
50
54
|
GuardrailContentBlock: () => GuardrailContentBlock,
|
|
55
|
+
GuardrailContentBlockFilterSensitiveLog: () => GuardrailContentBlockFilterSensitiveLog,
|
|
51
56
|
GuardrailContentFilterConfidence: () => GuardrailContentFilterConfidence,
|
|
52
57
|
GuardrailContentFilterStrength: () => GuardrailContentFilterStrength,
|
|
53
58
|
GuardrailContentFilterType: () => GuardrailContentFilterType,
|
|
@@ -57,7 +62,16 @@ __export(src_exports, {
|
|
|
57
62
|
GuardrailContextualGroundingFilterType: () => GuardrailContextualGroundingFilterType,
|
|
58
63
|
GuardrailContextualGroundingPolicyAction: () => GuardrailContextualGroundingPolicyAction,
|
|
59
64
|
GuardrailConverseContentBlock: () => GuardrailConverseContentBlock,
|
|
65
|
+
GuardrailConverseContentBlockFilterSensitiveLog: () => GuardrailConverseContentBlockFilterSensitiveLog,
|
|
60
66
|
GuardrailConverseContentQualifier: () => GuardrailConverseContentQualifier,
|
|
67
|
+
GuardrailConverseImageBlockFilterSensitiveLog: () => GuardrailConverseImageBlockFilterSensitiveLog,
|
|
68
|
+
GuardrailConverseImageFormat: () => GuardrailConverseImageFormat,
|
|
69
|
+
GuardrailConverseImageSource: () => GuardrailConverseImageSource,
|
|
70
|
+
GuardrailConverseImageSourceFilterSensitiveLog: () => GuardrailConverseImageSourceFilterSensitiveLog,
|
|
71
|
+
GuardrailImageBlockFilterSensitiveLog: () => GuardrailImageBlockFilterSensitiveLog,
|
|
72
|
+
GuardrailImageFormat: () => GuardrailImageFormat,
|
|
73
|
+
GuardrailImageSource: () => GuardrailImageSource,
|
|
74
|
+
GuardrailImageSourceFilterSensitiveLog: () => GuardrailImageSourceFilterSensitiveLog,
|
|
61
75
|
GuardrailManagedWordType: () => GuardrailManagedWordType,
|
|
62
76
|
GuardrailPiiEntityType: () => GuardrailPiiEntityType,
|
|
63
77
|
GuardrailSensitiveInformationPolicyAction: () => GuardrailSensitiveInformationPolicyAction,
|
|
@@ -77,6 +91,7 @@ __export(src_exports, {
|
|
|
77
91
|
InvokeModelWithResponseStreamResponseFilterSensitiveLog: () => InvokeModelWithResponseStreamResponseFilterSensitiveLog,
|
|
78
92
|
ListAsyncInvokesCommand: () => ListAsyncInvokesCommand,
|
|
79
93
|
ListAsyncInvokesResponseFilterSensitiveLog: () => ListAsyncInvokesResponseFilterSensitiveLog,
|
|
94
|
+
MessageFilterSensitiveLog: () => MessageFilterSensitiveLog,
|
|
80
95
|
ModelErrorException: () => ModelErrorException,
|
|
81
96
|
ModelNotReadyException: () => ModelNotReadyException,
|
|
82
97
|
ModelStreamErrorException: () => ModelStreamErrorException,
|
|
@@ -95,6 +110,7 @@ __export(src_exports, {
|
|
|
95
110
|
StartAsyncInvokeRequestFilterSensitiveLog: () => StartAsyncInvokeRequestFilterSensitiveLog,
|
|
96
111
|
StopReason: () => StopReason,
|
|
97
112
|
SystemContentBlock: () => SystemContentBlock,
|
|
113
|
+
SystemContentBlockFilterSensitiveLog: () => SystemContentBlockFilterSensitiveLog,
|
|
98
114
|
ThrottlingException: () => ThrottlingException,
|
|
99
115
|
Tool: () => Tool,
|
|
100
116
|
ToolChoice: () => ToolChoice,
|
|
@@ -257,11 +273,8 @@ var BedrockRuntimeClient = _BedrockRuntimeClient;
|
|
|
257
273
|
var import_middleware_serde = require("@smithy/middleware-serde");
|
|
258
274
|
|
|
259
275
|
|
|
260
|
-
// src/
|
|
261
|
-
var import_core2 = require("@aws-sdk/core");
|
|
262
|
-
|
|
276
|
+
// src/models/models_0.ts
|
|
263
277
|
|
|
264
|
-
var import_uuid = require("uuid");
|
|
265
278
|
|
|
266
279
|
// src/models/BedrockRuntimeServiceException.ts
|
|
267
280
|
|
|
@@ -278,7 +291,6 @@ __name(_BedrockRuntimeServiceException, "BedrockRuntimeServiceException");
|
|
|
278
291
|
var BedrockRuntimeServiceException = _BedrockRuntimeServiceException;
|
|
279
292
|
|
|
280
293
|
// src/models/models_0.ts
|
|
281
|
-
|
|
282
294
|
var _AccessDeniedException = class _AccessDeniedException extends BedrockRuntimeServiceException {
|
|
283
295
|
/**
|
|
284
296
|
* @internal
|
|
@@ -435,16 +447,30 @@ var _ServiceUnavailableException = class _ServiceUnavailableException extends Be
|
|
|
435
447
|
};
|
|
436
448
|
__name(_ServiceUnavailableException, "ServiceUnavailableException");
|
|
437
449
|
var ServiceUnavailableException = _ServiceUnavailableException;
|
|
450
|
+
var GuardrailImageFormat = {
|
|
451
|
+
JPEG: "jpeg",
|
|
452
|
+
PNG: "png"
|
|
453
|
+
};
|
|
454
|
+
var GuardrailImageSource;
|
|
455
|
+
((GuardrailImageSource2) => {
|
|
456
|
+
GuardrailImageSource2.visit = /* @__PURE__ */ __name((value, visitor) => {
|
|
457
|
+
if (value.bytes !== void 0)
|
|
458
|
+
return visitor.bytes(value.bytes);
|
|
459
|
+
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
460
|
+
}, "visit");
|
|
461
|
+
})(GuardrailImageSource || (GuardrailImageSource = {}));
|
|
438
462
|
var GuardrailContentQualifier = {
|
|
439
463
|
GROUNDING_SOURCE: "grounding_source",
|
|
440
464
|
GUARD_CONTENT: "guard_content",
|
|
441
465
|
QUERY: "query"
|
|
442
466
|
};
|
|
443
467
|
var GuardrailContentBlock;
|
|
444
|
-
((
|
|
445
|
-
|
|
468
|
+
((GuardrailContentBlock2) => {
|
|
469
|
+
GuardrailContentBlock2.visit = /* @__PURE__ */ __name((value, visitor) => {
|
|
446
470
|
if (value.text !== void 0)
|
|
447
471
|
return visitor.text(value.text);
|
|
472
|
+
if (value.image !== void 0)
|
|
473
|
+
return visitor.image(value.image);
|
|
448
474
|
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
449
475
|
}, "visit");
|
|
450
476
|
})(GuardrailContentBlock || (GuardrailContentBlock = {}));
|
|
@@ -559,16 +585,30 @@ var DocumentSource;
|
|
|
559
585
|
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
560
586
|
}, "visit");
|
|
561
587
|
})(DocumentSource || (DocumentSource = {}));
|
|
588
|
+
var GuardrailConverseImageFormat = {
|
|
589
|
+
JPEG: "jpeg",
|
|
590
|
+
PNG: "png"
|
|
591
|
+
};
|
|
592
|
+
var GuardrailConverseImageSource;
|
|
593
|
+
((GuardrailConverseImageSource2) => {
|
|
594
|
+
GuardrailConverseImageSource2.visit = /* @__PURE__ */ __name((value, visitor) => {
|
|
595
|
+
if (value.bytes !== void 0)
|
|
596
|
+
return visitor.bytes(value.bytes);
|
|
597
|
+
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
598
|
+
}, "visit");
|
|
599
|
+
})(GuardrailConverseImageSource || (GuardrailConverseImageSource = {}));
|
|
562
600
|
var GuardrailConverseContentQualifier = {
|
|
563
601
|
GROUNDING_SOURCE: "grounding_source",
|
|
564
602
|
GUARD_CONTENT: "guard_content",
|
|
565
603
|
QUERY: "query"
|
|
566
604
|
};
|
|
567
605
|
var GuardrailConverseContentBlock;
|
|
568
|
-
((
|
|
569
|
-
|
|
606
|
+
((GuardrailConverseContentBlock2) => {
|
|
607
|
+
GuardrailConverseContentBlock2.visit = /* @__PURE__ */ __name((value, visitor) => {
|
|
570
608
|
if (value.text !== void 0)
|
|
571
609
|
return visitor.text(value.text);
|
|
610
|
+
if (value.image !== void 0)
|
|
611
|
+
return visitor.image(value.image);
|
|
572
612
|
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
573
613
|
}, "visit");
|
|
574
614
|
})(GuardrailConverseContentBlock || (GuardrailConverseContentBlock = {}));
|
|
@@ -664,8 +704,8 @@ var PromptVariableValues;
|
|
|
664
704
|
}, "visit");
|
|
665
705
|
})(PromptVariableValues || (PromptVariableValues = {}));
|
|
666
706
|
var SystemContentBlock;
|
|
667
|
-
((
|
|
668
|
-
|
|
707
|
+
((SystemContentBlock2) => {
|
|
708
|
+
SystemContentBlock2.visit = /* @__PURE__ */ __name((value, visitor) => {
|
|
669
709
|
if (value.text !== void 0)
|
|
670
710
|
return visitor.text(value.text);
|
|
671
711
|
if (value.guardContent !== void 0)
|
|
@@ -885,18 +925,98 @@ var StartAsyncInvokeRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) =>
|
|
|
885
925
|
...obj.modelInput && { modelInput: import_smithy_client.SENSITIVE_STRING },
|
|
886
926
|
...obj.outputDataConfig && { outputDataConfig: obj.outputDataConfig }
|
|
887
927
|
}), "StartAsyncInvokeRequestFilterSensitiveLog");
|
|
928
|
+
var GuardrailImageSourceFilterSensitiveLog = /* @__PURE__ */ __name((obj) => {
|
|
929
|
+
if (obj.bytes !== void 0)
|
|
930
|
+
return { bytes: obj.bytes };
|
|
931
|
+
if (obj.$unknown !== void 0)
|
|
932
|
+
return { [obj.$unknown[0]]: "UNKNOWN" };
|
|
933
|
+
}, "GuardrailImageSourceFilterSensitiveLog");
|
|
934
|
+
var GuardrailImageBlockFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
935
|
+
...obj,
|
|
936
|
+
...obj.source && { source: import_smithy_client.SENSITIVE_STRING }
|
|
937
|
+
}), "GuardrailImageBlockFilterSensitiveLog");
|
|
938
|
+
var GuardrailContentBlockFilterSensitiveLog = /* @__PURE__ */ __name((obj) => {
|
|
939
|
+
if (obj.text !== void 0)
|
|
940
|
+
return { text: obj.text };
|
|
941
|
+
if (obj.image !== void 0)
|
|
942
|
+
return { image: import_smithy_client.SENSITIVE_STRING };
|
|
943
|
+
if (obj.$unknown !== void 0)
|
|
944
|
+
return { [obj.$unknown[0]]: "UNKNOWN" };
|
|
945
|
+
}, "GuardrailContentBlockFilterSensitiveLog");
|
|
946
|
+
var ApplyGuardrailRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
947
|
+
...obj,
|
|
948
|
+
...obj.content && { content: obj.content.map((item) => GuardrailContentBlockFilterSensitiveLog(item)) }
|
|
949
|
+
}), "ApplyGuardrailRequestFilterSensitiveLog");
|
|
950
|
+
var GuardrailConverseImageSourceFilterSensitiveLog = /* @__PURE__ */ __name((obj) => {
|
|
951
|
+
if (obj.bytes !== void 0)
|
|
952
|
+
return { bytes: obj.bytes };
|
|
953
|
+
if (obj.$unknown !== void 0)
|
|
954
|
+
return { [obj.$unknown[0]]: "UNKNOWN" };
|
|
955
|
+
}, "GuardrailConverseImageSourceFilterSensitiveLog");
|
|
956
|
+
var GuardrailConverseImageBlockFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
957
|
+
...obj,
|
|
958
|
+
...obj.source && { source: import_smithy_client.SENSITIVE_STRING }
|
|
959
|
+
}), "GuardrailConverseImageBlockFilterSensitiveLog");
|
|
960
|
+
var GuardrailConverseContentBlockFilterSensitiveLog = /* @__PURE__ */ __name((obj) => {
|
|
961
|
+
if (obj.text !== void 0)
|
|
962
|
+
return { text: obj.text };
|
|
963
|
+
if (obj.image !== void 0)
|
|
964
|
+
return { image: import_smithy_client.SENSITIVE_STRING };
|
|
965
|
+
if (obj.$unknown !== void 0)
|
|
966
|
+
return { [obj.$unknown[0]]: "UNKNOWN" };
|
|
967
|
+
}, "GuardrailConverseContentBlockFilterSensitiveLog");
|
|
968
|
+
var ContentBlockFilterSensitiveLog = /* @__PURE__ */ __name((obj) => {
|
|
969
|
+
if (obj.text !== void 0)
|
|
970
|
+
return { text: obj.text };
|
|
971
|
+
if (obj.image !== void 0)
|
|
972
|
+
return { image: obj.image };
|
|
973
|
+
if (obj.document !== void 0)
|
|
974
|
+
return { document: obj.document };
|
|
975
|
+
if (obj.video !== void 0)
|
|
976
|
+
return { video: obj.video };
|
|
977
|
+
if (obj.toolUse !== void 0)
|
|
978
|
+
return { toolUse: obj.toolUse };
|
|
979
|
+
if (obj.toolResult !== void 0)
|
|
980
|
+
return { toolResult: obj.toolResult };
|
|
981
|
+
if (obj.guardContent !== void 0)
|
|
982
|
+
return { guardContent: GuardrailConverseContentBlockFilterSensitiveLog(obj.guardContent) };
|
|
983
|
+
if (obj.$unknown !== void 0)
|
|
984
|
+
return { [obj.$unknown[0]]: "UNKNOWN" };
|
|
985
|
+
}, "ContentBlockFilterSensitiveLog");
|
|
986
|
+
var MessageFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
987
|
+
...obj,
|
|
988
|
+
...obj.content && { content: obj.content.map((item) => ContentBlockFilterSensitiveLog(item)) }
|
|
989
|
+
}), "MessageFilterSensitiveLog");
|
|
990
|
+
var SystemContentBlockFilterSensitiveLog = /* @__PURE__ */ __name((obj) => {
|
|
991
|
+
if (obj.text !== void 0)
|
|
992
|
+
return { text: obj.text };
|
|
993
|
+
if (obj.guardContent !== void 0)
|
|
994
|
+
return { guardContent: GuardrailConverseContentBlockFilterSensitiveLog(obj.guardContent) };
|
|
995
|
+
if (obj.$unknown !== void 0)
|
|
996
|
+
return { [obj.$unknown[0]]: "UNKNOWN" };
|
|
997
|
+
}, "SystemContentBlockFilterSensitiveLog");
|
|
888
998
|
var ConverseRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
889
999
|
...obj,
|
|
890
|
-
...obj.messages && { messages: obj.messages.map((item) => item) },
|
|
891
|
-
...obj.system && { system: obj.system.map((item) => item) },
|
|
1000
|
+
...obj.messages && { messages: obj.messages.map((item) => MessageFilterSensitiveLog(item)) },
|
|
1001
|
+
...obj.system && { system: obj.system.map((item) => SystemContentBlockFilterSensitiveLog(item)) },
|
|
892
1002
|
...obj.toolConfig && { toolConfig: obj.toolConfig },
|
|
893
1003
|
...obj.promptVariables && { promptVariables: import_smithy_client.SENSITIVE_STRING },
|
|
894
1004
|
...obj.requestMetadata && { requestMetadata: import_smithy_client.SENSITIVE_STRING }
|
|
895
1005
|
}), "ConverseRequestFilterSensitiveLog");
|
|
1006
|
+
var ConverseOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => {
|
|
1007
|
+
if (obj.message !== void 0)
|
|
1008
|
+
return { message: MessageFilterSensitiveLog(obj.message) };
|
|
1009
|
+
if (obj.$unknown !== void 0)
|
|
1010
|
+
return { [obj.$unknown[0]]: "UNKNOWN" };
|
|
1011
|
+
}, "ConverseOutputFilterSensitiveLog");
|
|
1012
|
+
var ConverseResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
1013
|
+
...obj,
|
|
1014
|
+
...obj.output && { output: ConverseOutputFilterSensitiveLog(obj.output) }
|
|
1015
|
+
}), "ConverseResponseFilterSensitiveLog");
|
|
896
1016
|
var ConverseStreamRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
897
1017
|
...obj,
|
|
898
|
-
...obj.messages && { messages: obj.messages.map((item) => item) },
|
|
899
|
-
...obj.system && { system: obj.system.map((item) => item) },
|
|
1018
|
+
...obj.messages && { messages: obj.messages.map((item) => MessageFilterSensitiveLog(item)) },
|
|
1019
|
+
...obj.system && { system: obj.system.map((item) => SystemContentBlockFilterSensitiveLog(item)) },
|
|
900
1020
|
...obj.toolConfig && { toolConfig: obj.toolConfig },
|
|
901
1021
|
...obj.promptVariables && { promptVariables: import_smithy_client.SENSITIVE_STRING },
|
|
902
1022
|
...obj.requestMetadata && { requestMetadata: import_smithy_client.SENSITIVE_STRING }
|
|
@@ -971,6 +1091,10 @@ var InvokeModelWithResponseStreamResponseFilterSensitiveLog = /* @__PURE__ */ __
|
|
|
971
1091
|
}), "InvokeModelWithResponseStreamResponseFilterSensitiveLog");
|
|
972
1092
|
|
|
973
1093
|
// src/protocols/Aws_restJson1.ts
|
|
1094
|
+
var import_core2 = require("@aws-sdk/core");
|
|
1095
|
+
|
|
1096
|
+
|
|
1097
|
+
var import_uuid = require("uuid");
|
|
974
1098
|
var se_ApplyGuardrailCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
975
1099
|
const b = (0, import_core.requestBuilder)(input, context);
|
|
976
1100
|
const headers = {
|
|
@@ -982,7 +1106,7 @@ var se_ApplyGuardrailCommand = /* @__PURE__ */ __name(async (input, context) =>
|
|
|
982
1106
|
let body;
|
|
983
1107
|
body = JSON.stringify(
|
|
984
1108
|
(0, import_smithy_client.take)(input, {
|
|
985
|
-
content: (_) => (
|
|
1109
|
+
content: (_) => se_GuardrailContentBlockList(_, context),
|
|
986
1110
|
source: []
|
|
987
1111
|
})
|
|
988
1112
|
);
|
|
@@ -1007,7 +1131,7 @@ var se_ConverseCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
|
1007
1131
|
performanceConfig: (_) => (0, import_smithy_client._json)(_),
|
|
1008
1132
|
promptVariables: (_) => (0, import_smithy_client._json)(_),
|
|
1009
1133
|
requestMetadata: (_) => (0, import_smithy_client._json)(_),
|
|
1010
|
-
system: (_) => (
|
|
1134
|
+
system: (_) => se_SystemContentBlocks(_, context),
|
|
1011
1135
|
toolConfig: (_) => se_ToolConfiguration(_, context)
|
|
1012
1136
|
})
|
|
1013
1137
|
);
|
|
@@ -1032,7 +1156,7 @@ var se_ConverseStreamCommand = /* @__PURE__ */ __name(async (input, context) =>
|
|
|
1032
1156
|
performanceConfig: (_) => (0, import_smithy_client._json)(_),
|
|
1033
1157
|
promptVariables: (_) => (0, import_smithy_client._json)(_),
|
|
1034
1158
|
requestMetadata: (_) => (0, import_smithy_client._json)(_),
|
|
1035
|
-
system: (_) => (
|
|
1159
|
+
system: (_) => se_SystemContentBlocks(_, context),
|
|
1036
1160
|
toolConfig: (_) => se_ToolConfiguration(_, context)
|
|
1037
1161
|
})
|
|
1038
1162
|
);
|
|
@@ -1660,7 +1784,7 @@ var de_ValidationException_event = /* @__PURE__ */ __name(async (output, context
|
|
|
1660
1784
|
var se_ContentBlock = /* @__PURE__ */ __name((input, context) => {
|
|
1661
1785
|
return ContentBlock.visit(input, {
|
|
1662
1786
|
document: (value) => ({ document: se_DocumentBlock(value, context) }),
|
|
1663
|
-
guardContent: (value) => ({ guardContent: (
|
|
1787
|
+
guardContent: (value) => ({ guardContent: se_GuardrailConverseContentBlock(value, context) }),
|
|
1664
1788
|
image: (value) => ({ image: se_ImageBlock(value, context) }),
|
|
1665
1789
|
text: (value) => ({ text: value }),
|
|
1666
1790
|
toolResult: (value) => ({ toolResult: se_ToolResultBlock(value, context) }),
|
|
@@ -1687,6 +1811,49 @@ var se_DocumentSource = /* @__PURE__ */ __name((input, context) => {
|
|
|
1687
1811
|
_: (name, value) => ({ name: value })
|
|
1688
1812
|
});
|
|
1689
1813
|
}, "se_DocumentSource");
|
|
1814
|
+
var se_GuardrailContentBlock = /* @__PURE__ */ __name((input, context) => {
|
|
1815
|
+
return GuardrailContentBlock.visit(input, {
|
|
1816
|
+
image: (value) => ({ image: se_GuardrailImageBlock(value, context) }),
|
|
1817
|
+
text: (value) => ({ text: (0, import_smithy_client._json)(value) }),
|
|
1818
|
+
_: (name, value) => ({ name: value })
|
|
1819
|
+
});
|
|
1820
|
+
}, "se_GuardrailContentBlock");
|
|
1821
|
+
var se_GuardrailContentBlockList = /* @__PURE__ */ __name((input, context) => {
|
|
1822
|
+
return input.filter((e) => e != null).map((entry) => {
|
|
1823
|
+
return se_GuardrailContentBlock(entry, context);
|
|
1824
|
+
});
|
|
1825
|
+
}, "se_GuardrailContentBlockList");
|
|
1826
|
+
var se_GuardrailConverseContentBlock = /* @__PURE__ */ __name((input, context) => {
|
|
1827
|
+
return GuardrailConverseContentBlock.visit(input, {
|
|
1828
|
+
image: (value) => ({ image: se_GuardrailConverseImageBlock(value, context) }),
|
|
1829
|
+
text: (value) => ({ text: (0, import_smithy_client._json)(value) }),
|
|
1830
|
+
_: (name, value) => ({ name: value })
|
|
1831
|
+
});
|
|
1832
|
+
}, "se_GuardrailConverseContentBlock");
|
|
1833
|
+
var se_GuardrailConverseImageBlock = /* @__PURE__ */ __name((input, context) => {
|
|
1834
|
+
return (0, import_smithy_client.take)(input, {
|
|
1835
|
+
format: [],
|
|
1836
|
+
source: (_) => se_GuardrailConverseImageSource(_, context)
|
|
1837
|
+
});
|
|
1838
|
+
}, "se_GuardrailConverseImageBlock");
|
|
1839
|
+
var se_GuardrailConverseImageSource = /* @__PURE__ */ __name((input, context) => {
|
|
1840
|
+
return GuardrailConverseImageSource.visit(input, {
|
|
1841
|
+
bytes: (value) => ({ bytes: context.base64Encoder(value) }),
|
|
1842
|
+
_: (name, value) => ({ name: value })
|
|
1843
|
+
});
|
|
1844
|
+
}, "se_GuardrailConverseImageSource");
|
|
1845
|
+
var se_GuardrailImageBlock = /* @__PURE__ */ __name((input, context) => {
|
|
1846
|
+
return (0, import_smithy_client.take)(input, {
|
|
1847
|
+
format: [],
|
|
1848
|
+
source: (_) => se_GuardrailImageSource(_, context)
|
|
1849
|
+
});
|
|
1850
|
+
}, "se_GuardrailImageBlock");
|
|
1851
|
+
var se_GuardrailImageSource = /* @__PURE__ */ __name((input, context) => {
|
|
1852
|
+
return GuardrailImageSource.visit(input, {
|
|
1853
|
+
bytes: (value) => ({ bytes: context.base64Encoder(value) }),
|
|
1854
|
+
_: (name, value) => ({ name: value })
|
|
1855
|
+
});
|
|
1856
|
+
}, "se_GuardrailImageSource");
|
|
1690
1857
|
var se_ImageBlock = /* @__PURE__ */ __name((input, context) => {
|
|
1691
1858
|
return (0, import_smithy_client.take)(input, {
|
|
1692
1859
|
format: [],
|
|
@@ -1721,6 +1888,18 @@ var se_Messages = /* @__PURE__ */ __name((input, context) => {
|
|
|
1721
1888
|
var se_ModelInputPayload = /* @__PURE__ */ __name((input, context) => {
|
|
1722
1889
|
return input;
|
|
1723
1890
|
}, "se_ModelInputPayload");
|
|
1891
|
+
var se_SystemContentBlock = /* @__PURE__ */ __name((input, context) => {
|
|
1892
|
+
return SystemContentBlock.visit(input, {
|
|
1893
|
+
guardContent: (value) => ({ guardContent: se_GuardrailConverseContentBlock(value, context) }),
|
|
1894
|
+
text: (value) => ({ text: value }),
|
|
1895
|
+
_: (name, value) => ({ name: value })
|
|
1896
|
+
});
|
|
1897
|
+
}, "se_SystemContentBlock");
|
|
1898
|
+
var se_SystemContentBlocks = /* @__PURE__ */ __name((input, context) => {
|
|
1899
|
+
return input.filter((e) => e != null).map((entry) => {
|
|
1900
|
+
return se_SystemContentBlock(entry, context);
|
|
1901
|
+
});
|
|
1902
|
+
}, "se_SystemContentBlocks");
|
|
1724
1903
|
var se_Tool = /* @__PURE__ */ __name((input, context) => {
|
|
1725
1904
|
return Tool.visit(input, {
|
|
1726
1905
|
toolSpec: (value) => ({ toolSpec: se_ToolSpecification(value, context) }),
|
|
@@ -1823,7 +2002,7 @@ var de_ContentBlock = /* @__PURE__ */ __name((output, context) => {
|
|
|
1823
2002
|
}
|
|
1824
2003
|
if (output.guardContent != null) {
|
|
1825
2004
|
return {
|
|
1826
|
-
guardContent: (
|
|
2005
|
+
guardContent: de_GuardrailConverseContentBlock((0, import_core2.awsExpectUnion)(output.guardContent), context)
|
|
1827
2006
|
};
|
|
1828
2007
|
}
|
|
1829
2008
|
if (output.image != null) {
|
|
@@ -1875,12 +2054,14 @@ var de_ConverseStreamMetadataEvent = /* @__PURE__ */ __name((output, context) =>
|
|
|
1875
2054
|
}, "de_ConverseStreamMetadataEvent");
|
|
1876
2055
|
var de_ConverseStreamTrace = /* @__PURE__ */ __name((output, context) => {
|
|
1877
2056
|
return (0, import_smithy_client.take)(output, {
|
|
1878
|
-
guardrail: (_) => de_GuardrailTraceAssessment(_, context)
|
|
2057
|
+
guardrail: (_) => de_GuardrailTraceAssessment(_, context),
|
|
2058
|
+
promptRouter: import_smithy_client._json
|
|
1879
2059
|
});
|
|
1880
2060
|
}, "de_ConverseStreamTrace");
|
|
1881
2061
|
var de_ConverseTrace = /* @__PURE__ */ __name((output, context) => {
|
|
1882
2062
|
return (0, import_smithy_client.take)(output, {
|
|
1883
|
-
guardrail: (_) => de_GuardrailTraceAssessment(_, context)
|
|
2063
|
+
guardrail: (_) => de_GuardrailTraceAssessment(_, context),
|
|
2064
|
+
promptRouter: import_smithy_client._json
|
|
1884
2065
|
});
|
|
1885
2066
|
}, "de_ConverseTrace");
|
|
1886
2067
|
var de_DocumentBlock = /* @__PURE__ */ __name((output, context) => {
|
|
@@ -1951,6 +2132,33 @@ var de_GuardrailContextualGroundingPolicyAssessment = /* @__PURE__ */ __name((ou
|
|
|
1951
2132
|
filters: (_) => de_GuardrailContextualGroundingFilters(_, context)
|
|
1952
2133
|
});
|
|
1953
2134
|
}, "de_GuardrailContextualGroundingPolicyAssessment");
|
|
2135
|
+
var de_GuardrailConverseContentBlock = /* @__PURE__ */ __name((output, context) => {
|
|
2136
|
+
if (output.image != null) {
|
|
2137
|
+
return {
|
|
2138
|
+
image: de_GuardrailConverseImageBlock(output.image, context)
|
|
2139
|
+
};
|
|
2140
|
+
}
|
|
2141
|
+
if (output.text != null) {
|
|
2142
|
+
return {
|
|
2143
|
+
text: (0, import_smithy_client._json)(output.text)
|
|
2144
|
+
};
|
|
2145
|
+
}
|
|
2146
|
+
return { $unknown: Object.entries(output)[0] };
|
|
2147
|
+
}, "de_GuardrailConverseContentBlock");
|
|
2148
|
+
var de_GuardrailConverseImageBlock = /* @__PURE__ */ __name((output, context) => {
|
|
2149
|
+
return (0, import_smithy_client.take)(output, {
|
|
2150
|
+
format: import_smithy_client.expectString,
|
|
2151
|
+
source: (_) => de_GuardrailConverseImageSource((0, import_core2.awsExpectUnion)(_), context)
|
|
2152
|
+
});
|
|
2153
|
+
}, "de_GuardrailConverseImageBlock");
|
|
2154
|
+
var de_GuardrailConverseImageSource = /* @__PURE__ */ __name((output, context) => {
|
|
2155
|
+
if (output.bytes != null) {
|
|
2156
|
+
return {
|
|
2157
|
+
bytes: context.base64Decoder(output.bytes)
|
|
2158
|
+
};
|
|
2159
|
+
}
|
|
2160
|
+
return { $unknown: Object.entries(output)[0] };
|
|
2161
|
+
}, "de_GuardrailConverseImageSource");
|
|
1954
2162
|
var de_GuardrailTraceAssessment = /* @__PURE__ */ __name((output, context) => {
|
|
1955
2163
|
return (0, import_smithy_client.take)(output, {
|
|
1956
2164
|
inputAssessment: (_) => de_GuardrailAssessmentMap(_, context),
|
|
@@ -2090,7 +2298,7 @@ var _ApplyGuardrailCommand = class _ApplyGuardrailCommand extends import_smithy_
|
|
|
2090
2298
|
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
2091
2299
|
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
|
|
2092
2300
|
];
|
|
2093
|
-
}).s("AmazonBedrockFrontendService", "ApplyGuardrail", {}).n("BedrockRuntimeClient", "ApplyGuardrailCommand").f(
|
|
2301
|
+
}).s("AmazonBedrockFrontendService", "ApplyGuardrail", {}).n("BedrockRuntimeClient", "ApplyGuardrailCommand").f(ApplyGuardrailRequestFilterSensitiveLog, void 0).ser(se_ApplyGuardrailCommand).de(de_ApplyGuardrailCommand).build() {
|
|
2094
2302
|
};
|
|
2095
2303
|
__name(_ApplyGuardrailCommand, "ApplyGuardrailCommand");
|
|
2096
2304
|
var ApplyGuardrailCommand = _ApplyGuardrailCommand;
|
|
@@ -2104,7 +2312,7 @@ var _ConverseCommand = class _ConverseCommand extends import_smithy_client.Comma
|
|
|
2104
2312
|
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
2105
2313
|
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
|
|
2106
2314
|
];
|
|
2107
|
-
}).s("AmazonBedrockFrontendService", "Converse", {}).n("BedrockRuntimeClient", "ConverseCommand").f(ConverseRequestFilterSensitiveLog,
|
|
2315
|
+
}).s("AmazonBedrockFrontendService", "Converse", {}).n("BedrockRuntimeClient", "ConverseCommand").f(ConverseRequestFilterSensitiveLog, ConverseResponseFilterSensitiveLog).ser(se_ConverseCommand).de(de_ConverseCommand).build() {
|
|
2108
2316
|
};
|
|
2109
2317
|
__name(_ConverseCommand, "ConverseCommand");
|
|
2110
2318
|
var ConverseCommand = _ConverseCommand;
|
|
@@ -2256,6 +2464,8 @@ var paginateListAsyncInvokes = (0, import_core.createPaginator)(BedrockRuntimeCl
|
|
|
2256
2464
|
ResourceNotFoundException,
|
|
2257
2465
|
ServiceQuotaExceededException,
|
|
2258
2466
|
ServiceUnavailableException,
|
|
2467
|
+
GuardrailImageFormat,
|
|
2468
|
+
GuardrailImageSource,
|
|
2259
2469
|
GuardrailContentQualifier,
|
|
2260
2470
|
GuardrailContentBlock,
|
|
2261
2471
|
GuardrailContentSource,
|
|
@@ -2275,6 +2485,8 @@ var paginateListAsyncInvokes = (0, import_core.createPaginator)(BedrockRuntimeCl
|
|
|
2275
2485
|
GuardrailTrace,
|
|
2276
2486
|
DocumentFormat,
|
|
2277
2487
|
DocumentSource,
|
|
2488
|
+
GuardrailConverseImageFormat,
|
|
2489
|
+
GuardrailConverseImageSource,
|
|
2278
2490
|
GuardrailConverseContentQualifier,
|
|
2279
2491
|
GuardrailConverseContentBlock,
|
|
2280
2492
|
ImageFormat,
|
|
@@ -2307,7 +2519,19 @@ var paginateListAsyncInvokes = (0, import_core.createPaginator)(BedrockRuntimeCl
|
|
|
2307
2519
|
AsyncInvokeSummaryFilterSensitiveLog,
|
|
2308
2520
|
ListAsyncInvokesResponseFilterSensitiveLog,
|
|
2309
2521
|
StartAsyncInvokeRequestFilterSensitiveLog,
|
|
2522
|
+
GuardrailImageSourceFilterSensitiveLog,
|
|
2523
|
+
GuardrailImageBlockFilterSensitiveLog,
|
|
2524
|
+
GuardrailContentBlockFilterSensitiveLog,
|
|
2525
|
+
ApplyGuardrailRequestFilterSensitiveLog,
|
|
2526
|
+
GuardrailConverseImageSourceFilterSensitiveLog,
|
|
2527
|
+
GuardrailConverseImageBlockFilterSensitiveLog,
|
|
2528
|
+
GuardrailConverseContentBlockFilterSensitiveLog,
|
|
2529
|
+
ContentBlockFilterSensitiveLog,
|
|
2530
|
+
MessageFilterSensitiveLog,
|
|
2531
|
+
SystemContentBlockFilterSensitiveLog,
|
|
2310
2532
|
ConverseRequestFilterSensitiveLog,
|
|
2533
|
+
ConverseOutputFilterSensitiveLog,
|
|
2534
|
+
ConverseResponseFilterSensitiveLog,
|
|
2311
2535
|
ConverseStreamRequestFilterSensitiveLog,
|
|
2312
2536
|
ConverseStreamOutputFilterSensitiveLog,
|
|
2313
2537
|
ConverseStreamResponseFilterSensitiveLog,
|
|
@@ -2,6 +2,7 @@ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
|
|
|
2
2
|
import { getSerdePlugin } from "@smithy/middleware-serde";
|
|
3
3
|
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
4
|
import { commonParams } from "../endpoint/EndpointParameters";
|
|
5
|
+
import { ApplyGuardrailRequestFilterSensitiveLog, } from "../models/models_0";
|
|
5
6
|
import { de_ApplyGuardrailCommand, se_ApplyGuardrailCommand } from "../protocols/Aws_restJson1";
|
|
6
7
|
export { $Command };
|
|
7
8
|
export class ApplyGuardrailCommand extends $Command
|
|
@@ -15,7 +16,7 @@ export class ApplyGuardrailCommand extends $Command
|
|
|
15
16
|
})
|
|
16
17
|
.s("AmazonBedrockFrontendService", "ApplyGuardrail", {})
|
|
17
18
|
.n("BedrockRuntimeClient", "ApplyGuardrailCommand")
|
|
18
|
-
.f(
|
|
19
|
+
.f(ApplyGuardrailRequestFilterSensitiveLog, void 0)
|
|
19
20
|
.ser(se_ApplyGuardrailCommand)
|
|
20
21
|
.de(de_ApplyGuardrailCommand)
|
|
21
22
|
.build() {
|
|
@@ -2,7 +2,7 @@ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
|
|
|
2
2
|
import { getSerdePlugin } from "@smithy/middleware-serde";
|
|
3
3
|
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
4
|
import { commonParams } from "../endpoint/EndpointParameters";
|
|
5
|
-
import { ConverseRequestFilterSensitiveLog } from "../models/models_0";
|
|
5
|
+
import { ConverseRequestFilterSensitiveLog, ConverseResponseFilterSensitiveLog, } from "../models/models_0";
|
|
6
6
|
import { de_ConverseCommand, se_ConverseCommand } from "../protocols/Aws_restJson1";
|
|
7
7
|
export { $Command };
|
|
8
8
|
export class ConverseCommand extends $Command
|
|
@@ -16,7 +16,7 @@ export class ConverseCommand extends $Command
|
|
|
16
16
|
})
|
|
17
17
|
.s("AmazonBedrockFrontendService", "Converse", {})
|
|
18
18
|
.n("BedrockRuntimeClient", "ConverseCommand")
|
|
19
|
-
.f(ConverseRequestFilterSensitiveLog,
|
|
19
|
+
.f(ConverseRequestFilterSensitiveLog, ConverseResponseFilterSensitiveLog)
|
|
20
20
|
.ser(se_ConverseCommand)
|
|
21
21
|
.de(de_ConverseCommand)
|
|
22
22
|
.build() {
|