@aws-sdk/client-bedrock-runtime 3.609.0 → 3.614.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.
@@ -0,0 +1,167 @@
1
+ import { Command as $Command } from "@smithy/smithy-client";
2
+ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
3
+ import { BedrockRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockRuntimeClient";
4
+ import { ApplyGuardrailRequest, ApplyGuardrailResponse } from "../models/models_0";
5
+ /**
6
+ * @public
7
+ */
8
+ export type { __MetadataBearer };
9
+ export { $Command };
10
+ /**
11
+ * @public
12
+ *
13
+ * The input for {@link ApplyGuardrailCommand}.
14
+ */
15
+ export interface ApplyGuardrailCommandInput extends ApplyGuardrailRequest {
16
+ }
17
+ /**
18
+ * @public
19
+ *
20
+ * The output of {@link ApplyGuardrailCommand}.
21
+ */
22
+ export interface ApplyGuardrailCommandOutput extends ApplyGuardrailResponse, __MetadataBearer {
23
+ }
24
+ declare const ApplyGuardrailCommand_base: {
25
+ new (input: ApplyGuardrailCommandInput): import("@smithy/smithy-client").CommandImpl<ApplyGuardrailCommandInput, ApplyGuardrailCommandOutput, BedrockRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
26
+ new (__0_0: ApplyGuardrailCommandInput): import("@smithy/smithy-client").CommandImpl<ApplyGuardrailCommandInput, ApplyGuardrailCommandOutput, BedrockRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
27
+ getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions;
28
+ };
29
+ /**
30
+ * <p>The action to apply a guardrail.</p>
31
+ * @example
32
+ * Use a bare-bones client and the command you need to make an API call.
33
+ * ```javascript
34
+ * import { BedrockRuntimeClient, ApplyGuardrailCommand } from "@aws-sdk/client-bedrock-runtime"; // ES Modules import
35
+ * // const { BedrockRuntimeClient, ApplyGuardrailCommand } = require("@aws-sdk/client-bedrock-runtime"); // CommonJS import
36
+ * const client = new BedrockRuntimeClient(config);
37
+ * const input = { // ApplyGuardrailRequest
38
+ * guardrailIdentifier: "STRING_VALUE", // required
39
+ * guardrailVersion: "STRING_VALUE", // required
40
+ * source: "INPUT" || "OUTPUT", // required
41
+ * content: [ // GuardrailContentBlockList // required
42
+ * { // GuardrailContentBlock Union: only one key present
43
+ * text: { // GuardrailTextBlock
44
+ * text: "STRING_VALUE", // required
45
+ * qualifiers: [ // GuardrailContentQualifierList
46
+ * "grounding_source" || "query" || "guard_content",
47
+ * ],
48
+ * },
49
+ * },
50
+ * ],
51
+ * };
52
+ * const command = new ApplyGuardrailCommand(input);
53
+ * const response = await client.send(command);
54
+ * // { // ApplyGuardrailResponse
55
+ * // usage: { // GuardrailUsage
56
+ * // topicPolicyUnits: Number("int"), // required
57
+ * // contentPolicyUnits: Number("int"), // required
58
+ * // wordPolicyUnits: Number("int"), // required
59
+ * // sensitiveInformationPolicyUnits: Number("int"), // required
60
+ * // sensitiveInformationPolicyFreeUnits: Number("int"), // required
61
+ * // contextualGroundingPolicyUnits: Number("int"), // required
62
+ * // },
63
+ * // action: "NONE" || "GUARDRAIL_INTERVENED", // required
64
+ * // outputs: [ // GuardrailOutputContentList // required
65
+ * // { // GuardrailOutputContent
66
+ * // text: "STRING_VALUE",
67
+ * // },
68
+ * // ],
69
+ * // assessments: [ // GuardrailAssessmentList // required
70
+ * // { // GuardrailAssessment
71
+ * // topicPolicy: { // GuardrailTopicPolicyAssessment
72
+ * // topics: [ // GuardrailTopicList // required
73
+ * // { // GuardrailTopic
74
+ * // name: "STRING_VALUE", // required
75
+ * // type: "DENY", // required
76
+ * // action: "BLOCKED", // required
77
+ * // },
78
+ * // ],
79
+ * // },
80
+ * // contentPolicy: { // GuardrailContentPolicyAssessment
81
+ * // filters: [ // GuardrailContentFilterList // required
82
+ * // { // GuardrailContentFilter
83
+ * // type: "INSULTS" || "HATE" || "SEXUAL" || "VIOLENCE" || "MISCONDUCT" || "PROMPT_ATTACK", // required
84
+ * // confidence: "NONE" || "LOW" || "MEDIUM" || "HIGH", // required
85
+ * // action: "BLOCKED", // required
86
+ * // },
87
+ * // ],
88
+ * // },
89
+ * // wordPolicy: { // GuardrailWordPolicyAssessment
90
+ * // customWords: [ // GuardrailCustomWordList // required
91
+ * // { // GuardrailCustomWord
92
+ * // match: "STRING_VALUE", // required
93
+ * // action: "BLOCKED", // required
94
+ * // },
95
+ * // ],
96
+ * // managedWordLists: [ // GuardrailManagedWordList // required
97
+ * // { // GuardrailManagedWord
98
+ * // match: "STRING_VALUE", // required
99
+ * // type: "PROFANITY", // required
100
+ * // action: "BLOCKED", // required
101
+ * // },
102
+ * // ],
103
+ * // },
104
+ * // sensitiveInformationPolicy: { // GuardrailSensitiveInformationPolicyAssessment
105
+ * // piiEntities: [ // GuardrailPiiEntityFilterList // required
106
+ * // { // GuardrailPiiEntityFilter
107
+ * // match: "STRING_VALUE", // required
108
+ * // type: "ADDRESS" || "AGE" || "AWS_ACCESS_KEY" || "AWS_SECRET_KEY" || "CA_HEALTH_NUMBER" || "CA_SOCIAL_INSURANCE_NUMBER" || "CREDIT_DEBIT_CARD_CVV" || "CREDIT_DEBIT_CARD_EXPIRY" || "CREDIT_DEBIT_CARD_NUMBER" || "DRIVER_ID" || "EMAIL" || "INTERNATIONAL_BANK_ACCOUNT_NUMBER" || "IP_ADDRESS" || "LICENSE_PLATE" || "MAC_ADDRESS" || "NAME" || "PASSWORD" || "PHONE" || "PIN" || "SWIFT_CODE" || "UK_NATIONAL_HEALTH_SERVICE_NUMBER" || "UK_NATIONAL_INSURANCE_NUMBER" || "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER" || "URL" || "USERNAME" || "US_BANK_ACCOUNT_NUMBER" || "US_BANK_ROUTING_NUMBER" || "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER" || "US_PASSPORT_NUMBER" || "US_SOCIAL_SECURITY_NUMBER" || "VEHICLE_IDENTIFICATION_NUMBER", // required
109
+ * // action: "ANONYMIZED" || "BLOCKED", // required
110
+ * // },
111
+ * // ],
112
+ * // regexes: [ // GuardrailRegexFilterList // required
113
+ * // { // GuardrailRegexFilter
114
+ * // name: "STRING_VALUE",
115
+ * // match: "STRING_VALUE",
116
+ * // regex: "STRING_VALUE",
117
+ * // action: "ANONYMIZED" || "BLOCKED", // required
118
+ * // },
119
+ * // ],
120
+ * // },
121
+ * // contextualGroundingPolicy: { // GuardrailContextualGroundingPolicyAssessment
122
+ * // filters: [ // GuardrailContextualGroundingFilters
123
+ * // { // GuardrailContextualGroundingFilter
124
+ * // type: "GROUNDING" || "RELEVANCE", // required
125
+ * // threshold: Number("double"), // required
126
+ * // score: Number("double"), // required
127
+ * // action: "BLOCKED" || "NONE", // required
128
+ * // },
129
+ * // ],
130
+ * // },
131
+ * // },
132
+ * // ],
133
+ * // };
134
+ *
135
+ * ```
136
+ *
137
+ * @param ApplyGuardrailCommandInput - {@link ApplyGuardrailCommandInput}
138
+ * @returns {@link ApplyGuardrailCommandOutput}
139
+ * @see {@link ApplyGuardrailCommandInput} for command's `input` shape.
140
+ * @see {@link ApplyGuardrailCommandOutput} for command's `response` shape.
141
+ * @see {@link BedrockRuntimeClientResolvedConfig | config} for BedrockRuntimeClient's `config` shape.
142
+ *
143
+ * @throws {@link AccessDeniedException} (client fault)
144
+ * <p>The request is denied because of missing access permissions.</p>
145
+ *
146
+ * @throws {@link InternalServerException} (server fault)
147
+ * <p>An internal server error occurred. Retry your request.</p>
148
+ *
149
+ * @throws {@link ResourceNotFoundException} (client fault)
150
+ * <p>The specified resource ARN was not found. Check the ARN and try your request again.</p>
151
+ *
152
+ * @throws {@link ServiceQuotaExceededException} (client fault)
153
+ * <p>The number of requests exceeds the service quota. Resubmit your request later.</p>
154
+ *
155
+ * @throws {@link ThrottlingException} (client fault)
156
+ * <p>The number of requests exceeds the limit. Resubmit your request later.</p>
157
+ *
158
+ * @throws {@link ValidationException} (client fault)
159
+ * <p>Input validation failed. Check your request parameters and retry the request.</p>
160
+ *
161
+ * @throws {@link BedrockRuntimeServiceException}
162
+ * <p>Base exception class for all service exceptions from BedrockRuntime service.</p>
163
+ *
164
+ * @public
165
+ */
166
+ export declare class ApplyGuardrailCommand extends ApplyGuardrailCommand_base {
167
+ }
@@ -97,6 +97,9 @@ declare const ConverseCommand_base: {
97
97
  * guardContent: { // GuardrailConverseContentBlock Union: only one key present
98
98
  * text: { // GuardrailConverseTextBlock
99
99
  * text: "STRING_VALUE", // required
100
+ * qualifiers: [ // GuardrailConverseContentQualifierList
101
+ * "grounding_source" || "query" || "guard_content",
102
+ * ],
100
103
  * },
101
104
  * },
102
105
  * },
@@ -109,6 +112,9 @@ declare const ConverseCommand_base: {
109
112
  * guardContent: {// Union: only one key present
110
113
  * text: {
111
114
  * text: "STRING_VALUE", // required
115
+ * qualifiers: [
116
+ * "grounding_source" || "query" || "guard_content",
117
+ * ],
112
118
  * },
113
119
  * },
114
120
  * },
@@ -204,6 +210,9 @@ declare const ConverseCommand_base: {
204
210
  * // guardContent: { // GuardrailConverseContentBlock Union: only one key present
205
211
  * // text: { // GuardrailConverseTextBlock
206
212
  * // text: "STRING_VALUE", // required
213
+ * // qualifiers: [ // GuardrailConverseContentQualifierList
214
+ * // "grounding_source" || "query" || "guard_content",
215
+ * // ],
207
216
  * // },
208
217
  * // },
209
218
  * // },
@@ -277,6 +286,16 @@ declare const ConverseCommand_base: {
277
286
  * // },
278
287
  * // ],
279
288
  * // },
289
+ * // contextualGroundingPolicy: { // GuardrailContextualGroundingPolicyAssessment
290
+ * // filters: [ // GuardrailContextualGroundingFilters
291
+ * // { // GuardrailContextualGroundingFilter
292
+ * // type: "GROUNDING" || "RELEVANCE", // required
293
+ * // threshold: Number("double"), // required
294
+ * // score: Number("double"), // required
295
+ * // action: "BLOCKED" || "NONE", // required
296
+ * // },
297
+ * // ],
298
+ * // },
280
299
  * // },
281
300
  * // },
282
301
  * // outputAssessments: { // GuardrailAssessmentListMap
@@ -332,6 +351,16 @@ declare const ConverseCommand_base: {
332
351
  * // },
333
352
  * // ],
334
353
  * // },
354
+ * // contextualGroundingPolicy: {
355
+ * // filters: [
356
+ * // {
357
+ * // type: "GROUNDING" || "RELEVANCE", // required
358
+ * // threshold: Number("double"), // required
359
+ * // score: Number("double"), // required
360
+ * // action: "BLOCKED" || "NONE", // required
361
+ * // },
362
+ * // ],
363
+ * // },
335
364
  * // },
336
365
  * // ],
337
366
  * // },
@@ -100,6 +100,9 @@ declare const ConverseStreamCommand_base: {
100
100
  * guardContent: { // GuardrailConverseContentBlock Union: only one key present
101
101
  * text: { // GuardrailConverseTextBlock
102
102
  * text: "STRING_VALUE", // required
103
+ * qualifiers: [ // GuardrailConverseContentQualifierList
104
+ * "grounding_source" || "query" || "guard_content",
105
+ * ],
103
106
  * },
104
107
  * },
105
108
  * },
@@ -112,6 +115,9 @@ declare const ConverseStreamCommand_base: {
112
115
  * guardContent: {// Union: only one key present
113
116
  * text: {
114
117
  * text: "STRING_VALUE", // required
118
+ * qualifiers: [
119
+ * "grounding_source" || "query" || "guard_content",
120
+ * ],
115
121
  * },
116
122
  * },
117
123
  * },
@@ -253,6 +259,16 @@ declare const ConverseStreamCommand_base: {
253
259
  * // },
254
260
  * // ],
255
261
  * // },
262
+ * // contextualGroundingPolicy: { // GuardrailContextualGroundingPolicyAssessment
263
+ * // filters: [ // GuardrailContextualGroundingFilters
264
+ * // { // GuardrailContextualGroundingFilter
265
+ * // type: "GROUNDING" || "RELEVANCE", // required
266
+ * // threshold: Number("double"), // required
267
+ * // score: Number("double"), // required
268
+ * // action: "BLOCKED" || "NONE", // required
269
+ * // },
270
+ * // ],
271
+ * // },
256
272
  * // },
257
273
  * // },
258
274
  * // outputAssessments: { // GuardrailAssessmentListMap
@@ -308,6 +324,16 @@ declare const ConverseStreamCommand_base: {
308
324
  * // },
309
325
  * // ],
310
326
  * // },
327
+ * // contextualGroundingPolicy: {
328
+ * // filters: [
329
+ * // {
330
+ * // type: "GROUNDING" || "RELEVANCE", // required
331
+ * // threshold: Number("double"), // required
332
+ * // score: Number("double"), // required
333
+ * // action: "BLOCKED" || "NONE", // required
334
+ * // },
335
+ * // ],
336
+ * // },
311
337
  * // },
312
338
  * // ],
313
339
  * // },
@@ -1,3 +1,4 @@
1
+ export * from "./ApplyGuardrailCommand";
1
2
  export * from "./ConverseCommand";
2
3
  export * from "./ConverseStreamCommand";
3
4
  export * from "./InvokeModelCommand";