@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.
- package/README.md +8 -0
- package/dist-cjs/index.js +358 -180
- package/dist-es/BedrockRuntime.js +2 -0
- package/dist-es/commands/ApplyGuardrailCommand.js +24 -0
- package/dist-es/commands/index.js +1 -0
- package/dist-es/models/models_0.js +160 -126
- package/dist-es/protocols/Aws_restJson1.js +128 -15
- package/dist-types/BedrockRuntime.d.ts +7 -0
- package/dist-types/BedrockRuntimeClient.d.ts +3 -2
- package/dist-types/commands/ApplyGuardrailCommand.d.ts +167 -0
- package/dist-types/commands/ConverseCommand.d.ts +29 -0
- package/dist-types/commands/ConverseStreamCommand.d.ts +26 -0
- package/dist-types/commands/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +1138 -840
- package/dist-types/protocols/Aws_restJson1.d.ts +9 -0
- package/dist-types/ts3.4/BedrockRuntime.d.ts +17 -0
- package/dist-types/ts3.4/BedrockRuntimeClient.d.ts +6 -0
- package/dist-types/ts3.4/commands/ApplyGuardrailCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/index.d.ts +1 -0
- package/dist-types/ts3.4/models/models_0.d.ts +263 -169
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +12 -0
- package/package.json +21 -21
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
|
|
2
2
|
import { EventStreamSerdeContext as __EventStreamSerdeContext, SerdeContext as __SerdeContext } from "@smithy/types";
|
|
3
|
+
import { ApplyGuardrailCommandInput, ApplyGuardrailCommandOutput } from "../commands/ApplyGuardrailCommand";
|
|
3
4
|
import { ConverseCommandInput, ConverseCommandOutput } from "../commands/ConverseCommand";
|
|
4
5
|
import { ConverseStreamCommandInput, ConverseStreamCommandOutput } from "../commands/ConverseStreamCommand";
|
|
5
6
|
import { InvokeModelCommandInput, InvokeModelCommandOutput } from "../commands/InvokeModelCommand";
|
|
6
7
|
import { InvokeModelWithResponseStreamCommandInput, InvokeModelWithResponseStreamCommandOutput } from "../commands/InvokeModelWithResponseStreamCommand";
|
|
8
|
+
/**
|
|
9
|
+
* serializeAws_restJson1ApplyGuardrailCommand
|
|
10
|
+
*/
|
|
11
|
+
export declare const se_ApplyGuardrailCommand: (input: ApplyGuardrailCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
|
|
7
12
|
/**
|
|
8
13
|
* serializeAws_restJson1ConverseCommand
|
|
9
14
|
*/
|
|
@@ -20,6 +25,10 @@ export declare const se_InvokeModelCommand: (input: InvokeModelCommandInput, con
|
|
|
20
25
|
* serializeAws_restJson1InvokeModelWithResponseStreamCommand
|
|
21
26
|
*/
|
|
22
27
|
export declare const se_InvokeModelWithResponseStreamCommand: (input: InvokeModelWithResponseStreamCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
|
|
28
|
+
/**
|
|
29
|
+
* deserializeAws_restJson1ApplyGuardrailCommand
|
|
30
|
+
*/
|
|
31
|
+
export declare const de_ApplyGuardrailCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<ApplyGuardrailCommandOutput>;
|
|
23
32
|
/**
|
|
24
33
|
* deserializeAws_restJson1ConverseCommand
|
|
25
34
|
*/
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
|
|
2
2
|
import { BedrockRuntimeClient } from "./BedrockRuntimeClient";
|
|
3
|
+
import {
|
|
4
|
+
ApplyGuardrailCommandInput,
|
|
5
|
+
ApplyGuardrailCommandOutput,
|
|
6
|
+
} from "./commands/ApplyGuardrailCommand";
|
|
3
7
|
import {
|
|
4
8
|
ConverseCommandInput,
|
|
5
9
|
ConverseCommandOutput,
|
|
@@ -17,6 +21,19 @@ import {
|
|
|
17
21
|
InvokeModelWithResponseStreamCommandOutput,
|
|
18
22
|
} from "./commands/InvokeModelWithResponseStreamCommand";
|
|
19
23
|
export interface BedrockRuntime {
|
|
24
|
+
applyGuardrail(
|
|
25
|
+
args: ApplyGuardrailCommandInput,
|
|
26
|
+
options?: __HttpHandlerOptions
|
|
27
|
+
): Promise<ApplyGuardrailCommandOutput>;
|
|
28
|
+
applyGuardrail(
|
|
29
|
+
args: ApplyGuardrailCommandInput,
|
|
30
|
+
cb: (err: any, data?: ApplyGuardrailCommandOutput) => void
|
|
31
|
+
): void;
|
|
32
|
+
applyGuardrail(
|
|
33
|
+
args: ApplyGuardrailCommandInput,
|
|
34
|
+
options: __HttpHandlerOptions,
|
|
35
|
+
cb: (err: any, data?: ApplyGuardrailCommandOutput) => void
|
|
36
|
+
): void;
|
|
20
37
|
converse(
|
|
21
38
|
args: ConverseCommandInput,
|
|
22
39
|
options?: __HttpHandlerOptions
|
|
@@ -50,6 +50,10 @@ import {
|
|
|
50
50
|
HttpAuthSchemeInputConfig,
|
|
51
51
|
HttpAuthSchemeResolvedConfig,
|
|
52
52
|
} from "./auth/httpAuthSchemeProvider";
|
|
53
|
+
import {
|
|
54
|
+
ApplyGuardrailCommandInput,
|
|
55
|
+
ApplyGuardrailCommandOutput,
|
|
56
|
+
} from "./commands/ApplyGuardrailCommand";
|
|
53
57
|
import {
|
|
54
58
|
ConverseCommandInput,
|
|
55
59
|
ConverseCommandOutput,
|
|
@@ -74,11 +78,13 @@ import {
|
|
|
74
78
|
import { RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions";
|
|
75
79
|
export { __Client };
|
|
76
80
|
export type ServiceInputTypes =
|
|
81
|
+
| ApplyGuardrailCommandInput
|
|
77
82
|
| ConverseCommandInput
|
|
78
83
|
| ConverseStreamCommandInput
|
|
79
84
|
| InvokeModelCommandInput
|
|
80
85
|
| InvokeModelWithResponseStreamCommandInput;
|
|
81
86
|
export type ServiceOutputTypes =
|
|
87
|
+
| ApplyGuardrailCommandOutput
|
|
82
88
|
| ConverseCommandOutput
|
|
83
89
|
| ConverseStreamCommandOutput
|
|
84
90
|
| InvokeModelCommandOutput
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
2
|
+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
|
|
3
|
+
import {
|
|
4
|
+
BedrockRuntimeClientResolvedConfig,
|
|
5
|
+
ServiceInputTypes,
|
|
6
|
+
ServiceOutputTypes,
|
|
7
|
+
} from "../BedrockRuntimeClient";
|
|
8
|
+
import {
|
|
9
|
+
ApplyGuardrailRequest,
|
|
10
|
+
ApplyGuardrailResponse,
|
|
11
|
+
} from "../models/models_0";
|
|
12
|
+
export { __MetadataBearer };
|
|
13
|
+
export { $Command };
|
|
14
|
+
export interface ApplyGuardrailCommandInput extends ApplyGuardrailRequest {}
|
|
15
|
+
export interface ApplyGuardrailCommandOutput
|
|
16
|
+
extends ApplyGuardrailResponse,
|
|
17
|
+
__MetadataBearer {}
|
|
18
|
+
declare const ApplyGuardrailCommand_base: {
|
|
19
|
+
new (
|
|
20
|
+
input: ApplyGuardrailCommandInput
|
|
21
|
+
): import("@smithy/smithy-client").CommandImpl<
|
|
22
|
+
ApplyGuardrailCommandInput,
|
|
23
|
+
ApplyGuardrailCommandOutput,
|
|
24
|
+
BedrockRuntimeClientResolvedConfig,
|
|
25
|
+
ServiceInputTypes,
|
|
26
|
+
ServiceOutputTypes
|
|
27
|
+
>;
|
|
28
|
+
new (
|
|
29
|
+
__0_0: ApplyGuardrailCommandInput
|
|
30
|
+
): import("@smithy/smithy-client").CommandImpl<
|
|
31
|
+
ApplyGuardrailCommandInput,
|
|
32
|
+
ApplyGuardrailCommandOutput,
|
|
33
|
+
BedrockRuntimeClientResolvedConfig,
|
|
34
|
+
ServiceInputTypes,
|
|
35
|
+
ServiceOutputTypes
|
|
36
|
+
>;
|
|
37
|
+
getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions;
|
|
38
|
+
};
|
|
39
|
+
export declare class ApplyGuardrailCommand extends ApplyGuardrailCommand_base {}
|
|
@@ -8,6 +8,261 @@ export declare class AccessDeniedException extends __BaseException {
|
|
|
8
8
|
opts: __ExceptionOptionType<AccessDeniedException, __BaseException>
|
|
9
9
|
);
|
|
10
10
|
}
|
|
11
|
+
export declare const GuardrailContentQualifier: {
|
|
12
|
+
readonly GROUNDING_SOURCE: "grounding_source";
|
|
13
|
+
readonly GUARD_CONTENT: "guard_content";
|
|
14
|
+
readonly QUERY: "query";
|
|
15
|
+
};
|
|
16
|
+
export type GuardrailContentQualifier =
|
|
17
|
+
(typeof GuardrailContentQualifier)[keyof typeof GuardrailContentQualifier];
|
|
18
|
+
export interface GuardrailTextBlock {
|
|
19
|
+
text: string | undefined;
|
|
20
|
+
qualifiers?: GuardrailContentQualifier[];
|
|
21
|
+
}
|
|
22
|
+
export type GuardrailContentBlock =
|
|
23
|
+
| GuardrailContentBlock.TextMember
|
|
24
|
+
| GuardrailContentBlock.$UnknownMember;
|
|
25
|
+
export declare namespace GuardrailContentBlock {
|
|
26
|
+
interface TextMember {
|
|
27
|
+
text: GuardrailTextBlock;
|
|
28
|
+
$unknown?: never;
|
|
29
|
+
}
|
|
30
|
+
interface $UnknownMember {
|
|
31
|
+
text?: never;
|
|
32
|
+
$unknown: [string, any];
|
|
33
|
+
}
|
|
34
|
+
interface Visitor<T> {
|
|
35
|
+
text: (value: GuardrailTextBlock) => T;
|
|
36
|
+
_: (name: string, value: any) => T;
|
|
37
|
+
}
|
|
38
|
+
const visit: <T>(value: GuardrailContentBlock, visitor: Visitor<T>) => T;
|
|
39
|
+
}
|
|
40
|
+
export declare const GuardrailContentSource: {
|
|
41
|
+
readonly INPUT: "INPUT";
|
|
42
|
+
readonly OUTPUT: "OUTPUT";
|
|
43
|
+
};
|
|
44
|
+
export type GuardrailContentSource =
|
|
45
|
+
(typeof GuardrailContentSource)[keyof typeof GuardrailContentSource];
|
|
46
|
+
export interface ApplyGuardrailRequest {
|
|
47
|
+
guardrailIdentifier: string | undefined;
|
|
48
|
+
guardrailVersion: string | undefined;
|
|
49
|
+
source: GuardrailContentSource | undefined;
|
|
50
|
+
content: GuardrailContentBlock[] | undefined;
|
|
51
|
+
}
|
|
52
|
+
export declare const GuardrailAction: {
|
|
53
|
+
readonly GUARDRAIL_INTERVENED: "GUARDRAIL_INTERVENED";
|
|
54
|
+
readonly NONE: "NONE";
|
|
55
|
+
};
|
|
56
|
+
export type GuardrailAction =
|
|
57
|
+
(typeof GuardrailAction)[keyof typeof GuardrailAction];
|
|
58
|
+
export declare const GuardrailContentPolicyAction: {
|
|
59
|
+
readonly BLOCKED: "BLOCKED";
|
|
60
|
+
};
|
|
61
|
+
export type GuardrailContentPolicyAction =
|
|
62
|
+
(typeof GuardrailContentPolicyAction)[keyof typeof GuardrailContentPolicyAction];
|
|
63
|
+
export declare const GuardrailContentFilterConfidence: {
|
|
64
|
+
readonly HIGH: "HIGH";
|
|
65
|
+
readonly LOW: "LOW";
|
|
66
|
+
readonly MEDIUM: "MEDIUM";
|
|
67
|
+
readonly NONE: "NONE";
|
|
68
|
+
};
|
|
69
|
+
export type GuardrailContentFilterConfidence =
|
|
70
|
+
(typeof GuardrailContentFilterConfidence)[keyof typeof GuardrailContentFilterConfidence];
|
|
71
|
+
export declare const GuardrailContentFilterType: {
|
|
72
|
+
readonly HATE: "HATE";
|
|
73
|
+
readonly INSULTS: "INSULTS";
|
|
74
|
+
readonly MISCONDUCT: "MISCONDUCT";
|
|
75
|
+
readonly PROMPT_ATTACK: "PROMPT_ATTACK";
|
|
76
|
+
readonly SEXUAL: "SEXUAL";
|
|
77
|
+
readonly VIOLENCE: "VIOLENCE";
|
|
78
|
+
};
|
|
79
|
+
export type GuardrailContentFilterType =
|
|
80
|
+
(typeof GuardrailContentFilterType)[keyof typeof GuardrailContentFilterType];
|
|
81
|
+
export interface GuardrailContentFilter {
|
|
82
|
+
type: GuardrailContentFilterType | undefined;
|
|
83
|
+
confidence: GuardrailContentFilterConfidence | undefined;
|
|
84
|
+
action: GuardrailContentPolicyAction | undefined;
|
|
85
|
+
}
|
|
86
|
+
export interface GuardrailContentPolicyAssessment {
|
|
87
|
+
filters: GuardrailContentFilter[] | undefined;
|
|
88
|
+
}
|
|
89
|
+
export declare const GuardrailContextualGroundingPolicyAction: {
|
|
90
|
+
readonly BLOCKED: "BLOCKED";
|
|
91
|
+
readonly NONE: "NONE";
|
|
92
|
+
};
|
|
93
|
+
export type GuardrailContextualGroundingPolicyAction =
|
|
94
|
+
(typeof GuardrailContextualGroundingPolicyAction)[keyof typeof GuardrailContextualGroundingPolicyAction];
|
|
95
|
+
export declare const GuardrailContextualGroundingFilterType: {
|
|
96
|
+
readonly GROUNDING: "GROUNDING";
|
|
97
|
+
readonly RELEVANCE: "RELEVANCE";
|
|
98
|
+
};
|
|
99
|
+
export type GuardrailContextualGroundingFilterType =
|
|
100
|
+
(typeof GuardrailContextualGroundingFilterType)[keyof typeof GuardrailContextualGroundingFilterType];
|
|
101
|
+
export interface GuardrailContextualGroundingFilter {
|
|
102
|
+
type: GuardrailContextualGroundingFilterType | undefined;
|
|
103
|
+
threshold: number | undefined;
|
|
104
|
+
score: number | undefined;
|
|
105
|
+
action: GuardrailContextualGroundingPolicyAction | undefined;
|
|
106
|
+
}
|
|
107
|
+
export interface GuardrailContextualGroundingPolicyAssessment {
|
|
108
|
+
filters?: GuardrailContextualGroundingFilter[];
|
|
109
|
+
}
|
|
110
|
+
export declare const GuardrailSensitiveInformationPolicyAction: {
|
|
111
|
+
readonly ANONYMIZED: "ANONYMIZED";
|
|
112
|
+
readonly BLOCKED: "BLOCKED";
|
|
113
|
+
};
|
|
114
|
+
export type GuardrailSensitiveInformationPolicyAction =
|
|
115
|
+
(typeof GuardrailSensitiveInformationPolicyAction)[keyof typeof GuardrailSensitiveInformationPolicyAction];
|
|
116
|
+
export declare const GuardrailPiiEntityType: {
|
|
117
|
+
readonly ADDRESS: "ADDRESS";
|
|
118
|
+
readonly AGE: "AGE";
|
|
119
|
+
readonly AWS_ACCESS_KEY: "AWS_ACCESS_KEY";
|
|
120
|
+
readonly AWS_SECRET_KEY: "AWS_SECRET_KEY";
|
|
121
|
+
readonly CA_HEALTH_NUMBER: "CA_HEALTH_NUMBER";
|
|
122
|
+
readonly CA_SOCIAL_INSURANCE_NUMBER: "CA_SOCIAL_INSURANCE_NUMBER";
|
|
123
|
+
readonly CREDIT_DEBIT_CARD_CVV: "CREDIT_DEBIT_CARD_CVV";
|
|
124
|
+
readonly CREDIT_DEBIT_CARD_EXPIRY: "CREDIT_DEBIT_CARD_EXPIRY";
|
|
125
|
+
readonly CREDIT_DEBIT_CARD_NUMBER: "CREDIT_DEBIT_CARD_NUMBER";
|
|
126
|
+
readonly DRIVER_ID: "DRIVER_ID";
|
|
127
|
+
readonly EMAIL: "EMAIL";
|
|
128
|
+
readonly INTERNATIONAL_BANK_ACCOUNT_NUMBER: "INTERNATIONAL_BANK_ACCOUNT_NUMBER";
|
|
129
|
+
readonly IP_ADDRESS: "IP_ADDRESS";
|
|
130
|
+
readonly LICENSE_PLATE: "LICENSE_PLATE";
|
|
131
|
+
readonly MAC_ADDRESS: "MAC_ADDRESS";
|
|
132
|
+
readonly NAME: "NAME";
|
|
133
|
+
readonly PASSWORD: "PASSWORD";
|
|
134
|
+
readonly PHONE: "PHONE";
|
|
135
|
+
readonly PIN: "PIN";
|
|
136
|
+
readonly SWIFT_CODE: "SWIFT_CODE";
|
|
137
|
+
readonly UK_NATIONAL_HEALTH_SERVICE_NUMBER: "UK_NATIONAL_HEALTH_SERVICE_NUMBER";
|
|
138
|
+
readonly UK_NATIONAL_INSURANCE_NUMBER: "UK_NATIONAL_INSURANCE_NUMBER";
|
|
139
|
+
readonly UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER: "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER";
|
|
140
|
+
readonly URL: "URL";
|
|
141
|
+
readonly USERNAME: "USERNAME";
|
|
142
|
+
readonly US_BANK_ACCOUNT_NUMBER: "US_BANK_ACCOUNT_NUMBER";
|
|
143
|
+
readonly US_BANK_ROUTING_NUMBER: "US_BANK_ROUTING_NUMBER";
|
|
144
|
+
readonly US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER: "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER";
|
|
145
|
+
readonly US_PASSPORT_NUMBER: "US_PASSPORT_NUMBER";
|
|
146
|
+
readonly US_SOCIAL_SECURITY_NUMBER: "US_SOCIAL_SECURITY_NUMBER";
|
|
147
|
+
readonly VEHICLE_IDENTIFICATION_NUMBER: "VEHICLE_IDENTIFICATION_NUMBER";
|
|
148
|
+
};
|
|
149
|
+
export type GuardrailPiiEntityType =
|
|
150
|
+
(typeof GuardrailPiiEntityType)[keyof typeof GuardrailPiiEntityType];
|
|
151
|
+
export interface GuardrailPiiEntityFilter {
|
|
152
|
+
match: string | undefined;
|
|
153
|
+
type: GuardrailPiiEntityType | undefined;
|
|
154
|
+
action: GuardrailSensitiveInformationPolicyAction | undefined;
|
|
155
|
+
}
|
|
156
|
+
export interface GuardrailRegexFilter {
|
|
157
|
+
name?: string;
|
|
158
|
+
match?: string;
|
|
159
|
+
regex?: string;
|
|
160
|
+
action: GuardrailSensitiveInformationPolicyAction | undefined;
|
|
161
|
+
}
|
|
162
|
+
export interface GuardrailSensitiveInformationPolicyAssessment {
|
|
163
|
+
piiEntities: GuardrailPiiEntityFilter[] | undefined;
|
|
164
|
+
regexes: GuardrailRegexFilter[] | undefined;
|
|
165
|
+
}
|
|
166
|
+
export declare const GuardrailTopicPolicyAction: {
|
|
167
|
+
readonly BLOCKED: "BLOCKED";
|
|
168
|
+
};
|
|
169
|
+
export type GuardrailTopicPolicyAction =
|
|
170
|
+
(typeof GuardrailTopicPolicyAction)[keyof typeof GuardrailTopicPolicyAction];
|
|
171
|
+
export declare const GuardrailTopicType: {
|
|
172
|
+
readonly DENY: "DENY";
|
|
173
|
+
};
|
|
174
|
+
export type GuardrailTopicType =
|
|
175
|
+
(typeof GuardrailTopicType)[keyof typeof GuardrailTopicType];
|
|
176
|
+
export interface GuardrailTopic {
|
|
177
|
+
name: string | undefined;
|
|
178
|
+
type: GuardrailTopicType | undefined;
|
|
179
|
+
action: GuardrailTopicPolicyAction | undefined;
|
|
180
|
+
}
|
|
181
|
+
export interface GuardrailTopicPolicyAssessment {
|
|
182
|
+
topics: GuardrailTopic[] | undefined;
|
|
183
|
+
}
|
|
184
|
+
export declare const GuardrailWordPolicyAction: {
|
|
185
|
+
readonly BLOCKED: "BLOCKED";
|
|
186
|
+
};
|
|
187
|
+
export type GuardrailWordPolicyAction =
|
|
188
|
+
(typeof GuardrailWordPolicyAction)[keyof typeof GuardrailWordPolicyAction];
|
|
189
|
+
export interface GuardrailCustomWord {
|
|
190
|
+
match: string | undefined;
|
|
191
|
+
action: GuardrailWordPolicyAction | undefined;
|
|
192
|
+
}
|
|
193
|
+
export declare const GuardrailManagedWordType: {
|
|
194
|
+
readonly PROFANITY: "PROFANITY";
|
|
195
|
+
};
|
|
196
|
+
export type GuardrailManagedWordType =
|
|
197
|
+
(typeof GuardrailManagedWordType)[keyof typeof GuardrailManagedWordType];
|
|
198
|
+
export interface GuardrailManagedWord {
|
|
199
|
+
match: string | undefined;
|
|
200
|
+
type: GuardrailManagedWordType | undefined;
|
|
201
|
+
action: GuardrailWordPolicyAction | undefined;
|
|
202
|
+
}
|
|
203
|
+
export interface GuardrailWordPolicyAssessment {
|
|
204
|
+
customWords: GuardrailCustomWord[] | undefined;
|
|
205
|
+
managedWordLists: GuardrailManagedWord[] | undefined;
|
|
206
|
+
}
|
|
207
|
+
export interface GuardrailAssessment {
|
|
208
|
+
topicPolicy?: GuardrailTopicPolicyAssessment;
|
|
209
|
+
contentPolicy?: GuardrailContentPolicyAssessment;
|
|
210
|
+
wordPolicy?: GuardrailWordPolicyAssessment;
|
|
211
|
+
sensitiveInformationPolicy?: GuardrailSensitiveInformationPolicyAssessment;
|
|
212
|
+
contextualGroundingPolicy?: GuardrailContextualGroundingPolicyAssessment;
|
|
213
|
+
}
|
|
214
|
+
export interface GuardrailOutputContent {
|
|
215
|
+
text?: string;
|
|
216
|
+
}
|
|
217
|
+
export interface GuardrailUsage {
|
|
218
|
+
topicPolicyUnits: number | undefined;
|
|
219
|
+
contentPolicyUnits: number | undefined;
|
|
220
|
+
wordPolicyUnits: number | undefined;
|
|
221
|
+
sensitiveInformationPolicyUnits: number | undefined;
|
|
222
|
+
sensitiveInformationPolicyFreeUnits: number | undefined;
|
|
223
|
+
contextualGroundingPolicyUnits: number | undefined;
|
|
224
|
+
}
|
|
225
|
+
export interface ApplyGuardrailResponse {
|
|
226
|
+
usage: GuardrailUsage | undefined;
|
|
227
|
+
action: GuardrailAction | undefined;
|
|
228
|
+
outputs: GuardrailOutputContent[] | undefined;
|
|
229
|
+
assessments: GuardrailAssessment[] | undefined;
|
|
230
|
+
}
|
|
231
|
+
export declare class InternalServerException extends __BaseException {
|
|
232
|
+
readonly name: "InternalServerException";
|
|
233
|
+
readonly $fault: "server";
|
|
234
|
+
constructor(
|
|
235
|
+
opts: __ExceptionOptionType<InternalServerException, __BaseException>
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
export declare class ResourceNotFoundException extends __BaseException {
|
|
239
|
+
readonly name: "ResourceNotFoundException";
|
|
240
|
+
readonly $fault: "client";
|
|
241
|
+
constructor(
|
|
242
|
+
opts: __ExceptionOptionType<ResourceNotFoundException, __BaseException>
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
export declare class ServiceQuotaExceededException extends __BaseException {
|
|
246
|
+
readonly name: "ServiceQuotaExceededException";
|
|
247
|
+
readonly $fault: "client";
|
|
248
|
+
constructor(
|
|
249
|
+
opts: __ExceptionOptionType<ServiceQuotaExceededException, __BaseException>
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
export declare class ThrottlingException extends __BaseException {
|
|
253
|
+
readonly name: "ThrottlingException";
|
|
254
|
+
readonly $fault: "client";
|
|
255
|
+
constructor(
|
|
256
|
+
opts: __ExceptionOptionType<ThrottlingException, __BaseException>
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
export declare class ValidationException extends __BaseException {
|
|
260
|
+
readonly name: "ValidationException";
|
|
261
|
+
readonly $fault: "client";
|
|
262
|
+
constructor(
|
|
263
|
+
opts: __ExceptionOptionType<ValidationException, __BaseException>
|
|
264
|
+
);
|
|
265
|
+
}
|
|
11
266
|
export declare const GuardrailTrace: {
|
|
12
267
|
readonly DISABLED: "disabled";
|
|
13
268
|
readonly ENABLED: "enabled";
|
|
@@ -61,8 +316,16 @@ export interface DocumentBlock {
|
|
|
61
316
|
name: string | undefined;
|
|
62
317
|
source: DocumentSource | undefined;
|
|
63
318
|
}
|
|
319
|
+
export declare const GuardrailConverseContentQualifier: {
|
|
320
|
+
readonly GROUNDING_SOURCE: "grounding_source";
|
|
321
|
+
readonly GUARD_CONTENT: "guard_content";
|
|
322
|
+
readonly QUERY: "query";
|
|
323
|
+
};
|
|
324
|
+
export type GuardrailConverseContentQualifier =
|
|
325
|
+
(typeof GuardrailConverseContentQualifier)[keyof typeof GuardrailConverseContentQualifier];
|
|
64
326
|
export interface GuardrailConverseTextBlock {
|
|
65
327
|
text: string | undefined;
|
|
328
|
+
qualifiers?: GuardrailConverseContentQualifier[];
|
|
66
329
|
}
|
|
67
330
|
export type GuardrailConverseContentBlock =
|
|
68
331
|
| GuardrailConverseContentBlock.TextMember
|
|
@@ -425,140 +688,6 @@ export declare const StopReason: {
|
|
|
425
688
|
readonly TOOL_USE: "tool_use";
|
|
426
689
|
};
|
|
427
690
|
export type StopReason = (typeof StopReason)[keyof typeof StopReason];
|
|
428
|
-
export declare const GuardrailContentPolicyAction: {
|
|
429
|
-
readonly BLOCKED: "BLOCKED";
|
|
430
|
-
};
|
|
431
|
-
export type GuardrailContentPolicyAction =
|
|
432
|
-
(typeof GuardrailContentPolicyAction)[keyof typeof GuardrailContentPolicyAction];
|
|
433
|
-
export declare const GuardrailContentFilterConfidence: {
|
|
434
|
-
readonly HIGH: "HIGH";
|
|
435
|
-
readonly LOW: "LOW";
|
|
436
|
-
readonly MEDIUM: "MEDIUM";
|
|
437
|
-
readonly NONE: "NONE";
|
|
438
|
-
};
|
|
439
|
-
export type GuardrailContentFilterConfidence =
|
|
440
|
-
(typeof GuardrailContentFilterConfidence)[keyof typeof GuardrailContentFilterConfidence];
|
|
441
|
-
export declare const GuardrailContentFilterType: {
|
|
442
|
-
readonly HATE: "HATE";
|
|
443
|
-
readonly INSULTS: "INSULTS";
|
|
444
|
-
readonly MISCONDUCT: "MISCONDUCT";
|
|
445
|
-
readonly PROMPT_ATTACK: "PROMPT_ATTACK";
|
|
446
|
-
readonly SEXUAL: "SEXUAL";
|
|
447
|
-
readonly VIOLENCE: "VIOLENCE";
|
|
448
|
-
};
|
|
449
|
-
export type GuardrailContentFilterType =
|
|
450
|
-
(typeof GuardrailContentFilterType)[keyof typeof GuardrailContentFilterType];
|
|
451
|
-
export interface GuardrailContentFilter {
|
|
452
|
-
type: GuardrailContentFilterType | undefined;
|
|
453
|
-
confidence: GuardrailContentFilterConfidence | undefined;
|
|
454
|
-
action: GuardrailContentPolicyAction | undefined;
|
|
455
|
-
}
|
|
456
|
-
export interface GuardrailContentPolicyAssessment {
|
|
457
|
-
filters: GuardrailContentFilter[] | undefined;
|
|
458
|
-
}
|
|
459
|
-
export declare const GuardrailSensitiveInformationPolicyAction: {
|
|
460
|
-
readonly ANONYMIZED: "ANONYMIZED";
|
|
461
|
-
readonly BLOCKED: "BLOCKED";
|
|
462
|
-
};
|
|
463
|
-
export type GuardrailSensitiveInformationPolicyAction =
|
|
464
|
-
(typeof GuardrailSensitiveInformationPolicyAction)[keyof typeof GuardrailSensitiveInformationPolicyAction];
|
|
465
|
-
export declare const GuardrailPiiEntityType: {
|
|
466
|
-
readonly ADDRESS: "ADDRESS";
|
|
467
|
-
readonly AGE: "AGE";
|
|
468
|
-
readonly AWS_ACCESS_KEY: "AWS_ACCESS_KEY";
|
|
469
|
-
readonly AWS_SECRET_KEY: "AWS_SECRET_KEY";
|
|
470
|
-
readonly CA_HEALTH_NUMBER: "CA_HEALTH_NUMBER";
|
|
471
|
-
readonly CA_SOCIAL_INSURANCE_NUMBER: "CA_SOCIAL_INSURANCE_NUMBER";
|
|
472
|
-
readonly CREDIT_DEBIT_CARD_CVV: "CREDIT_DEBIT_CARD_CVV";
|
|
473
|
-
readonly CREDIT_DEBIT_CARD_EXPIRY: "CREDIT_DEBIT_CARD_EXPIRY";
|
|
474
|
-
readonly CREDIT_DEBIT_CARD_NUMBER: "CREDIT_DEBIT_CARD_NUMBER";
|
|
475
|
-
readonly DRIVER_ID: "DRIVER_ID";
|
|
476
|
-
readonly EMAIL: "EMAIL";
|
|
477
|
-
readonly INTERNATIONAL_BANK_ACCOUNT_NUMBER: "INTERNATIONAL_BANK_ACCOUNT_NUMBER";
|
|
478
|
-
readonly IP_ADDRESS: "IP_ADDRESS";
|
|
479
|
-
readonly LICENSE_PLATE: "LICENSE_PLATE";
|
|
480
|
-
readonly MAC_ADDRESS: "MAC_ADDRESS";
|
|
481
|
-
readonly NAME: "NAME";
|
|
482
|
-
readonly PASSWORD: "PASSWORD";
|
|
483
|
-
readonly PHONE: "PHONE";
|
|
484
|
-
readonly PIN: "PIN";
|
|
485
|
-
readonly SWIFT_CODE: "SWIFT_CODE";
|
|
486
|
-
readonly UK_NATIONAL_HEALTH_SERVICE_NUMBER: "UK_NATIONAL_HEALTH_SERVICE_NUMBER";
|
|
487
|
-
readonly UK_NATIONAL_INSURANCE_NUMBER: "UK_NATIONAL_INSURANCE_NUMBER";
|
|
488
|
-
readonly UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER: "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER";
|
|
489
|
-
readonly URL: "URL";
|
|
490
|
-
readonly USERNAME: "USERNAME";
|
|
491
|
-
readonly US_BANK_ACCOUNT_NUMBER: "US_BANK_ACCOUNT_NUMBER";
|
|
492
|
-
readonly US_BANK_ROUTING_NUMBER: "US_BANK_ROUTING_NUMBER";
|
|
493
|
-
readonly US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER: "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER";
|
|
494
|
-
readonly US_PASSPORT_NUMBER: "US_PASSPORT_NUMBER";
|
|
495
|
-
readonly US_SOCIAL_SECURITY_NUMBER: "US_SOCIAL_SECURITY_NUMBER";
|
|
496
|
-
readonly VEHICLE_IDENTIFICATION_NUMBER: "VEHICLE_IDENTIFICATION_NUMBER";
|
|
497
|
-
};
|
|
498
|
-
export type GuardrailPiiEntityType =
|
|
499
|
-
(typeof GuardrailPiiEntityType)[keyof typeof GuardrailPiiEntityType];
|
|
500
|
-
export interface GuardrailPiiEntityFilter {
|
|
501
|
-
match: string | undefined;
|
|
502
|
-
type: GuardrailPiiEntityType | undefined;
|
|
503
|
-
action: GuardrailSensitiveInformationPolicyAction | undefined;
|
|
504
|
-
}
|
|
505
|
-
export interface GuardrailRegexFilter {
|
|
506
|
-
name?: string;
|
|
507
|
-
match?: string;
|
|
508
|
-
regex?: string;
|
|
509
|
-
action: GuardrailSensitiveInformationPolicyAction | undefined;
|
|
510
|
-
}
|
|
511
|
-
export interface GuardrailSensitiveInformationPolicyAssessment {
|
|
512
|
-
piiEntities: GuardrailPiiEntityFilter[] | undefined;
|
|
513
|
-
regexes: GuardrailRegexFilter[] | undefined;
|
|
514
|
-
}
|
|
515
|
-
export declare const GuardrailTopicPolicyAction: {
|
|
516
|
-
readonly BLOCKED: "BLOCKED";
|
|
517
|
-
};
|
|
518
|
-
export type GuardrailTopicPolicyAction =
|
|
519
|
-
(typeof GuardrailTopicPolicyAction)[keyof typeof GuardrailTopicPolicyAction];
|
|
520
|
-
export declare const GuardrailTopicType: {
|
|
521
|
-
readonly DENY: "DENY";
|
|
522
|
-
};
|
|
523
|
-
export type GuardrailTopicType =
|
|
524
|
-
(typeof GuardrailTopicType)[keyof typeof GuardrailTopicType];
|
|
525
|
-
export interface GuardrailTopic {
|
|
526
|
-
name: string | undefined;
|
|
527
|
-
type: GuardrailTopicType | undefined;
|
|
528
|
-
action: GuardrailTopicPolicyAction | undefined;
|
|
529
|
-
}
|
|
530
|
-
export interface GuardrailTopicPolicyAssessment {
|
|
531
|
-
topics: GuardrailTopic[] | undefined;
|
|
532
|
-
}
|
|
533
|
-
export declare const GuardrailWordPolicyAction: {
|
|
534
|
-
readonly BLOCKED: "BLOCKED";
|
|
535
|
-
};
|
|
536
|
-
export type GuardrailWordPolicyAction =
|
|
537
|
-
(typeof GuardrailWordPolicyAction)[keyof typeof GuardrailWordPolicyAction];
|
|
538
|
-
export interface GuardrailCustomWord {
|
|
539
|
-
match: string | undefined;
|
|
540
|
-
action: GuardrailWordPolicyAction | undefined;
|
|
541
|
-
}
|
|
542
|
-
export declare const GuardrailManagedWordType: {
|
|
543
|
-
readonly PROFANITY: "PROFANITY";
|
|
544
|
-
};
|
|
545
|
-
export type GuardrailManagedWordType =
|
|
546
|
-
(typeof GuardrailManagedWordType)[keyof typeof GuardrailManagedWordType];
|
|
547
|
-
export interface GuardrailManagedWord {
|
|
548
|
-
match: string | undefined;
|
|
549
|
-
type: GuardrailManagedWordType | undefined;
|
|
550
|
-
action: GuardrailWordPolicyAction | undefined;
|
|
551
|
-
}
|
|
552
|
-
export interface GuardrailWordPolicyAssessment {
|
|
553
|
-
customWords: GuardrailCustomWord[] | undefined;
|
|
554
|
-
managedWordLists: GuardrailManagedWord[] | undefined;
|
|
555
|
-
}
|
|
556
|
-
export interface GuardrailAssessment {
|
|
557
|
-
topicPolicy?: GuardrailTopicPolicyAssessment;
|
|
558
|
-
contentPolicy?: GuardrailContentPolicyAssessment;
|
|
559
|
-
wordPolicy?: GuardrailWordPolicyAssessment;
|
|
560
|
-
sensitiveInformationPolicy?: GuardrailSensitiveInformationPolicyAssessment;
|
|
561
|
-
}
|
|
562
691
|
export interface GuardrailTraceAssessment {
|
|
563
692
|
modelOutput?: string[];
|
|
564
693
|
inputAssessment?: Record<string, GuardrailAssessment>;
|
|
@@ -580,13 +709,6 @@ export interface ConverseResponse {
|
|
|
580
709
|
additionalModelResponseFields?: __DocumentType;
|
|
581
710
|
trace?: ConverseTrace;
|
|
582
711
|
}
|
|
583
|
-
export declare class InternalServerException extends __BaseException {
|
|
584
|
-
readonly name: "InternalServerException";
|
|
585
|
-
readonly $fault: "server";
|
|
586
|
-
constructor(
|
|
587
|
-
opts: __ExceptionOptionType<InternalServerException, __BaseException>
|
|
588
|
-
);
|
|
589
|
-
}
|
|
590
712
|
export declare class ModelErrorException extends __BaseException {
|
|
591
713
|
readonly name: "ModelErrorException";
|
|
592
714
|
readonly $fault: "client";
|
|
@@ -610,27 +732,6 @@ export declare class ModelTimeoutException extends __BaseException {
|
|
|
610
732
|
opts: __ExceptionOptionType<ModelTimeoutException, __BaseException>
|
|
611
733
|
);
|
|
612
734
|
}
|
|
613
|
-
export declare class ResourceNotFoundException extends __BaseException {
|
|
614
|
-
readonly name: "ResourceNotFoundException";
|
|
615
|
-
readonly $fault: "client";
|
|
616
|
-
constructor(
|
|
617
|
-
opts: __ExceptionOptionType<ResourceNotFoundException, __BaseException>
|
|
618
|
-
);
|
|
619
|
-
}
|
|
620
|
-
export declare class ThrottlingException extends __BaseException {
|
|
621
|
-
readonly name: "ThrottlingException";
|
|
622
|
-
readonly $fault: "client";
|
|
623
|
-
constructor(
|
|
624
|
-
opts: __ExceptionOptionType<ThrottlingException, __BaseException>
|
|
625
|
-
);
|
|
626
|
-
}
|
|
627
|
-
export declare class ValidationException extends __BaseException {
|
|
628
|
-
readonly name: "ValidationException";
|
|
629
|
-
readonly $fault: "client";
|
|
630
|
-
constructor(
|
|
631
|
-
opts: __ExceptionOptionType<ValidationException, __BaseException>
|
|
632
|
-
);
|
|
633
|
-
}
|
|
634
735
|
export declare const GuardrailStreamProcessingMode: {
|
|
635
736
|
readonly ASYNC: "async";
|
|
636
737
|
readonly SYNC: "sync";
|
|
@@ -935,13 +1036,6 @@ export interface InvokeModelResponse {
|
|
|
935
1036
|
body: Uint8Array | undefined;
|
|
936
1037
|
contentType: string | undefined;
|
|
937
1038
|
}
|
|
938
|
-
export declare class ServiceQuotaExceededException extends __BaseException {
|
|
939
|
-
readonly name: "ServiceQuotaExceededException";
|
|
940
|
-
readonly $fault: "client";
|
|
941
|
-
constructor(
|
|
942
|
-
opts: __ExceptionOptionType<ServiceQuotaExceededException, __BaseException>
|
|
943
|
-
);
|
|
944
|
-
}
|
|
945
1039
|
export interface InvokeModelWithResponseStreamRequest {
|
|
946
1040
|
body: Uint8Array | undefined;
|
|
947
1041
|
contentType?: string;
|
|
@@ -6,6 +6,10 @@ import {
|
|
|
6
6
|
EventStreamSerdeContext as __EventStreamSerdeContext,
|
|
7
7
|
SerdeContext as __SerdeContext,
|
|
8
8
|
} from "@smithy/types";
|
|
9
|
+
import {
|
|
10
|
+
ApplyGuardrailCommandInput,
|
|
11
|
+
ApplyGuardrailCommandOutput,
|
|
12
|
+
} from "../commands/ApplyGuardrailCommand";
|
|
9
13
|
import {
|
|
10
14
|
ConverseCommandInput,
|
|
11
15
|
ConverseCommandOutput,
|
|
@@ -22,6 +26,10 @@ import {
|
|
|
22
26
|
InvokeModelWithResponseStreamCommandInput,
|
|
23
27
|
InvokeModelWithResponseStreamCommandOutput,
|
|
24
28
|
} from "../commands/InvokeModelWithResponseStreamCommand";
|
|
29
|
+
export declare const se_ApplyGuardrailCommand: (
|
|
30
|
+
input: ApplyGuardrailCommandInput,
|
|
31
|
+
context: __SerdeContext
|
|
32
|
+
) => Promise<__HttpRequest>;
|
|
25
33
|
export declare const se_ConverseCommand: (
|
|
26
34
|
input: ConverseCommandInput,
|
|
27
35
|
context: __SerdeContext
|
|
@@ -38,6 +46,10 @@ export declare const se_InvokeModelWithResponseStreamCommand: (
|
|
|
38
46
|
input: InvokeModelWithResponseStreamCommandInput,
|
|
39
47
|
context: __SerdeContext
|
|
40
48
|
) => Promise<__HttpRequest>;
|
|
49
|
+
export declare const de_ApplyGuardrailCommand: (
|
|
50
|
+
output: __HttpResponse,
|
|
51
|
+
context: __SerdeContext
|
|
52
|
+
) => Promise<ApplyGuardrailCommandOutput>;
|
|
41
53
|
export declare const de_ConverseCommand: (
|
|
42
54
|
output: __HttpResponse,
|
|
43
55
|
context: __SerdeContext
|