@aws-sdk/client-bedrock-runtime 3.613.0 → 3.616.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 +363 -185
- package/dist-es/BedrockRuntime.js +2 -0
- package/dist-es/BedrockRuntimeClient.js +5 -5
- 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 +5 -4
- 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/runtimeConfig.browser.d.ts +1 -1
- package/dist-types/runtimeConfig.d.ts +1 -1
- package/dist-types/runtimeConfig.native.d.ts +1 -1
- package/dist-types/ts3.4/BedrockRuntime.d.ts +17 -0
- package/dist-types/ts3.4/BedrockRuntimeClient.d.ts +8 -2
- 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/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -1
- package/dist-types/ts3.4/runtimeConfig.d.ts +1 -1
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -1
- package/package.json +25 -25
|
@@ -17,1240 +17,1598 @@ export declare class AccessDeniedException extends __BaseException {
|
|
|
17
17
|
* @public
|
|
18
18
|
* @enum
|
|
19
19
|
*/
|
|
20
|
-
export declare const
|
|
21
|
-
readonly
|
|
22
|
-
readonly
|
|
20
|
+
export declare const GuardrailContentQualifier: {
|
|
21
|
+
readonly GROUNDING_SOURCE: "grounding_source";
|
|
22
|
+
readonly GUARD_CONTENT: "guard_content";
|
|
23
|
+
readonly QUERY: "query";
|
|
23
24
|
};
|
|
24
25
|
/**
|
|
25
26
|
* @public
|
|
26
27
|
*/
|
|
27
|
-
export type
|
|
28
|
+
export type GuardrailContentQualifier = (typeof GuardrailContentQualifier)[keyof typeof GuardrailContentQualifier];
|
|
28
29
|
/**
|
|
29
|
-
* <p>
|
|
30
|
+
* <p>The text block to be evaluated by the guardrail.</p>
|
|
30
31
|
* @public
|
|
31
32
|
*/
|
|
32
|
-
export interface
|
|
33
|
+
export interface GuardrailTextBlock {
|
|
33
34
|
/**
|
|
34
|
-
* <p>The
|
|
35
|
+
* <p>The input text details to be evaluated by the guardrail.</p>
|
|
35
36
|
* @public
|
|
36
37
|
*/
|
|
37
|
-
|
|
38
|
+
text: string | undefined;
|
|
38
39
|
/**
|
|
39
|
-
* <p>The
|
|
40
|
+
* <p>The qualifiers describing the text block.</p>
|
|
40
41
|
* @public
|
|
41
42
|
*/
|
|
42
|
-
|
|
43
|
+
qualifiers?: GuardrailContentQualifier[];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* <p>The content block to be evaluated by the guardrail.</p>
|
|
47
|
+
* @public
|
|
48
|
+
*/
|
|
49
|
+
export type GuardrailContentBlock = GuardrailContentBlock.TextMember | GuardrailContentBlock.$UnknownMember;
|
|
50
|
+
/**
|
|
51
|
+
* @public
|
|
52
|
+
*/
|
|
53
|
+
export declare namespace GuardrailContentBlock {
|
|
43
54
|
/**
|
|
44
|
-
* <p>
|
|
55
|
+
* <p>Text within content block to be evaluated by the guardrail.</p>
|
|
45
56
|
* @public
|
|
46
57
|
*/
|
|
47
|
-
|
|
58
|
+
interface TextMember {
|
|
59
|
+
text: GuardrailTextBlock;
|
|
60
|
+
$unknown?: never;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* @public
|
|
64
|
+
*/
|
|
65
|
+
interface $UnknownMember {
|
|
66
|
+
text?: never;
|
|
67
|
+
$unknown: [string, any];
|
|
68
|
+
}
|
|
69
|
+
interface Visitor<T> {
|
|
70
|
+
text: (value: GuardrailTextBlock) => T;
|
|
71
|
+
_: (name: string, value: any) => T;
|
|
72
|
+
}
|
|
73
|
+
const visit: <T>(value: GuardrailContentBlock, visitor: Visitor<T>) => T;
|
|
48
74
|
}
|
|
49
75
|
/**
|
|
50
|
-
* <p>Base inference parameters to pass to a model in a call to <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html">Converse</a> or <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html">ConverseStream</a>. For more information,
|
|
51
|
-
* see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundation models</a>.</p>
|
|
52
|
-
* <p>If you need to pass additional parameters that the model
|
|
53
|
-
* supports, use the <code>additionalModelRequestFields</code> request field in the call to <code>Converse</code>
|
|
54
|
-
* or <code>ConverseStream</code>.
|
|
55
|
-
* For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
|
|
56
76
|
* @public
|
|
77
|
+
* @enum
|
|
57
78
|
*/
|
|
58
|
-
export
|
|
79
|
+
export declare const GuardrailContentSource: {
|
|
80
|
+
readonly INPUT: "INPUT";
|
|
81
|
+
readonly OUTPUT: "OUTPUT";
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* @public
|
|
85
|
+
*/
|
|
86
|
+
export type GuardrailContentSource = (typeof GuardrailContentSource)[keyof typeof GuardrailContentSource];
|
|
87
|
+
/**
|
|
88
|
+
* @public
|
|
89
|
+
*/
|
|
90
|
+
export interface ApplyGuardrailRequest {
|
|
59
91
|
/**
|
|
60
|
-
* <p>The
|
|
61
|
-
* the maximum allowed value for the model that you are using. For more information, see
|
|
62
|
-
* <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundation models</a>. </p>
|
|
92
|
+
* <p>The guardrail identifier used in the request to apply the guardrail.</p>
|
|
63
93
|
* @public
|
|
64
94
|
*/
|
|
65
|
-
|
|
95
|
+
guardrailIdentifier: string | undefined;
|
|
66
96
|
/**
|
|
67
|
-
* <p>The
|
|
68
|
-
* response. A lower value makes the model more likely to choose higher-probability options,
|
|
69
|
-
* while a higher value makes the model more likely to choose lower-probability
|
|
70
|
-
* options.</p>
|
|
71
|
-
* <p>The default value is the default value for the model that
|
|
72
|
-
* you are using. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundation
|
|
73
|
-
* models</a>. </p>
|
|
97
|
+
* <p>The guardrail version used in the request to apply the guardrail.</p>
|
|
74
98
|
* @public
|
|
75
99
|
*/
|
|
76
|
-
|
|
100
|
+
guardrailVersion: string | undefined;
|
|
77
101
|
/**
|
|
78
|
-
* <p>The
|
|
79
|
-
* example, if you choose a value of 0.8 for <code>topP</code>, the model selects from the top 80% of the
|
|
80
|
-
* probability distribution of tokens that could be next in the sequence.</p>
|
|
81
|
-
* <p>The default value is the default value for the model that you are using. For more information, see
|
|
82
|
-
* <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundation models</a>. </p>
|
|
102
|
+
* <p>The source of data used in the request to apply the guardrail.</p>
|
|
83
103
|
* @public
|
|
84
104
|
*/
|
|
85
|
-
|
|
105
|
+
source: GuardrailContentSource | undefined;
|
|
86
106
|
/**
|
|
87
|
-
* <p>
|
|
88
|
-
* model to stop generating the response. </p>
|
|
107
|
+
* <p>The content details used in the request to apply the guardrail.</p>
|
|
89
108
|
* @public
|
|
90
109
|
*/
|
|
91
|
-
|
|
110
|
+
content: GuardrailContentBlock[] | undefined;
|
|
92
111
|
}
|
|
93
112
|
/**
|
|
94
113
|
* @public
|
|
95
114
|
* @enum
|
|
96
115
|
*/
|
|
97
|
-
export declare const
|
|
98
|
-
readonly
|
|
99
|
-
readonly
|
|
100
|
-
readonly DOCX: "docx";
|
|
101
|
-
readonly HTML: "html";
|
|
102
|
-
readonly MD: "md";
|
|
103
|
-
readonly PDF: "pdf";
|
|
104
|
-
readonly TXT: "txt";
|
|
105
|
-
readonly XLS: "xls";
|
|
106
|
-
readonly XLSX: "xlsx";
|
|
116
|
+
export declare const GuardrailAction: {
|
|
117
|
+
readonly GUARDRAIL_INTERVENED: "GUARDRAIL_INTERVENED";
|
|
118
|
+
readonly NONE: "NONE";
|
|
107
119
|
};
|
|
108
120
|
/**
|
|
109
121
|
* @public
|
|
110
122
|
*/
|
|
111
|
-
export type
|
|
123
|
+
export type GuardrailAction = (typeof GuardrailAction)[keyof typeof GuardrailAction];
|
|
112
124
|
/**
|
|
113
|
-
* <p>Contains the content of the document included in a message when sending a <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html">Converse</a> or <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html">ConverseStream</a> request or in the response.</p>
|
|
114
125
|
* @public
|
|
126
|
+
* @enum
|
|
115
127
|
*/
|
|
116
|
-
export
|
|
128
|
+
export declare const GuardrailContentPolicyAction: {
|
|
129
|
+
readonly BLOCKED: "BLOCKED";
|
|
130
|
+
};
|
|
117
131
|
/**
|
|
118
132
|
* @public
|
|
119
133
|
*/
|
|
120
|
-
export
|
|
121
|
-
/**
|
|
122
|
-
* <p>A base64-encoded string of a UTF-8 encoded file, that is the document to include in the message.</p>
|
|
123
|
-
* @public
|
|
124
|
-
*/
|
|
125
|
-
interface BytesMember {
|
|
126
|
-
bytes: Uint8Array;
|
|
127
|
-
$unknown?: never;
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* @public
|
|
131
|
-
*/
|
|
132
|
-
interface $UnknownMember {
|
|
133
|
-
bytes?: never;
|
|
134
|
-
$unknown: [string, any];
|
|
135
|
-
}
|
|
136
|
-
interface Visitor<T> {
|
|
137
|
-
bytes: (value: Uint8Array) => T;
|
|
138
|
-
_: (name: string, value: any) => T;
|
|
139
|
-
}
|
|
140
|
-
const visit: <T>(value: DocumentSource, visitor: Visitor<T>) => T;
|
|
141
|
-
}
|
|
134
|
+
export type GuardrailContentPolicyAction = (typeof GuardrailContentPolicyAction)[keyof typeof GuardrailContentPolicyAction];
|
|
142
135
|
/**
|
|
143
|
-
* <p>A document to include in a message when sending a <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html">Converse</a> or <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html">ConverseStream</a> request. You can include up to 5 documents in a request. The maximum document size is 50 MB.</p>
|
|
144
136
|
* @public
|
|
137
|
+
* @enum
|
|
145
138
|
*/
|
|
146
|
-
export
|
|
139
|
+
export declare const GuardrailContentFilterConfidence: {
|
|
140
|
+
readonly HIGH: "HIGH";
|
|
141
|
+
readonly LOW: "LOW";
|
|
142
|
+
readonly MEDIUM: "MEDIUM";
|
|
143
|
+
readonly NONE: "NONE";
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* @public
|
|
147
|
+
*/
|
|
148
|
+
export type GuardrailContentFilterConfidence = (typeof GuardrailContentFilterConfidence)[keyof typeof GuardrailContentFilterConfidence];
|
|
149
|
+
/**
|
|
150
|
+
* @public
|
|
151
|
+
* @enum
|
|
152
|
+
*/
|
|
153
|
+
export declare const GuardrailContentFilterType: {
|
|
154
|
+
readonly HATE: "HATE";
|
|
155
|
+
readonly INSULTS: "INSULTS";
|
|
156
|
+
readonly MISCONDUCT: "MISCONDUCT";
|
|
157
|
+
readonly PROMPT_ATTACK: "PROMPT_ATTACK";
|
|
158
|
+
readonly SEXUAL: "SEXUAL";
|
|
159
|
+
readonly VIOLENCE: "VIOLENCE";
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* @public
|
|
163
|
+
*/
|
|
164
|
+
export type GuardrailContentFilterType = (typeof GuardrailContentFilterType)[keyof typeof GuardrailContentFilterType];
|
|
165
|
+
/**
|
|
166
|
+
* <p>The content filter for a guardrail.</p>
|
|
167
|
+
* @public
|
|
168
|
+
*/
|
|
169
|
+
export interface GuardrailContentFilter {
|
|
147
170
|
/**
|
|
148
|
-
* <p>The
|
|
171
|
+
* <p>The guardrail type.</p>
|
|
149
172
|
* @public
|
|
150
173
|
*/
|
|
151
|
-
|
|
174
|
+
type: GuardrailContentFilterType | undefined;
|
|
152
175
|
/**
|
|
153
|
-
* <p>
|
|
176
|
+
* <p>The guardrail confidence.</p>
|
|
154
177
|
* @public
|
|
155
178
|
*/
|
|
156
|
-
|
|
179
|
+
confidence: GuardrailContentFilterConfidence | undefined;
|
|
157
180
|
/**
|
|
158
|
-
* <p>
|
|
181
|
+
* <p>The guardrail action.</p>
|
|
159
182
|
* @public
|
|
160
183
|
*/
|
|
161
|
-
|
|
184
|
+
action: GuardrailContentPolicyAction | undefined;
|
|
162
185
|
}
|
|
163
186
|
/**
|
|
164
|
-
* <p>
|
|
187
|
+
* <p>An assessment of a content policy for a guardrail.</p>
|
|
165
188
|
* @public
|
|
166
189
|
*/
|
|
167
|
-
export interface
|
|
190
|
+
export interface GuardrailContentPolicyAssessment {
|
|
168
191
|
/**
|
|
169
|
-
* <p>The
|
|
192
|
+
* <p>The content policy filters.</p>
|
|
170
193
|
* @public
|
|
171
194
|
*/
|
|
172
|
-
|
|
195
|
+
filters: GuardrailContentFilter[] | undefined;
|
|
173
196
|
}
|
|
174
197
|
/**
|
|
175
|
-
* <p/>
|
|
176
|
-
* <p>A content block for selective guarding with the Converse API (<a>Converse</a> and <a>ConverseStream</a>).
|
|
177
|
-
* </p>
|
|
178
198
|
* @public
|
|
199
|
+
* @enum
|
|
179
200
|
*/
|
|
180
|
-
export
|
|
201
|
+
export declare const GuardrailContextualGroundingPolicyAction: {
|
|
202
|
+
readonly BLOCKED: "BLOCKED";
|
|
203
|
+
readonly NONE: "NONE";
|
|
204
|
+
};
|
|
181
205
|
/**
|
|
182
206
|
* @public
|
|
183
207
|
*/
|
|
184
|
-
export
|
|
185
|
-
/**
|
|
186
|
-
* <p>The text to guard.</p>
|
|
187
|
-
* @public
|
|
188
|
-
*/
|
|
189
|
-
interface TextMember {
|
|
190
|
-
text: GuardrailConverseTextBlock;
|
|
191
|
-
$unknown?: never;
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* @public
|
|
195
|
-
*/
|
|
196
|
-
interface $UnknownMember {
|
|
197
|
-
text?: never;
|
|
198
|
-
$unknown: [string, any];
|
|
199
|
-
}
|
|
200
|
-
interface Visitor<T> {
|
|
201
|
-
text: (value: GuardrailConverseTextBlock) => T;
|
|
202
|
-
_: (name: string, value: any) => T;
|
|
203
|
-
}
|
|
204
|
-
const visit: <T>(value: GuardrailConverseContentBlock, visitor: Visitor<T>) => T;
|
|
205
|
-
}
|
|
208
|
+
export type GuardrailContextualGroundingPolicyAction = (typeof GuardrailContextualGroundingPolicyAction)[keyof typeof GuardrailContextualGroundingPolicyAction];
|
|
206
209
|
/**
|
|
207
210
|
* @public
|
|
208
211
|
* @enum
|
|
209
212
|
*/
|
|
210
|
-
export declare const
|
|
211
|
-
readonly
|
|
212
|
-
readonly
|
|
213
|
-
readonly PNG: "png";
|
|
214
|
-
readonly WEBP: "webp";
|
|
213
|
+
export declare const GuardrailContextualGroundingFilterType: {
|
|
214
|
+
readonly GROUNDING: "GROUNDING";
|
|
215
|
+
readonly RELEVANCE: "RELEVANCE";
|
|
215
216
|
};
|
|
216
217
|
/**
|
|
217
218
|
* @public
|
|
218
219
|
*/
|
|
219
|
-
export type
|
|
220
|
-
/**
|
|
221
|
-
* <p>The source for an image.</p>
|
|
222
|
-
* @public
|
|
223
|
-
*/
|
|
224
|
-
export type ImageSource = ImageSource.BytesMember | ImageSource.$UnknownMember;
|
|
220
|
+
export type GuardrailContextualGroundingFilterType = (typeof GuardrailContextualGroundingFilterType)[keyof typeof GuardrailContextualGroundingFilterType];
|
|
225
221
|
/**
|
|
222
|
+
* <p>The details for the guardrails contextual grounding filter.</p>
|
|
226
223
|
* @public
|
|
227
224
|
*/
|
|
228
|
-
export
|
|
225
|
+
export interface GuardrailContextualGroundingFilter {
|
|
229
226
|
/**
|
|
230
|
-
* <p>The
|
|
227
|
+
* <p>The contextual grounding filter type.</p>
|
|
231
228
|
* @public
|
|
232
229
|
*/
|
|
233
|
-
|
|
234
|
-
bytes: Uint8Array;
|
|
235
|
-
$unknown?: never;
|
|
236
|
-
}
|
|
230
|
+
type: GuardrailContextualGroundingFilterType | undefined;
|
|
237
231
|
/**
|
|
232
|
+
* <p>The threshold used by contextual grounding filter to determine whether the content is grounded or not.</p>
|
|
238
233
|
* @public
|
|
239
234
|
*/
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
235
|
+
threshold: number | undefined;
|
|
236
|
+
/**
|
|
237
|
+
* <p>The score generated by contextual grounding filter.</p>
|
|
238
|
+
* @public
|
|
239
|
+
*/
|
|
240
|
+
score: number | undefined;
|
|
241
|
+
/**
|
|
242
|
+
* <p>The action performed by the guardrails contextual grounding filter.</p>
|
|
243
|
+
* @public
|
|
244
|
+
*/
|
|
245
|
+
action: GuardrailContextualGroundingPolicyAction | undefined;
|
|
249
246
|
}
|
|
250
247
|
/**
|
|
251
|
-
* <p>
|
|
248
|
+
* <p>The policy assessment details for the guardrails contextual grounding filter.</p>
|
|
252
249
|
* @public
|
|
253
250
|
*/
|
|
254
|
-
export interface
|
|
255
|
-
/**
|
|
256
|
-
* <p>The format of the image.</p>
|
|
257
|
-
* @public
|
|
258
|
-
*/
|
|
259
|
-
format: ImageFormat | undefined;
|
|
251
|
+
export interface GuardrailContextualGroundingPolicyAssessment {
|
|
260
252
|
/**
|
|
261
|
-
* <p>The
|
|
253
|
+
* <p>The filter details for the guardrails contextual grounding filter.</p>
|
|
262
254
|
* @public
|
|
263
255
|
*/
|
|
264
|
-
|
|
256
|
+
filters?: GuardrailContextualGroundingFilter[];
|
|
265
257
|
}
|
|
266
258
|
/**
|
|
267
|
-
* <p>The tool result content block.</p>
|
|
268
259
|
* @public
|
|
260
|
+
* @enum
|
|
269
261
|
*/
|
|
270
|
-
export
|
|
262
|
+
export declare const GuardrailSensitiveInformationPolicyAction: {
|
|
263
|
+
readonly ANONYMIZED: "ANONYMIZED";
|
|
264
|
+
readonly BLOCKED: "BLOCKED";
|
|
265
|
+
};
|
|
271
266
|
/**
|
|
272
267
|
* @public
|
|
273
268
|
*/
|
|
274
|
-
export
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
269
|
+
export type GuardrailSensitiveInformationPolicyAction = (typeof GuardrailSensitiveInformationPolicyAction)[keyof typeof GuardrailSensitiveInformationPolicyAction];
|
|
270
|
+
/**
|
|
271
|
+
* @public
|
|
272
|
+
* @enum
|
|
273
|
+
*/
|
|
274
|
+
export declare const GuardrailPiiEntityType: {
|
|
275
|
+
readonly ADDRESS: "ADDRESS";
|
|
276
|
+
readonly AGE: "AGE";
|
|
277
|
+
readonly AWS_ACCESS_KEY: "AWS_ACCESS_KEY";
|
|
278
|
+
readonly AWS_SECRET_KEY: "AWS_SECRET_KEY";
|
|
279
|
+
readonly CA_HEALTH_NUMBER: "CA_HEALTH_NUMBER";
|
|
280
|
+
readonly CA_SOCIAL_INSURANCE_NUMBER: "CA_SOCIAL_INSURANCE_NUMBER";
|
|
281
|
+
readonly CREDIT_DEBIT_CARD_CVV: "CREDIT_DEBIT_CARD_CVV";
|
|
282
|
+
readonly CREDIT_DEBIT_CARD_EXPIRY: "CREDIT_DEBIT_CARD_EXPIRY";
|
|
283
|
+
readonly CREDIT_DEBIT_CARD_NUMBER: "CREDIT_DEBIT_CARD_NUMBER";
|
|
284
|
+
readonly DRIVER_ID: "DRIVER_ID";
|
|
285
|
+
readonly EMAIL: "EMAIL";
|
|
286
|
+
readonly INTERNATIONAL_BANK_ACCOUNT_NUMBER: "INTERNATIONAL_BANK_ACCOUNT_NUMBER";
|
|
287
|
+
readonly IP_ADDRESS: "IP_ADDRESS";
|
|
288
|
+
readonly LICENSE_PLATE: "LICENSE_PLATE";
|
|
289
|
+
readonly MAC_ADDRESS: "MAC_ADDRESS";
|
|
290
|
+
readonly NAME: "NAME";
|
|
291
|
+
readonly PASSWORD: "PASSWORD";
|
|
292
|
+
readonly PHONE: "PHONE";
|
|
293
|
+
readonly PIN: "PIN";
|
|
294
|
+
readonly SWIFT_CODE: "SWIFT_CODE";
|
|
295
|
+
readonly UK_NATIONAL_HEALTH_SERVICE_NUMBER: "UK_NATIONAL_HEALTH_SERVICE_NUMBER";
|
|
296
|
+
readonly UK_NATIONAL_INSURANCE_NUMBER: "UK_NATIONAL_INSURANCE_NUMBER";
|
|
297
|
+
readonly UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER: "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER";
|
|
298
|
+
readonly URL: "URL";
|
|
299
|
+
readonly USERNAME: "USERNAME";
|
|
300
|
+
readonly US_BANK_ACCOUNT_NUMBER: "US_BANK_ACCOUNT_NUMBER";
|
|
301
|
+
readonly US_BANK_ROUTING_NUMBER: "US_BANK_ROUTING_NUMBER";
|
|
302
|
+
readonly US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER: "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER";
|
|
303
|
+
readonly US_PASSPORT_NUMBER: "US_PASSPORT_NUMBER";
|
|
304
|
+
readonly US_SOCIAL_SECURITY_NUMBER: "US_SOCIAL_SECURITY_NUMBER";
|
|
305
|
+
readonly VEHICLE_IDENTIFICATION_NUMBER: "VEHICLE_IDENTIFICATION_NUMBER";
|
|
306
|
+
};
|
|
307
|
+
/**
|
|
308
|
+
* @public
|
|
309
|
+
*/
|
|
310
|
+
export type GuardrailPiiEntityType = (typeof GuardrailPiiEntityType)[keyof typeof GuardrailPiiEntityType];
|
|
311
|
+
/**
|
|
312
|
+
* <p>A Personally Identifiable Information (PII) entity configured in a guardrail.</p>
|
|
313
|
+
* @public
|
|
314
|
+
*/
|
|
315
|
+
export interface GuardrailPiiEntityFilter {
|
|
297
316
|
/**
|
|
298
|
-
* <p>
|
|
299
|
-
* <note>
|
|
300
|
-
* <p>This field is only supported by Anthropic Claude 3 models.</p>
|
|
301
|
-
* </note>
|
|
317
|
+
* <p>The PII entity filter match.</p>
|
|
302
318
|
* @public
|
|
303
319
|
*/
|
|
304
|
-
|
|
305
|
-
json?: never;
|
|
306
|
-
text?: never;
|
|
307
|
-
image: ImageBlock;
|
|
308
|
-
document?: never;
|
|
309
|
-
$unknown?: never;
|
|
310
|
-
}
|
|
320
|
+
match: string | undefined;
|
|
311
321
|
/**
|
|
312
|
-
* <p>
|
|
322
|
+
* <p>The PII entity filter type.</p>
|
|
313
323
|
* @public
|
|
314
324
|
*/
|
|
315
|
-
|
|
316
|
-
json?: never;
|
|
317
|
-
text?: never;
|
|
318
|
-
image?: never;
|
|
319
|
-
document: DocumentBlock;
|
|
320
|
-
$unknown?: never;
|
|
321
|
-
}
|
|
325
|
+
type: GuardrailPiiEntityType | undefined;
|
|
322
326
|
/**
|
|
327
|
+
* <p>The PII entity filter action.</p>
|
|
323
328
|
* @public
|
|
324
329
|
*/
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
330
|
+
action: GuardrailSensitiveInformationPolicyAction | undefined;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* <p>A Regex filter configured in a guardrail.</p>
|
|
334
|
+
* @public
|
|
335
|
+
*/
|
|
336
|
+
export interface GuardrailRegexFilter {
|
|
337
|
+
/**
|
|
338
|
+
* <p>The regex filter name.</p>
|
|
339
|
+
* @public
|
|
340
|
+
*/
|
|
341
|
+
name?: string;
|
|
342
|
+
/**
|
|
343
|
+
* <p>The regesx filter match.</p>
|
|
344
|
+
* @public
|
|
345
|
+
*/
|
|
346
|
+
match?: string;
|
|
347
|
+
/**
|
|
348
|
+
* <p>The regex query.</p>
|
|
349
|
+
* @public
|
|
350
|
+
*/
|
|
351
|
+
regex?: string;
|
|
352
|
+
/**
|
|
353
|
+
* <p>The region filter action.</p>
|
|
354
|
+
* @public
|
|
355
|
+
*/
|
|
356
|
+
action: GuardrailSensitiveInformationPolicyAction | undefined;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* <p>The assessment for aPersonally Identifiable Information (PII) policy. </p>
|
|
360
|
+
* @public
|
|
361
|
+
*/
|
|
362
|
+
export interface GuardrailSensitiveInformationPolicyAssessment {
|
|
363
|
+
/**
|
|
364
|
+
* <p>The PII entities in the assessment.</p>
|
|
365
|
+
* @public
|
|
366
|
+
*/
|
|
367
|
+
piiEntities: GuardrailPiiEntityFilter[] | undefined;
|
|
368
|
+
/**
|
|
369
|
+
* <p>The regex queries in the assessment.</p>
|
|
370
|
+
* @public
|
|
371
|
+
*/
|
|
372
|
+
regexes: GuardrailRegexFilter[] | undefined;
|
|
340
373
|
}
|
|
341
374
|
/**
|
|
342
375
|
* @public
|
|
343
376
|
* @enum
|
|
344
377
|
*/
|
|
345
|
-
export declare const
|
|
346
|
-
readonly
|
|
347
|
-
readonly SUCCESS: "success";
|
|
378
|
+
export declare const GuardrailTopicPolicyAction: {
|
|
379
|
+
readonly BLOCKED: "BLOCKED";
|
|
348
380
|
};
|
|
349
381
|
/**
|
|
350
382
|
* @public
|
|
351
383
|
*/
|
|
352
|
-
export type
|
|
384
|
+
export type GuardrailTopicPolicyAction = (typeof GuardrailTopicPolicyAction)[keyof typeof GuardrailTopicPolicyAction];
|
|
353
385
|
/**
|
|
354
|
-
* <p>A tool result block that contains the results for a tool request that
|
|
355
|
-
* the model previously made.</p>
|
|
356
386
|
* @public
|
|
387
|
+
* @enum
|
|
357
388
|
*/
|
|
358
|
-
export
|
|
389
|
+
export declare const GuardrailTopicType: {
|
|
390
|
+
readonly DENY: "DENY";
|
|
391
|
+
};
|
|
392
|
+
/**
|
|
393
|
+
* @public
|
|
394
|
+
*/
|
|
395
|
+
export type GuardrailTopicType = (typeof GuardrailTopicType)[keyof typeof GuardrailTopicType];
|
|
396
|
+
/**
|
|
397
|
+
* <p>Information about a topic guardrail.</p>
|
|
398
|
+
* @public
|
|
399
|
+
*/
|
|
400
|
+
export interface GuardrailTopic {
|
|
359
401
|
/**
|
|
360
|
-
* <p>The
|
|
402
|
+
* <p>The name for the guardrail.</p>
|
|
361
403
|
* @public
|
|
362
404
|
*/
|
|
363
|
-
|
|
405
|
+
name: string | undefined;
|
|
364
406
|
/**
|
|
365
|
-
* <p>The
|
|
407
|
+
* <p>The type behavior that the guardrail should perform when the model detects the topic.</p>
|
|
366
408
|
* @public
|
|
367
409
|
*/
|
|
368
|
-
|
|
410
|
+
type: GuardrailTopicType | undefined;
|
|
369
411
|
/**
|
|
370
|
-
* <p>The
|
|
371
|
-
* <note>
|
|
372
|
-
* <p>This field is only supported Anthropic Claude 3 models.</p>
|
|
373
|
-
* </note>
|
|
412
|
+
* <p>The action the guardrail should take when it intervenes on a topic.</p>
|
|
374
413
|
* @public
|
|
375
414
|
*/
|
|
376
|
-
|
|
415
|
+
action: GuardrailTopicPolicyAction | undefined;
|
|
377
416
|
}
|
|
378
417
|
/**
|
|
379
|
-
* <p>A
|
|
380
|
-
* is requesting be run., The model uses the result from the tool to generate a response. </p>
|
|
418
|
+
* <p>A behavior assessment of a topic policy.</p>
|
|
381
419
|
* @public
|
|
382
420
|
*/
|
|
383
|
-
export interface
|
|
421
|
+
export interface GuardrailTopicPolicyAssessment {
|
|
384
422
|
/**
|
|
385
|
-
* <p>The
|
|
423
|
+
* <p>The topics in the assessment.</p>
|
|
386
424
|
* @public
|
|
387
425
|
*/
|
|
388
|
-
|
|
426
|
+
topics: GuardrailTopic[] | undefined;
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* @public
|
|
430
|
+
* @enum
|
|
431
|
+
*/
|
|
432
|
+
export declare const GuardrailWordPolicyAction: {
|
|
433
|
+
readonly BLOCKED: "BLOCKED";
|
|
434
|
+
};
|
|
435
|
+
/**
|
|
436
|
+
* @public
|
|
437
|
+
*/
|
|
438
|
+
export type GuardrailWordPolicyAction = (typeof GuardrailWordPolicyAction)[keyof typeof GuardrailWordPolicyAction];
|
|
439
|
+
/**
|
|
440
|
+
* <p>A custom word configured in a guardrail.</p>
|
|
441
|
+
* @public
|
|
442
|
+
*/
|
|
443
|
+
export interface GuardrailCustomWord {
|
|
389
444
|
/**
|
|
390
|
-
* <p>The
|
|
445
|
+
* <p>The match for the custom word.</p>
|
|
391
446
|
* @public
|
|
392
447
|
*/
|
|
393
|
-
|
|
448
|
+
match: string | undefined;
|
|
394
449
|
/**
|
|
395
|
-
* <p>The
|
|
450
|
+
* <p>The action for the custom word.</p>
|
|
396
451
|
* @public
|
|
397
452
|
*/
|
|
398
|
-
|
|
453
|
+
action: GuardrailWordPolicyAction | undefined;
|
|
399
454
|
}
|
|
400
455
|
/**
|
|
401
|
-
* <p>A block of content for a message that you pass to, or receive from, a model with the Converse API (<a>Converse</a> and <a>ConverseStream</a>).</p>
|
|
402
456
|
* @public
|
|
457
|
+
* @enum
|
|
403
458
|
*/
|
|
404
|
-
export
|
|
459
|
+
export declare const GuardrailManagedWordType: {
|
|
460
|
+
readonly PROFANITY: "PROFANITY";
|
|
461
|
+
};
|
|
405
462
|
/**
|
|
406
463
|
* @public
|
|
407
464
|
*/
|
|
408
|
-
export
|
|
465
|
+
export type GuardrailManagedWordType = (typeof GuardrailManagedWordType)[keyof typeof GuardrailManagedWordType];
|
|
466
|
+
/**
|
|
467
|
+
* <p>A managed word configured in a guardrail.</p>
|
|
468
|
+
* @public
|
|
469
|
+
*/
|
|
470
|
+
export interface GuardrailManagedWord {
|
|
409
471
|
/**
|
|
410
|
-
* <p>
|
|
472
|
+
* <p>The match for the managed word.</p>
|
|
411
473
|
* @public
|
|
412
474
|
*/
|
|
413
|
-
|
|
414
|
-
text: string;
|
|
415
|
-
image?: never;
|
|
416
|
-
document?: never;
|
|
417
|
-
toolUse?: never;
|
|
418
|
-
toolResult?: never;
|
|
419
|
-
guardContent?: never;
|
|
420
|
-
$unknown?: never;
|
|
421
|
-
}
|
|
475
|
+
match: string | undefined;
|
|
422
476
|
/**
|
|
423
|
-
* <p>
|
|
424
|
-
* <note>
|
|
425
|
-
* <p>This field is only supported by Anthropic Claude 3 models.</p>
|
|
426
|
-
* </note>
|
|
477
|
+
* <p>The type for the managed word.</p>
|
|
427
478
|
* @public
|
|
428
479
|
*/
|
|
429
|
-
|
|
430
|
-
text?: never;
|
|
431
|
-
image: ImageBlock;
|
|
432
|
-
document?: never;
|
|
433
|
-
toolUse?: never;
|
|
434
|
-
toolResult?: never;
|
|
435
|
-
guardContent?: never;
|
|
436
|
-
$unknown?: never;
|
|
437
|
-
}
|
|
480
|
+
type: GuardrailManagedWordType | undefined;
|
|
438
481
|
/**
|
|
439
|
-
* <p>
|
|
482
|
+
* <p>The action for the managed word.</p>
|
|
440
483
|
* @public
|
|
441
484
|
*/
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
$unknown?: never;
|
|
450
|
-
}
|
|
451
|
-
/**
|
|
452
|
-
* <p>Information about a tool use request from a model. </p>
|
|
453
|
-
* @public
|
|
454
|
-
*/
|
|
455
|
-
interface ToolUseMember {
|
|
456
|
-
text?: never;
|
|
457
|
-
image?: never;
|
|
458
|
-
document?: never;
|
|
459
|
-
toolUse: ToolUseBlock;
|
|
460
|
-
toolResult?: never;
|
|
461
|
-
guardContent?: never;
|
|
462
|
-
$unknown?: never;
|
|
463
|
-
}
|
|
464
|
-
/**
|
|
465
|
-
* <p>The result for a tool request that a model makes.</p>
|
|
466
|
-
* @public
|
|
467
|
-
*/
|
|
468
|
-
interface ToolResultMember {
|
|
469
|
-
text?: never;
|
|
470
|
-
image?: never;
|
|
471
|
-
document?: never;
|
|
472
|
-
toolUse?: never;
|
|
473
|
-
toolResult: ToolResultBlock;
|
|
474
|
-
guardContent?: never;
|
|
475
|
-
$unknown?: never;
|
|
476
|
-
}
|
|
485
|
+
action: GuardrailWordPolicyAction | undefined;
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* <p>The word policy assessment.</p>
|
|
489
|
+
* @public
|
|
490
|
+
*/
|
|
491
|
+
export interface GuardrailWordPolicyAssessment {
|
|
477
492
|
/**
|
|
478
|
-
* <p>
|
|
479
|
-
* <code>guardContent</code> in a call to the Converse API, the guardrail (if passed in the
|
|
480
|
-
* Converse API) assesses the entire message.</p>
|
|
481
|
-
* <p>For more information, see <i>Use a guardrail with the Converse API</i> in the <i>Amazon Bedrock User Guide</i>.
|
|
482
|
-
*
|
|
483
|
-
* </p>
|
|
493
|
+
* <p>Custom words in the assessment.</p>
|
|
484
494
|
* @public
|
|
485
495
|
*/
|
|
486
|
-
|
|
487
|
-
text?: never;
|
|
488
|
-
image?: never;
|
|
489
|
-
document?: never;
|
|
490
|
-
toolUse?: never;
|
|
491
|
-
toolResult?: never;
|
|
492
|
-
guardContent: GuardrailConverseContentBlock;
|
|
493
|
-
$unknown?: never;
|
|
494
|
-
}
|
|
496
|
+
customWords: GuardrailCustomWord[] | undefined;
|
|
495
497
|
/**
|
|
498
|
+
* <p>Managed word lists in the assessment.</p>
|
|
496
499
|
* @public
|
|
497
500
|
*/
|
|
498
|
-
|
|
499
|
-
text?: never;
|
|
500
|
-
image?: never;
|
|
501
|
-
document?: never;
|
|
502
|
-
toolUse?: never;
|
|
503
|
-
toolResult?: never;
|
|
504
|
-
guardContent?: never;
|
|
505
|
-
$unknown: [string, any];
|
|
506
|
-
}
|
|
507
|
-
interface Visitor<T> {
|
|
508
|
-
text: (value: string) => T;
|
|
509
|
-
image: (value: ImageBlock) => T;
|
|
510
|
-
document: (value: DocumentBlock) => T;
|
|
511
|
-
toolUse: (value: ToolUseBlock) => T;
|
|
512
|
-
toolResult: (value: ToolResultBlock) => T;
|
|
513
|
-
guardContent: (value: GuardrailConverseContentBlock) => T;
|
|
514
|
-
_: (name: string, value: any) => T;
|
|
515
|
-
}
|
|
516
|
-
const visit: <T>(value: ContentBlock, visitor: Visitor<T>) => T;
|
|
501
|
+
managedWordLists: GuardrailManagedWord[] | undefined;
|
|
517
502
|
}
|
|
518
503
|
/**
|
|
519
|
-
*
|
|
520
|
-
* @enum
|
|
521
|
-
*/
|
|
522
|
-
export declare const ConversationRole: {
|
|
523
|
-
readonly ASSISTANT: "assistant";
|
|
524
|
-
readonly USER: "user";
|
|
525
|
-
};
|
|
526
|
-
/**
|
|
527
|
-
* @public
|
|
528
|
-
*/
|
|
529
|
-
export type ConversationRole = (typeof ConversationRole)[keyof typeof ConversationRole];
|
|
530
|
-
/**
|
|
531
|
-
* <p>A message input, or returned from, a call to <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html">Converse</a> or <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html">ConverseStream</a>.</p>
|
|
504
|
+
* <p>A behavior assessment of the guardrail policies used in a call to the Converse API. </p>
|
|
532
505
|
* @public
|
|
533
506
|
*/
|
|
534
|
-
export interface
|
|
507
|
+
export interface GuardrailAssessment {
|
|
535
508
|
/**
|
|
536
|
-
* <p>The
|
|
509
|
+
* <p>The topic policy.</p>
|
|
537
510
|
* @public
|
|
538
511
|
*/
|
|
539
|
-
|
|
512
|
+
topicPolicy?: GuardrailTopicPolicyAssessment;
|
|
540
513
|
/**
|
|
541
|
-
* <p>The
|
|
514
|
+
* <p>The content policy.</p>
|
|
542
515
|
* @public
|
|
543
516
|
*/
|
|
544
|
-
|
|
545
|
-
}
|
|
546
|
-
/**
|
|
547
|
-
* <p>A system content block.</p>
|
|
548
|
-
* @public
|
|
549
|
-
*/
|
|
550
|
-
export type SystemContentBlock = SystemContentBlock.GuardContentMember | SystemContentBlock.TextMember | SystemContentBlock.$UnknownMember;
|
|
551
|
-
/**
|
|
552
|
-
* @public
|
|
553
|
-
*/
|
|
554
|
-
export declare namespace SystemContentBlock {
|
|
517
|
+
contentPolicy?: GuardrailContentPolicyAssessment;
|
|
555
518
|
/**
|
|
556
|
-
* <p>
|
|
519
|
+
* <p>The word policy.</p>
|
|
557
520
|
* @public
|
|
558
521
|
*/
|
|
559
|
-
|
|
560
|
-
text: string;
|
|
561
|
-
guardContent?: never;
|
|
562
|
-
$unknown?: never;
|
|
563
|
-
}
|
|
522
|
+
wordPolicy?: GuardrailWordPolicyAssessment;
|
|
564
523
|
/**
|
|
565
|
-
* <p>
|
|
566
|
-
* <p>For more information, see <i>Use a guardrail with the Converse
|
|
567
|
-
* API</i> in the <i>Amazon Bedrock User Guide</i>.</p>
|
|
524
|
+
* <p>The sensitive information policy.</p>
|
|
568
525
|
* @public
|
|
569
526
|
*/
|
|
570
|
-
|
|
571
|
-
text?: never;
|
|
572
|
-
guardContent: GuardrailConverseContentBlock;
|
|
573
|
-
$unknown?: never;
|
|
574
|
-
}
|
|
527
|
+
sensitiveInformationPolicy?: GuardrailSensitiveInformationPolicyAssessment;
|
|
575
528
|
/**
|
|
529
|
+
* <p>The contextual grounding policy used for the guardrail assessment.</p>
|
|
576
530
|
* @public
|
|
577
531
|
*/
|
|
578
|
-
|
|
579
|
-
text?: never;
|
|
580
|
-
guardContent?: never;
|
|
581
|
-
$unknown: [string, any];
|
|
582
|
-
}
|
|
583
|
-
interface Visitor<T> {
|
|
584
|
-
text: (value: string) => T;
|
|
585
|
-
guardContent: (value: GuardrailConverseContentBlock) => T;
|
|
586
|
-
_: (name: string, value: any) => T;
|
|
587
|
-
}
|
|
588
|
-
const visit: <T>(value: SystemContentBlock, visitor: Visitor<T>) => T;
|
|
589
|
-
}
|
|
590
|
-
/**
|
|
591
|
-
* <p>The model must request at least one tool (no text is generated). For example, <code>\{"any" : \{\}\}</code>.</p>
|
|
592
|
-
* @public
|
|
593
|
-
*/
|
|
594
|
-
export interface AnyToolChoice {
|
|
532
|
+
contextualGroundingPolicy?: GuardrailContextualGroundingPolicyAssessment;
|
|
595
533
|
}
|
|
596
534
|
/**
|
|
597
|
-
* <p>The
|
|
598
|
-
* For example, <code>\{"auto" : \{\}\}</code>.</p>
|
|
599
|
-
* @public
|
|
600
|
-
*/
|
|
601
|
-
export interface AutoToolChoice {
|
|
602
|
-
}
|
|
603
|
-
/**
|
|
604
|
-
* <p>The model must request a specific tool. For example, <code>\{"tool" : \{"name" : "Your tool name"\}\}</code>.</p>
|
|
605
|
-
* <note>
|
|
606
|
-
* <p>This field is only supported by Anthropic Claude 3 models.</p>
|
|
607
|
-
* </note>
|
|
535
|
+
* <p>The output content produced by the guardrail.</p>
|
|
608
536
|
* @public
|
|
609
537
|
*/
|
|
610
|
-
export interface
|
|
538
|
+
export interface GuardrailOutputContent {
|
|
611
539
|
/**
|
|
612
|
-
* <p>The
|
|
540
|
+
* <p>The specific text for the output content produced by the guardrail.</p>
|
|
613
541
|
* @public
|
|
614
542
|
*/
|
|
615
|
-
|
|
543
|
+
text?: string;
|
|
616
544
|
}
|
|
617
545
|
/**
|
|
618
|
-
* <p>
|
|
619
|
-
* <code>ToolChoice</code> is only supported by
|
|
620
|
-
* Anthropic Claude 3 models and by Mistral AI Mistral Large.</p>
|
|
621
|
-
* @public
|
|
622
|
-
*/
|
|
623
|
-
export type ToolChoice = ToolChoice.AnyMember | ToolChoice.AutoMember | ToolChoice.ToolMember | ToolChoice.$UnknownMember;
|
|
624
|
-
/**
|
|
546
|
+
* <p>The details on the use of the guardrail.</p>
|
|
625
547
|
* @public
|
|
626
548
|
*/
|
|
627
|
-
export
|
|
549
|
+
export interface GuardrailUsage {
|
|
628
550
|
/**
|
|
629
|
-
* <p>
|
|
551
|
+
* <p>The topic policy units processed by the guardrail.</p>
|
|
630
552
|
* @public
|
|
631
553
|
*/
|
|
632
|
-
|
|
633
|
-
auto: AutoToolChoice;
|
|
634
|
-
any?: never;
|
|
635
|
-
tool?: never;
|
|
636
|
-
$unknown?: never;
|
|
637
|
-
}
|
|
554
|
+
topicPolicyUnits: number | undefined;
|
|
638
555
|
/**
|
|
639
|
-
* <p>The
|
|
556
|
+
* <p>The content policy units processed by the guardrail.</p>
|
|
640
557
|
* @public
|
|
641
558
|
*/
|
|
642
|
-
|
|
643
|
-
auto?: never;
|
|
644
|
-
any: AnyToolChoice;
|
|
645
|
-
tool?: never;
|
|
646
|
-
$unknown?: never;
|
|
647
|
-
}
|
|
559
|
+
contentPolicyUnits: number | undefined;
|
|
648
560
|
/**
|
|
649
|
-
* <p>The
|
|
561
|
+
* <p>The word policy units processed by the guardrail.</p>
|
|
650
562
|
* @public
|
|
651
563
|
*/
|
|
652
|
-
|
|
653
|
-
auto?: never;
|
|
654
|
-
any?: never;
|
|
655
|
-
tool: SpecificToolChoice;
|
|
656
|
-
$unknown?: never;
|
|
657
|
-
}
|
|
564
|
+
wordPolicyUnits: number | undefined;
|
|
658
565
|
/**
|
|
566
|
+
* <p>The sensitive information policy units processed by the guardrail.</p>
|
|
659
567
|
* @public
|
|
660
568
|
*/
|
|
661
|
-
|
|
662
|
-
auto?: never;
|
|
663
|
-
any?: never;
|
|
664
|
-
tool?: never;
|
|
665
|
-
$unknown: [string, any];
|
|
666
|
-
}
|
|
667
|
-
interface Visitor<T> {
|
|
668
|
-
auto: (value: AutoToolChoice) => T;
|
|
669
|
-
any: (value: AnyToolChoice) => T;
|
|
670
|
-
tool: (value: SpecificToolChoice) => T;
|
|
671
|
-
_: (name: string, value: any) => T;
|
|
672
|
-
}
|
|
673
|
-
const visit: <T>(value: ToolChoice, visitor: Visitor<T>) => T;
|
|
674
|
-
}
|
|
675
|
-
/**
|
|
676
|
-
* <p>The schema for the tool. The top level schema type must be <code>object</code>. </p>
|
|
677
|
-
* @public
|
|
678
|
-
*/
|
|
679
|
-
export type ToolInputSchema = ToolInputSchema.JsonMember | ToolInputSchema.$UnknownMember;
|
|
680
|
-
/**
|
|
681
|
-
* @public
|
|
682
|
-
*/
|
|
683
|
-
export declare namespace ToolInputSchema {
|
|
569
|
+
sensitiveInformationPolicyUnits: number | undefined;
|
|
684
570
|
/**
|
|
685
|
-
* <p>The
|
|
571
|
+
* <p>The sensitive information policy free units processed by the guardrail.</p>
|
|
686
572
|
* @public
|
|
687
573
|
*/
|
|
688
|
-
|
|
689
|
-
json: __DocumentType;
|
|
690
|
-
$unknown?: never;
|
|
691
|
-
}
|
|
574
|
+
sensitiveInformationPolicyFreeUnits: number | undefined;
|
|
692
575
|
/**
|
|
576
|
+
* <p>The contextual grounding policy units processed by the guardrail.</p>
|
|
693
577
|
* @public
|
|
694
578
|
*/
|
|
695
|
-
|
|
696
|
-
json?: never;
|
|
697
|
-
$unknown: [string, any];
|
|
698
|
-
}
|
|
699
|
-
interface Visitor<T> {
|
|
700
|
-
json: (value: __DocumentType) => T;
|
|
701
|
-
_: (name: string, value: any) => T;
|
|
702
|
-
}
|
|
703
|
-
const visit: <T>(value: ToolInputSchema, visitor: Visitor<T>) => T;
|
|
579
|
+
contextualGroundingPolicyUnits: number | undefined;
|
|
704
580
|
}
|
|
705
581
|
/**
|
|
706
|
-
* <p>The specification for the tool.</p>
|
|
707
582
|
* @public
|
|
708
583
|
*/
|
|
709
|
-
export interface
|
|
584
|
+
export interface ApplyGuardrailResponse {
|
|
710
585
|
/**
|
|
711
|
-
* <p>The
|
|
586
|
+
* <p>The usage details in the response from the guardrail.</p>
|
|
712
587
|
* @public
|
|
713
588
|
*/
|
|
714
|
-
|
|
589
|
+
usage: GuardrailUsage | undefined;
|
|
715
590
|
/**
|
|
716
|
-
* <p>The
|
|
591
|
+
* <p>The action taken in the response from the guardrail.</p>
|
|
717
592
|
* @public
|
|
718
593
|
*/
|
|
719
|
-
|
|
594
|
+
action: GuardrailAction | undefined;
|
|
720
595
|
/**
|
|
721
|
-
* <p>The
|
|
596
|
+
* <p>The output details in the response from the guardrail.</p>
|
|
722
597
|
* @public
|
|
723
598
|
*/
|
|
724
|
-
|
|
599
|
+
outputs: GuardrailOutputContent[] | undefined;
|
|
600
|
+
/**
|
|
601
|
+
* <p>The assessment details in the response from the guardrail.</p>
|
|
602
|
+
* @public
|
|
603
|
+
*/
|
|
604
|
+
assessments: GuardrailAssessment[] | undefined;
|
|
725
605
|
}
|
|
726
606
|
/**
|
|
727
|
-
* <p>
|
|
607
|
+
* <p>An internal server error occurred. Retry your request.</p>
|
|
728
608
|
* @public
|
|
729
609
|
*/
|
|
730
|
-
export
|
|
610
|
+
export declare class InternalServerException extends __BaseException {
|
|
611
|
+
readonly name: "InternalServerException";
|
|
612
|
+
readonly $fault: "server";
|
|
613
|
+
/**
|
|
614
|
+
* @internal
|
|
615
|
+
*/
|
|
616
|
+
constructor(opts: __ExceptionOptionType<InternalServerException, __BaseException>);
|
|
617
|
+
}
|
|
731
618
|
/**
|
|
619
|
+
* <p>The specified resource ARN was not found. Check the ARN and try your request again.</p>
|
|
732
620
|
* @public
|
|
733
621
|
*/
|
|
734
|
-
export declare
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
* @public
|
|
738
|
-
*/
|
|
739
|
-
interface ToolSpecMember {
|
|
740
|
-
toolSpec: ToolSpecification;
|
|
741
|
-
$unknown?: never;
|
|
742
|
-
}
|
|
622
|
+
export declare class ResourceNotFoundException extends __BaseException {
|
|
623
|
+
readonly name: "ResourceNotFoundException";
|
|
624
|
+
readonly $fault: "client";
|
|
743
625
|
/**
|
|
744
|
-
* @
|
|
626
|
+
* @internal
|
|
745
627
|
*/
|
|
746
|
-
|
|
747
|
-
toolSpec?: never;
|
|
748
|
-
$unknown: [string, any];
|
|
749
|
-
}
|
|
750
|
-
interface Visitor<T> {
|
|
751
|
-
toolSpec: (value: ToolSpecification) => T;
|
|
752
|
-
_: (name: string, value: any) => T;
|
|
753
|
-
}
|
|
754
|
-
const visit: <T>(value: Tool, visitor: Visitor<T>) => T;
|
|
628
|
+
constructor(opts: __ExceptionOptionType<ResourceNotFoundException, __BaseException>);
|
|
755
629
|
}
|
|
756
630
|
/**
|
|
757
|
-
* <p>
|
|
758
|
-
* <note>
|
|
759
|
-
* <p>This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere Command R+, and Mistral Large models.</p>
|
|
760
|
-
* </note>
|
|
631
|
+
* <p>The number of requests exceeds the service quota. Resubmit your request later.</p>
|
|
761
632
|
* @public
|
|
762
633
|
*/
|
|
763
|
-
export
|
|
634
|
+
export declare class ServiceQuotaExceededException extends __BaseException {
|
|
635
|
+
readonly name: "ServiceQuotaExceededException";
|
|
636
|
+
readonly $fault: "client";
|
|
764
637
|
/**
|
|
765
|
-
*
|
|
766
|
-
* @public
|
|
638
|
+
* @internal
|
|
767
639
|
*/
|
|
768
|
-
|
|
640
|
+
constructor(opts: __ExceptionOptionType<ServiceQuotaExceededException, __BaseException>);
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* <p>The number of requests exceeds the limit. Resubmit your request later.</p>
|
|
644
|
+
* @public
|
|
645
|
+
*/
|
|
646
|
+
export declare class ThrottlingException extends __BaseException {
|
|
647
|
+
readonly name: "ThrottlingException";
|
|
648
|
+
readonly $fault: "client";
|
|
769
649
|
/**
|
|
770
|
-
*
|
|
771
|
-
* @public
|
|
650
|
+
* @internal
|
|
772
651
|
*/
|
|
773
|
-
|
|
652
|
+
constructor(opts: __ExceptionOptionType<ThrottlingException, __BaseException>);
|
|
774
653
|
}
|
|
775
654
|
/**
|
|
655
|
+
* <p>Input validation failed. Check your request parameters and retry the request.</p>
|
|
776
656
|
* @public
|
|
777
657
|
*/
|
|
778
|
-
export
|
|
658
|
+
export declare class ValidationException extends __BaseException {
|
|
659
|
+
readonly name: "ValidationException";
|
|
660
|
+
readonly $fault: "client";
|
|
779
661
|
/**
|
|
780
|
-
*
|
|
781
|
-
* <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
|
|
782
|
-
* <ul>
|
|
783
|
-
* <li>
|
|
784
|
-
* <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p>
|
|
785
|
-
* </li>
|
|
786
|
-
* <li>
|
|
787
|
-
* <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p>
|
|
788
|
-
* </li>
|
|
789
|
-
* <li>
|
|
790
|
-
* <p>If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p>
|
|
791
|
-
* </li>
|
|
792
|
-
* </ul>
|
|
793
|
-
* @public
|
|
662
|
+
* @internal
|
|
794
663
|
*/
|
|
795
|
-
|
|
664
|
+
constructor(opts: __ExceptionOptionType<ValidationException, __BaseException>);
|
|
665
|
+
}
|
|
666
|
+
/**
|
|
667
|
+
* @public
|
|
668
|
+
* @enum
|
|
669
|
+
*/
|
|
670
|
+
export declare const GuardrailTrace: {
|
|
671
|
+
readonly DISABLED: "disabled";
|
|
672
|
+
readonly ENABLED: "enabled";
|
|
673
|
+
};
|
|
674
|
+
/**
|
|
675
|
+
* @public
|
|
676
|
+
*/
|
|
677
|
+
export type GuardrailTrace = (typeof GuardrailTrace)[keyof typeof GuardrailTrace];
|
|
678
|
+
/**
|
|
679
|
+
* <p>Configuration information for a guardrail that you use with the <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html">Converse</a> operation.</p>
|
|
680
|
+
* @public
|
|
681
|
+
*/
|
|
682
|
+
export interface GuardrailConfiguration {
|
|
796
683
|
/**
|
|
797
|
-
* <p>The
|
|
684
|
+
* <p>The identifier for the guardrail.</p>
|
|
798
685
|
* @public
|
|
799
686
|
*/
|
|
800
|
-
|
|
687
|
+
guardrailIdentifier: string | undefined;
|
|
801
688
|
/**
|
|
802
|
-
* <p>
|
|
689
|
+
* <p>The version of the guardrail.</p>
|
|
803
690
|
* @public
|
|
804
691
|
*/
|
|
805
|
-
|
|
692
|
+
guardrailVersion: string | undefined;
|
|
806
693
|
/**
|
|
807
|
-
* <p>
|
|
808
|
-
* set of inference parameters. If you need to pass additional parameters that the model
|
|
809
|
-
* supports, use the <code>additionalModelRequestFields</code> request field.</p>
|
|
694
|
+
* <p>The trace behavior for the guardrail.</p>
|
|
810
695
|
* @public
|
|
811
696
|
*/
|
|
812
|
-
|
|
697
|
+
trace?: GuardrailTrace;
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* <p>Base inference parameters to pass to a model in a call to <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html">Converse</a> or <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html">ConverseStream</a>. For more information,
|
|
701
|
+
* see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundation models</a>.</p>
|
|
702
|
+
* <p>If you need to pass additional parameters that the model
|
|
703
|
+
* supports, use the <code>additionalModelRequestFields</code> request field in the call to <code>Converse</code>
|
|
704
|
+
* or <code>ConverseStream</code>.
|
|
705
|
+
* For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
|
|
706
|
+
* @public
|
|
707
|
+
*/
|
|
708
|
+
export interface InferenceConfiguration {
|
|
813
709
|
/**
|
|
814
|
-
* <p>
|
|
815
|
-
*
|
|
816
|
-
* <
|
|
817
|
-
* </note>
|
|
710
|
+
* <p>The maximum number of tokens to allow in the generated response. The default value is
|
|
711
|
+
* the maximum allowed value for the model that you are using. For more information, see
|
|
712
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundation models</a>. </p>
|
|
818
713
|
* @public
|
|
819
714
|
*/
|
|
820
|
-
|
|
715
|
+
maxTokens?: number;
|
|
821
716
|
/**
|
|
822
|
-
* <p>
|
|
717
|
+
* <p>The likelihood of the model selecting higher-probability options while generating a
|
|
718
|
+
* response. A lower value makes the model more likely to choose higher-probability options,
|
|
719
|
+
* while a higher value makes the model more likely to choose lower-probability
|
|
720
|
+
* options.</p>
|
|
721
|
+
* <p>The default value is the default value for the model that
|
|
722
|
+
* you are using. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundation
|
|
723
|
+
* models</a>. </p>
|
|
823
724
|
* @public
|
|
824
725
|
*/
|
|
825
|
-
|
|
726
|
+
temperature?: number;
|
|
826
727
|
/**
|
|
827
|
-
* <p>
|
|
828
|
-
*
|
|
829
|
-
*
|
|
728
|
+
* <p>The percentage of most-likely candidates that the model considers for the next token. For
|
|
729
|
+
* example, if you choose a value of 0.8 for <code>topP</code>, the model selects from the top 80% of the
|
|
730
|
+
* probability distribution of tokens that could be next in the sequence.</p>
|
|
731
|
+
* <p>The default value is the default value for the model that you are using. For more information, see
|
|
732
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundation models</a>. </p>
|
|
830
733
|
* @public
|
|
831
734
|
*/
|
|
832
|
-
|
|
735
|
+
topP?: number;
|
|
833
736
|
/**
|
|
834
|
-
* <p>
|
|
835
|
-
*
|
|
836
|
-
* <code>additionalModelResponseFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
|
|
837
|
-
* <p>
|
|
838
|
-
* <code>[
|
|
839
|
-
* "/stop_sequence"
|
|
840
|
-
* ]</code>
|
|
841
|
-
* </p>
|
|
842
|
-
* <p>For information about the JSON Pointer syntax, see the
|
|
843
|
-
* <a href="https://datatracker.ietf.org/doc/html/rfc6901">Internet Engineering Task Force (IETF)</a> documentation.</p>
|
|
844
|
-
* <p>
|
|
845
|
-
* <code>Converse</code> rejects an empty JSON Pointer or incorrectly structured
|
|
846
|
-
* JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested
|
|
847
|
-
* field is not in the model response, it is ignored by <code>Converse</code>.</p>
|
|
737
|
+
* <p>A list of stop sequences. A stop sequence is a sequence of characters that causes the
|
|
738
|
+
* model to stop generating the response. </p>
|
|
848
739
|
* @public
|
|
849
740
|
*/
|
|
850
|
-
|
|
741
|
+
stopSequences?: string[];
|
|
851
742
|
}
|
|
852
743
|
/**
|
|
853
|
-
* <p>Metrics for a call to <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html">Converse</a>.</p>
|
|
854
744
|
* @public
|
|
745
|
+
* @enum
|
|
855
746
|
*/
|
|
856
|
-
export
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
747
|
+
export declare const DocumentFormat: {
|
|
748
|
+
readonly CSV: "csv";
|
|
749
|
+
readonly DOC: "doc";
|
|
750
|
+
readonly DOCX: "docx";
|
|
751
|
+
readonly HTML: "html";
|
|
752
|
+
readonly MD: "md";
|
|
753
|
+
readonly PDF: "pdf";
|
|
754
|
+
readonly TXT: "txt";
|
|
755
|
+
readonly XLS: "xls";
|
|
756
|
+
readonly XLSX: "xlsx";
|
|
757
|
+
};
|
|
864
758
|
/**
|
|
865
|
-
* <p>The output from a call to <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html">Converse</a>.</p>
|
|
866
759
|
* @public
|
|
867
760
|
*/
|
|
868
|
-
export type
|
|
761
|
+
export type DocumentFormat = (typeof DocumentFormat)[keyof typeof DocumentFormat];
|
|
869
762
|
/**
|
|
763
|
+
* <p>Contains the content of a document.</p>
|
|
870
764
|
* @public
|
|
871
765
|
*/
|
|
872
|
-
export
|
|
766
|
+
export type DocumentSource = DocumentSource.BytesMember | DocumentSource.$UnknownMember;
|
|
767
|
+
/**
|
|
768
|
+
* @public
|
|
769
|
+
*/
|
|
770
|
+
export declare namespace DocumentSource {
|
|
873
771
|
/**
|
|
874
|
-
* <p>The
|
|
772
|
+
* <p>The raw bytes for the document. If you use an Amazon Web Services SDK, you don't need to encode the bytes in base64.</p>
|
|
875
773
|
* @public
|
|
876
774
|
*/
|
|
877
|
-
interface
|
|
878
|
-
|
|
775
|
+
interface BytesMember {
|
|
776
|
+
bytes: Uint8Array;
|
|
879
777
|
$unknown?: never;
|
|
880
778
|
}
|
|
881
779
|
/**
|
|
882
780
|
* @public
|
|
883
781
|
*/
|
|
884
782
|
interface $UnknownMember {
|
|
885
|
-
|
|
783
|
+
bytes?: never;
|
|
886
784
|
$unknown: [string, any];
|
|
887
785
|
}
|
|
888
786
|
interface Visitor<T> {
|
|
889
|
-
|
|
787
|
+
bytes: (value: Uint8Array) => T;
|
|
890
788
|
_: (name: string, value: any) => T;
|
|
891
789
|
}
|
|
892
|
-
const visit: <T>(value:
|
|
790
|
+
const visit: <T>(value: DocumentSource, visitor: Visitor<T>) => T;
|
|
893
791
|
}
|
|
894
792
|
/**
|
|
895
|
-
*
|
|
896
|
-
* @enum
|
|
897
|
-
*/
|
|
898
|
-
export declare const StopReason: {
|
|
899
|
-
readonly CONTENT_FILTERED: "content_filtered";
|
|
900
|
-
readonly END_TURN: "end_turn";
|
|
901
|
-
readonly GUARDRAIL_INTERVENED: "guardrail_intervened";
|
|
902
|
-
readonly MAX_TOKENS: "max_tokens";
|
|
903
|
-
readonly STOP_SEQUENCE: "stop_sequence";
|
|
904
|
-
readonly TOOL_USE: "tool_use";
|
|
905
|
-
};
|
|
906
|
-
/**
|
|
793
|
+
* <p>A document to include in a message.</p>
|
|
907
794
|
* @public
|
|
908
795
|
*/
|
|
909
|
-
export
|
|
796
|
+
export interface DocumentBlock {
|
|
797
|
+
/**
|
|
798
|
+
* <p>The format of a document, or its extension.</p>
|
|
799
|
+
* @public
|
|
800
|
+
*/
|
|
801
|
+
format: DocumentFormat | undefined;
|
|
802
|
+
/**
|
|
803
|
+
* <p>A name for the document. The name can only contain the following characters:</p>
|
|
804
|
+
* <ul>
|
|
805
|
+
* <li>
|
|
806
|
+
* <p>Alphanumeric characters</p>
|
|
807
|
+
* </li>
|
|
808
|
+
* <li>
|
|
809
|
+
* <p>Whitespace characters (no more than one in a row)</p>
|
|
810
|
+
* </li>
|
|
811
|
+
* <li>
|
|
812
|
+
* <p>Hyphens</p>
|
|
813
|
+
* </li>
|
|
814
|
+
* <li>
|
|
815
|
+
* <p>Parentheses</p>
|
|
816
|
+
* </li>
|
|
817
|
+
* <li>
|
|
818
|
+
* <p>Square brackets</p>
|
|
819
|
+
* </li>
|
|
820
|
+
* </ul>
|
|
821
|
+
* <note>
|
|
822
|
+
* <p>This field is vulnerable to prompt injections, because the model might inadvertently interpret it as instructions. Therefore, we recommend that you specify a neutral name.</p>
|
|
823
|
+
* </note>
|
|
824
|
+
* @public
|
|
825
|
+
*/
|
|
826
|
+
name: string | undefined;
|
|
827
|
+
/**
|
|
828
|
+
* <p>Contains the content of the document.</p>
|
|
829
|
+
* @public
|
|
830
|
+
*/
|
|
831
|
+
source: DocumentSource | undefined;
|
|
832
|
+
}
|
|
910
833
|
/**
|
|
911
834
|
* @public
|
|
912
835
|
* @enum
|
|
913
836
|
*/
|
|
914
|
-
export declare const
|
|
915
|
-
readonly
|
|
837
|
+
export declare const GuardrailConverseContentQualifier: {
|
|
838
|
+
readonly GROUNDING_SOURCE: "grounding_source";
|
|
839
|
+
readonly GUARD_CONTENT: "guard_content";
|
|
840
|
+
readonly QUERY: "query";
|
|
916
841
|
};
|
|
917
842
|
/**
|
|
918
843
|
* @public
|
|
919
844
|
*/
|
|
920
|
-
export type
|
|
845
|
+
export type GuardrailConverseContentQualifier = (typeof GuardrailConverseContentQualifier)[keyof typeof GuardrailConverseContentQualifier];
|
|
921
846
|
/**
|
|
847
|
+
* <p>A text block that contains text that you want to assess with a guardrail. For more information, see <a>GuardrailConverseContentBlock</a>.</p>
|
|
922
848
|
* @public
|
|
923
|
-
* @enum
|
|
924
849
|
*/
|
|
925
|
-
export
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
850
|
+
export interface GuardrailConverseTextBlock {
|
|
851
|
+
/**
|
|
852
|
+
* <p>The text that you want to guard.</p>
|
|
853
|
+
* @public
|
|
854
|
+
*/
|
|
855
|
+
text: string | undefined;
|
|
856
|
+
/**
|
|
857
|
+
* <p>The qualifier details for the guardrails contextual grounding filter.</p>
|
|
858
|
+
* @public
|
|
859
|
+
*/
|
|
860
|
+
qualifiers?: GuardrailConverseContentQualifier[];
|
|
861
|
+
}
|
|
931
862
|
/**
|
|
863
|
+
* <p/>
|
|
864
|
+
* <p>A content block for selective guarding with the <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html">Converse</a> or <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html">ConverseStream</a> API operations.
|
|
865
|
+
* </p>
|
|
932
866
|
* @public
|
|
933
867
|
*/
|
|
934
|
-
export type
|
|
868
|
+
export type GuardrailConverseContentBlock = GuardrailConverseContentBlock.TextMember | GuardrailConverseContentBlock.$UnknownMember;
|
|
935
869
|
/**
|
|
936
870
|
* @public
|
|
937
|
-
* @enum
|
|
938
871
|
*/
|
|
939
|
-
export declare
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
872
|
+
export declare namespace GuardrailConverseContentBlock {
|
|
873
|
+
/**
|
|
874
|
+
* <p>The text to guard.</p>
|
|
875
|
+
* @public
|
|
876
|
+
*/
|
|
877
|
+
interface TextMember {
|
|
878
|
+
text: GuardrailConverseTextBlock;
|
|
879
|
+
$unknown?: never;
|
|
880
|
+
}
|
|
881
|
+
/**
|
|
882
|
+
* @public
|
|
883
|
+
*/
|
|
884
|
+
interface $UnknownMember {
|
|
885
|
+
text?: never;
|
|
886
|
+
$unknown: [string, any];
|
|
887
|
+
}
|
|
888
|
+
interface Visitor<T> {
|
|
889
|
+
text: (value: GuardrailConverseTextBlock) => T;
|
|
890
|
+
_: (name: string, value: any) => T;
|
|
891
|
+
}
|
|
892
|
+
const visit: <T>(value: GuardrailConverseContentBlock, visitor: Visitor<T>) => T;
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* @public
|
|
896
|
+
* @enum
|
|
897
|
+
*/
|
|
898
|
+
export declare const ImageFormat: {
|
|
899
|
+
readonly GIF: "gif";
|
|
900
|
+
readonly JPEG: "jpeg";
|
|
901
|
+
readonly PNG: "png";
|
|
902
|
+
readonly WEBP: "webp";
|
|
946
903
|
};
|
|
947
904
|
/**
|
|
948
905
|
* @public
|
|
949
906
|
*/
|
|
950
|
-
export type
|
|
907
|
+
export type ImageFormat = (typeof ImageFormat)[keyof typeof ImageFormat];
|
|
951
908
|
/**
|
|
952
|
-
* <p>The
|
|
909
|
+
* <p>The source for an image.</p>
|
|
953
910
|
* @public
|
|
954
911
|
*/
|
|
955
|
-
export
|
|
912
|
+
export type ImageSource = ImageSource.BytesMember | ImageSource.$UnknownMember;
|
|
913
|
+
/**
|
|
914
|
+
* @public
|
|
915
|
+
*/
|
|
916
|
+
export declare namespace ImageSource {
|
|
956
917
|
/**
|
|
957
|
-
* <p>The
|
|
918
|
+
* <p>The raw image bytes for the image. If you use an AWS SDK, you don't need to encode the image bytes in base64.</p>
|
|
958
919
|
* @public
|
|
959
920
|
*/
|
|
960
|
-
|
|
921
|
+
interface BytesMember {
|
|
922
|
+
bytes: Uint8Array;
|
|
923
|
+
$unknown?: never;
|
|
924
|
+
}
|
|
961
925
|
/**
|
|
962
|
-
* <p>The guardrail confidence.</p>
|
|
963
926
|
* @public
|
|
964
927
|
*/
|
|
965
|
-
|
|
928
|
+
interface $UnknownMember {
|
|
929
|
+
bytes?: never;
|
|
930
|
+
$unknown: [string, any];
|
|
931
|
+
}
|
|
932
|
+
interface Visitor<T> {
|
|
933
|
+
bytes: (value: Uint8Array) => T;
|
|
934
|
+
_: (name: string, value: any) => T;
|
|
935
|
+
}
|
|
936
|
+
const visit: <T>(value: ImageSource, visitor: Visitor<T>) => T;
|
|
937
|
+
}
|
|
938
|
+
/**
|
|
939
|
+
* <p>Image content for a message.</p>
|
|
940
|
+
* @public
|
|
941
|
+
*/
|
|
942
|
+
export interface ImageBlock {
|
|
966
943
|
/**
|
|
967
|
-
* <p>The
|
|
944
|
+
* <p>The format of the image.</p>
|
|
968
945
|
* @public
|
|
969
946
|
*/
|
|
970
|
-
|
|
947
|
+
format: ImageFormat | undefined;
|
|
948
|
+
/**
|
|
949
|
+
* <p>The source for the image.</p>
|
|
950
|
+
* @public
|
|
951
|
+
*/
|
|
952
|
+
source: ImageSource | undefined;
|
|
971
953
|
}
|
|
972
954
|
/**
|
|
973
|
-
* <p>
|
|
955
|
+
* <p>The tool result content block.</p>
|
|
974
956
|
* @public
|
|
975
957
|
*/
|
|
976
|
-
export
|
|
958
|
+
export type ToolResultContentBlock = ToolResultContentBlock.DocumentMember | ToolResultContentBlock.ImageMember | ToolResultContentBlock.JsonMember | ToolResultContentBlock.TextMember | ToolResultContentBlock.$UnknownMember;
|
|
959
|
+
/**
|
|
960
|
+
* @public
|
|
961
|
+
*/
|
|
962
|
+
export declare namespace ToolResultContentBlock {
|
|
977
963
|
/**
|
|
978
|
-
* <p>
|
|
964
|
+
* <p>A tool result that is JSON format data.</p>
|
|
979
965
|
* @public
|
|
980
966
|
*/
|
|
981
|
-
|
|
967
|
+
interface JsonMember {
|
|
968
|
+
json: __DocumentType;
|
|
969
|
+
text?: never;
|
|
970
|
+
image?: never;
|
|
971
|
+
document?: never;
|
|
972
|
+
$unknown?: never;
|
|
973
|
+
}
|
|
974
|
+
/**
|
|
975
|
+
* <p>A tool result that is text.</p>
|
|
976
|
+
* @public
|
|
977
|
+
*/
|
|
978
|
+
interface TextMember {
|
|
979
|
+
json?: never;
|
|
980
|
+
text: string;
|
|
981
|
+
image?: never;
|
|
982
|
+
document?: never;
|
|
983
|
+
$unknown?: never;
|
|
984
|
+
}
|
|
985
|
+
/**
|
|
986
|
+
* <p>A tool result that is an image.</p>
|
|
987
|
+
* <note>
|
|
988
|
+
* <p>This field is only supported by Anthropic Claude 3 models.</p>
|
|
989
|
+
* </note>
|
|
990
|
+
* @public
|
|
991
|
+
*/
|
|
992
|
+
interface ImageMember {
|
|
993
|
+
json?: never;
|
|
994
|
+
text?: never;
|
|
995
|
+
image: ImageBlock;
|
|
996
|
+
document?: never;
|
|
997
|
+
$unknown?: never;
|
|
998
|
+
}
|
|
999
|
+
/**
|
|
1000
|
+
* <p>A tool result that is a document.</p>
|
|
1001
|
+
* @public
|
|
1002
|
+
*/
|
|
1003
|
+
interface DocumentMember {
|
|
1004
|
+
json?: never;
|
|
1005
|
+
text?: never;
|
|
1006
|
+
image?: never;
|
|
1007
|
+
document: DocumentBlock;
|
|
1008
|
+
$unknown?: never;
|
|
1009
|
+
}
|
|
1010
|
+
/**
|
|
1011
|
+
* @public
|
|
1012
|
+
*/
|
|
1013
|
+
interface $UnknownMember {
|
|
1014
|
+
json?: never;
|
|
1015
|
+
text?: never;
|
|
1016
|
+
image?: never;
|
|
1017
|
+
document?: never;
|
|
1018
|
+
$unknown: [string, any];
|
|
1019
|
+
}
|
|
1020
|
+
interface Visitor<T> {
|
|
1021
|
+
json: (value: __DocumentType) => T;
|
|
1022
|
+
text: (value: string) => T;
|
|
1023
|
+
image: (value: ImageBlock) => T;
|
|
1024
|
+
document: (value: DocumentBlock) => T;
|
|
1025
|
+
_: (name: string, value: any) => T;
|
|
1026
|
+
}
|
|
1027
|
+
const visit: <T>(value: ToolResultContentBlock, visitor: Visitor<T>) => T;
|
|
1028
|
+
}
|
|
1029
|
+
/**
|
|
1030
|
+
* @public
|
|
1031
|
+
* @enum
|
|
1032
|
+
*/
|
|
1033
|
+
export declare const ToolResultStatus: {
|
|
1034
|
+
readonly ERROR: "error";
|
|
1035
|
+
readonly SUCCESS: "success";
|
|
1036
|
+
};
|
|
1037
|
+
/**
|
|
1038
|
+
* @public
|
|
1039
|
+
*/
|
|
1040
|
+
export type ToolResultStatus = (typeof ToolResultStatus)[keyof typeof ToolResultStatus];
|
|
1041
|
+
/**
|
|
1042
|
+
* <p>A tool result block that contains the results for a tool request that
|
|
1043
|
+
* the model previously made.</p>
|
|
1044
|
+
* @public
|
|
1045
|
+
*/
|
|
1046
|
+
export interface ToolResultBlock {
|
|
1047
|
+
/**
|
|
1048
|
+
* <p>The ID of the tool request that this is the result for.</p>
|
|
1049
|
+
* @public
|
|
1050
|
+
*/
|
|
1051
|
+
toolUseId: string | undefined;
|
|
1052
|
+
/**
|
|
1053
|
+
* <p>The content for tool result content block.</p>
|
|
1054
|
+
* @public
|
|
1055
|
+
*/
|
|
1056
|
+
content: ToolResultContentBlock[] | undefined;
|
|
1057
|
+
/**
|
|
1058
|
+
* <p>The status for the tool result content block.</p>
|
|
1059
|
+
* <note>
|
|
1060
|
+
* <p>This field is only supported Anthropic Claude 3 models.</p>
|
|
1061
|
+
* </note>
|
|
1062
|
+
* @public
|
|
1063
|
+
*/
|
|
1064
|
+
status?: ToolResultStatus;
|
|
1065
|
+
}
|
|
1066
|
+
/**
|
|
1067
|
+
* <p>A tool use content block. Contains information about a tool that the model
|
|
1068
|
+
* is requesting be run., The model uses the result from the tool to generate a response. </p>
|
|
1069
|
+
* @public
|
|
1070
|
+
*/
|
|
1071
|
+
export interface ToolUseBlock {
|
|
1072
|
+
/**
|
|
1073
|
+
* <p>The ID for the tool request.</p>
|
|
1074
|
+
* @public
|
|
1075
|
+
*/
|
|
1076
|
+
toolUseId: string | undefined;
|
|
1077
|
+
/**
|
|
1078
|
+
* <p>The name of the tool that the model wants to use.</p>
|
|
1079
|
+
* @public
|
|
1080
|
+
*/
|
|
1081
|
+
name: string | undefined;
|
|
1082
|
+
/**
|
|
1083
|
+
* <p>The input to pass to the tool. </p>
|
|
1084
|
+
* @public
|
|
1085
|
+
*/
|
|
1086
|
+
input: __DocumentType | undefined;
|
|
1087
|
+
}
|
|
1088
|
+
/**
|
|
1089
|
+
* <p>A block of content for a message that you pass to, or receive from, a model with the <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html">Converse</a> or <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html">ConverseStream</a> API operations.</p>
|
|
1090
|
+
* @public
|
|
1091
|
+
*/
|
|
1092
|
+
export type ContentBlock = ContentBlock.DocumentMember | ContentBlock.GuardContentMember | ContentBlock.ImageMember | ContentBlock.TextMember | ContentBlock.ToolResultMember | ContentBlock.ToolUseMember | ContentBlock.$UnknownMember;
|
|
1093
|
+
/**
|
|
1094
|
+
* @public
|
|
1095
|
+
*/
|
|
1096
|
+
export declare namespace ContentBlock {
|
|
1097
|
+
/**
|
|
1098
|
+
* <p>Text to include in the message.</p>
|
|
1099
|
+
* @public
|
|
1100
|
+
*/
|
|
1101
|
+
interface TextMember {
|
|
1102
|
+
text: string;
|
|
1103
|
+
image?: never;
|
|
1104
|
+
document?: never;
|
|
1105
|
+
toolUse?: never;
|
|
1106
|
+
toolResult?: never;
|
|
1107
|
+
guardContent?: never;
|
|
1108
|
+
$unknown?: never;
|
|
1109
|
+
}
|
|
1110
|
+
/**
|
|
1111
|
+
* <p>Image to include in the message. </p>
|
|
1112
|
+
* <note>
|
|
1113
|
+
* <p>This field is only supported by Anthropic Claude 3 models.</p>
|
|
1114
|
+
* </note>
|
|
1115
|
+
* @public
|
|
1116
|
+
*/
|
|
1117
|
+
interface ImageMember {
|
|
1118
|
+
text?: never;
|
|
1119
|
+
image: ImageBlock;
|
|
1120
|
+
document?: never;
|
|
1121
|
+
toolUse?: never;
|
|
1122
|
+
toolResult?: never;
|
|
1123
|
+
guardContent?: never;
|
|
1124
|
+
$unknown?: never;
|
|
1125
|
+
}
|
|
1126
|
+
/**
|
|
1127
|
+
* <p>A document to include in the message.</p>
|
|
1128
|
+
* @public
|
|
1129
|
+
*/
|
|
1130
|
+
interface DocumentMember {
|
|
1131
|
+
text?: never;
|
|
1132
|
+
image?: never;
|
|
1133
|
+
document: DocumentBlock;
|
|
1134
|
+
toolUse?: never;
|
|
1135
|
+
toolResult?: never;
|
|
1136
|
+
guardContent?: never;
|
|
1137
|
+
$unknown?: never;
|
|
1138
|
+
}
|
|
1139
|
+
/**
|
|
1140
|
+
* <p>Information about a tool use request from a model.</p>
|
|
1141
|
+
* @public
|
|
1142
|
+
*/
|
|
1143
|
+
interface ToolUseMember {
|
|
1144
|
+
text?: never;
|
|
1145
|
+
image?: never;
|
|
1146
|
+
document?: never;
|
|
1147
|
+
toolUse: ToolUseBlock;
|
|
1148
|
+
toolResult?: never;
|
|
1149
|
+
guardContent?: never;
|
|
1150
|
+
$unknown?: never;
|
|
1151
|
+
}
|
|
1152
|
+
/**
|
|
1153
|
+
* <p>The result for a tool request that a model makes.</p>
|
|
1154
|
+
* @public
|
|
1155
|
+
*/
|
|
1156
|
+
interface ToolResultMember {
|
|
1157
|
+
text?: never;
|
|
1158
|
+
image?: never;
|
|
1159
|
+
document?: never;
|
|
1160
|
+
toolUse?: never;
|
|
1161
|
+
toolResult: ToolResultBlock;
|
|
1162
|
+
guardContent?: never;
|
|
1163
|
+
$unknown?: never;
|
|
1164
|
+
}
|
|
1165
|
+
/**
|
|
1166
|
+
* <p>Contains the content to assess with the guardrail. If you don't specify
|
|
1167
|
+
* <code>guardContent</code> in a call to the Converse API, the guardrail (if passed in the
|
|
1168
|
+
* Converse API) assesses the entire message.</p>
|
|
1169
|
+
* <p>For more information, see <i>Use a guardrail with the Converse API</i> in the <i>Amazon Bedrock User Guide</i>.
|
|
1170
|
+
*
|
|
1171
|
+
* </p>
|
|
1172
|
+
* @public
|
|
1173
|
+
*/
|
|
1174
|
+
interface GuardContentMember {
|
|
1175
|
+
text?: never;
|
|
1176
|
+
image?: never;
|
|
1177
|
+
document?: never;
|
|
1178
|
+
toolUse?: never;
|
|
1179
|
+
toolResult?: never;
|
|
1180
|
+
guardContent: GuardrailConverseContentBlock;
|
|
1181
|
+
$unknown?: never;
|
|
1182
|
+
}
|
|
1183
|
+
/**
|
|
1184
|
+
* @public
|
|
1185
|
+
*/
|
|
1186
|
+
interface $UnknownMember {
|
|
1187
|
+
text?: never;
|
|
1188
|
+
image?: never;
|
|
1189
|
+
document?: never;
|
|
1190
|
+
toolUse?: never;
|
|
1191
|
+
toolResult?: never;
|
|
1192
|
+
guardContent?: never;
|
|
1193
|
+
$unknown: [string, any];
|
|
1194
|
+
}
|
|
1195
|
+
interface Visitor<T> {
|
|
1196
|
+
text: (value: string) => T;
|
|
1197
|
+
image: (value: ImageBlock) => T;
|
|
1198
|
+
document: (value: DocumentBlock) => T;
|
|
1199
|
+
toolUse: (value: ToolUseBlock) => T;
|
|
1200
|
+
toolResult: (value: ToolResultBlock) => T;
|
|
1201
|
+
guardContent: (value: GuardrailConverseContentBlock) => T;
|
|
1202
|
+
_: (name: string, value: any) => T;
|
|
1203
|
+
}
|
|
1204
|
+
const visit: <T>(value: ContentBlock, visitor: Visitor<T>) => T;
|
|
982
1205
|
}
|
|
983
1206
|
/**
|
|
984
1207
|
* @public
|
|
985
1208
|
* @enum
|
|
986
1209
|
*/
|
|
987
|
-
export declare const
|
|
988
|
-
readonly
|
|
989
|
-
readonly
|
|
1210
|
+
export declare const ConversationRole: {
|
|
1211
|
+
readonly ASSISTANT: "assistant";
|
|
1212
|
+
readonly USER: "user";
|
|
990
1213
|
};
|
|
991
1214
|
/**
|
|
992
1215
|
* @public
|
|
993
1216
|
*/
|
|
994
|
-
export type
|
|
1217
|
+
export type ConversationRole = (typeof ConversationRole)[keyof typeof ConversationRole];
|
|
995
1218
|
/**
|
|
1219
|
+
* <p>A message input, or returned from, a call to <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html">Converse</a> or <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html">ConverseStream</a>.</p>
|
|
996
1220
|
* @public
|
|
997
|
-
* @enum
|
|
998
1221
|
*/
|
|
999
|
-
export
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
readonly US_BANK_ACCOUNT_NUMBER: "US_BANK_ACCOUNT_NUMBER";
|
|
1026
|
-
readonly US_BANK_ROUTING_NUMBER: "US_BANK_ROUTING_NUMBER";
|
|
1027
|
-
readonly US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER: "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER";
|
|
1028
|
-
readonly US_PASSPORT_NUMBER: "US_PASSPORT_NUMBER";
|
|
1029
|
-
readonly US_SOCIAL_SECURITY_NUMBER: "US_SOCIAL_SECURITY_NUMBER";
|
|
1030
|
-
readonly VEHICLE_IDENTIFICATION_NUMBER: "VEHICLE_IDENTIFICATION_NUMBER";
|
|
1031
|
-
};
|
|
1222
|
+
export interface Message {
|
|
1223
|
+
/**
|
|
1224
|
+
* <p>The role that the message plays in the message.</p>
|
|
1225
|
+
* @public
|
|
1226
|
+
*/
|
|
1227
|
+
role: ConversationRole | undefined;
|
|
1228
|
+
/**
|
|
1229
|
+
* <p>The message content. Note the following restrictions:</p>
|
|
1230
|
+
* <ul>
|
|
1231
|
+
* <li>
|
|
1232
|
+
* <p>You can include up to 20 images. Each image's size, height, and width must be no more than 3.75 MB, 8000 px, and 8000 px, respectively.</p>
|
|
1233
|
+
* </li>
|
|
1234
|
+
* <li>
|
|
1235
|
+
* <p>You can include up to five documents. Each document's size must be no more than 4.5 MB.</p>
|
|
1236
|
+
* </li>
|
|
1237
|
+
* <li>
|
|
1238
|
+
* <p>If you include a <code>ContentBlock</code> with a <code>document</code> field in the array, you must also include a <code>ContentBlock</code> with a <code>text</code> field.</p>
|
|
1239
|
+
* </li>
|
|
1240
|
+
* <li>
|
|
1241
|
+
* <p>You can only include images and documents if the <code>role</code> is <code>user</code>.</p>
|
|
1242
|
+
* </li>
|
|
1243
|
+
* </ul>
|
|
1244
|
+
* @public
|
|
1245
|
+
*/
|
|
1246
|
+
content: ContentBlock[] | undefined;
|
|
1247
|
+
}
|
|
1032
1248
|
/**
|
|
1249
|
+
* <p>A system content block.</p>
|
|
1033
1250
|
* @public
|
|
1034
1251
|
*/
|
|
1035
|
-
export type
|
|
1252
|
+
export type SystemContentBlock = SystemContentBlock.GuardContentMember | SystemContentBlock.TextMember | SystemContentBlock.$UnknownMember;
|
|
1036
1253
|
/**
|
|
1037
|
-
* <p>A Personally Identifiable Information (PII) entity configured in a guardrail.</p>
|
|
1038
1254
|
* @public
|
|
1039
1255
|
*/
|
|
1040
|
-
export
|
|
1256
|
+
export declare namespace SystemContentBlock {
|
|
1041
1257
|
/**
|
|
1042
|
-
* <p>
|
|
1258
|
+
* <p>A system prompt for the model. </p>
|
|
1043
1259
|
* @public
|
|
1044
1260
|
*/
|
|
1045
|
-
|
|
1261
|
+
interface TextMember {
|
|
1262
|
+
text: string;
|
|
1263
|
+
guardContent?: never;
|
|
1264
|
+
$unknown?: never;
|
|
1265
|
+
}
|
|
1046
1266
|
/**
|
|
1047
|
-
* <p>
|
|
1267
|
+
* <p>A content block to assess with the guardrail. Use with the <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html">Converse</a> or <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html">ConverseStream</a> API operations. </p>
|
|
1268
|
+
* <p>For more information, see <i>Use a guardrail with the Converse
|
|
1269
|
+
* API</i> in the <i>Amazon Bedrock User Guide</i>.</p>
|
|
1048
1270
|
* @public
|
|
1049
1271
|
*/
|
|
1050
|
-
|
|
1272
|
+
interface GuardContentMember {
|
|
1273
|
+
text?: never;
|
|
1274
|
+
guardContent: GuardrailConverseContentBlock;
|
|
1275
|
+
$unknown?: never;
|
|
1276
|
+
}
|
|
1051
1277
|
/**
|
|
1052
|
-
* <p>The PII entity filter action.</p>
|
|
1053
1278
|
* @public
|
|
1054
1279
|
*/
|
|
1055
|
-
|
|
1280
|
+
interface $UnknownMember {
|
|
1281
|
+
text?: never;
|
|
1282
|
+
guardContent?: never;
|
|
1283
|
+
$unknown: [string, any];
|
|
1284
|
+
}
|
|
1285
|
+
interface Visitor<T> {
|
|
1286
|
+
text: (value: string) => T;
|
|
1287
|
+
guardContent: (value: GuardrailConverseContentBlock) => T;
|
|
1288
|
+
_: (name: string, value: any) => T;
|
|
1289
|
+
}
|
|
1290
|
+
const visit: <T>(value: SystemContentBlock, visitor: Visitor<T>) => T;
|
|
1056
1291
|
}
|
|
1057
1292
|
/**
|
|
1058
|
-
* <p>
|
|
1293
|
+
* <p>The model must request at least one tool (no text is generated). For example, <code>\{"any" : \{\}\}</code>.</p>
|
|
1059
1294
|
* @public
|
|
1060
1295
|
*/
|
|
1061
|
-
export interface
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1296
|
+
export interface AnyToolChoice {
|
|
1297
|
+
}
|
|
1298
|
+
/**
|
|
1299
|
+
* <p>The Model automatically decides if a tool should be called or whether to generate text instead.
|
|
1300
|
+
* For example, <code>\{"auto" : \{\}\}</code>.</p>
|
|
1301
|
+
* @public
|
|
1302
|
+
*/
|
|
1303
|
+
export interface AutoToolChoice {
|
|
1304
|
+
}
|
|
1305
|
+
/**
|
|
1306
|
+
* <p>The model must request a specific tool. For example, <code>\{"tool" : \{"name" : "Your tool name"\}\}</code>.</p>
|
|
1307
|
+
* <note>
|
|
1308
|
+
* <p>This field is only supported by Anthropic Claude 3 models.</p>
|
|
1309
|
+
* </note>
|
|
1310
|
+
* @public
|
|
1311
|
+
*/
|
|
1312
|
+
export interface SpecificToolChoice {
|
|
1067
1313
|
/**
|
|
1068
|
-
* <p>The
|
|
1314
|
+
* <p>The name of the tool that the model must request. </p>
|
|
1069
1315
|
* @public
|
|
1070
1316
|
*/
|
|
1071
|
-
|
|
1317
|
+
name: string | undefined;
|
|
1318
|
+
}
|
|
1319
|
+
/**
|
|
1320
|
+
* <p>Determines which tools the model should request in a call to <code>Converse</code> or <code>ConverseStream</code>.
|
|
1321
|
+
* <code>ToolChoice</code> is only supported by
|
|
1322
|
+
* Anthropic Claude 3 models and by Mistral AI Mistral Large.</p>
|
|
1323
|
+
* @public
|
|
1324
|
+
*/
|
|
1325
|
+
export type ToolChoice = ToolChoice.AnyMember | ToolChoice.AutoMember | ToolChoice.ToolMember | ToolChoice.$UnknownMember;
|
|
1326
|
+
/**
|
|
1327
|
+
* @public
|
|
1328
|
+
*/
|
|
1329
|
+
export declare namespace ToolChoice {
|
|
1072
1330
|
/**
|
|
1073
|
-
* <p>The
|
|
1331
|
+
* <p>(Default). The Model automatically decides if a tool should be called or whether to generate text instead. </p>
|
|
1074
1332
|
* @public
|
|
1075
1333
|
*/
|
|
1076
|
-
|
|
1334
|
+
interface AutoMember {
|
|
1335
|
+
auto: AutoToolChoice;
|
|
1336
|
+
any?: never;
|
|
1337
|
+
tool?: never;
|
|
1338
|
+
$unknown?: never;
|
|
1339
|
+
}
|
|
1077
1340
|
/**
|
|
1078
|
-
* <p>The
|
|
1341
|
+
* <p>The model must request at least one tool (no text is generated).</p>
|
|
1079
1342
|
* @public
|
|
1080
1343
|
*/
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
export interface GuardrailSensitiveInformationPolicyAssessment {
|
|
1344
|
+
interface AnyMember {
|
|
1345
|
+
auto?: never;
|
|
1346
|
+
any: AnyToolChoice;
|
|
1347
|
+
tool?: never;
|
|
1348
|
+
$unknown?: never;
|
|
1349
|
+
}
|
|
1088
1350
|
/**
|
|
1089
|
-
* <p>The
|
|
1351
|
+
* <p>The Model must request the specified tool. Only supported by Anthropic Claude 3 models. </p>
|
|
1090
1352
|
* @public
|
|
1091
1353
|
*/
|
|
1092
|
-
|
|
1354
|
+
interface ToolMember {
|
|
1355
|
+
auto?: never;
|
|
1356
|
+
any?: never;
|
|
1357
|
+
tool: SpecificToolChoice;
|
|
1358
|
+
$unknown?: never;
|
|
1359
|
+
}
|
|
1093
1360
|
/**
|
|
1094
|
-
* <p>The regex queries in the assessment.</p>
|
|
1095
1361
|
* @public
|
|
1096
1362
|
*/
|
|
1097
|
-
|
|
1363
|
+
interface $UnknownMember {
|
|
1364
|
+
auto?: never;
|
|
1365
|
+
any?: never;
|
|
1366
|
+
tool?: never;
|
|
1367
|
+
$unknown: [string, any];
|
|
1368
|
+
}
|
|
1369
|
+
interface Visitor<T> {
|
|
1370
|
+
auto: (value: AutoToolChoice) => T;
|
|
1371
|
+
any: (value: AnyToolChoice) => T;
|
|
1372
|
+
tool: (value: SpecificToolChoice) => T;
|
|
1373
|
+
_: (name: string, value: any) => T;
|
|
1374
|
+
}
|
|
1375
|
+
const visit: <T>(value: ToolChoice, visitor: Visitor<T>) => T;
|
|
1098
1376
|
}
|
|
1099
1377
|
/**
|
|
1100
|
-
*
|
|
1101
|
-
* @enum
|
|
1102
|
-
*/
|
|
1103
|
-
export declare const GuardrailTopicPolicyAction: {
|
|
1104
|
-
readonly BLOCKED: "BLOCKED";
|
|
1105
|
-
};
|
|
1106
|
-
/**
|
|
1107
|
-
* @public
|
|
1108
|
-
*/
|
|
1109
|
-
export type GuardrailTopicPolicyAction = (typeof GuardrailTopicPolicyAction)[keyof typeof GuardrailTopicPolicyAction];
|
|
1110
|
-
/**
|
|
1111
|
-
* @public
|
|
1112
|
-
* @enum
|
|
1113
|
-
*/
|
|
1114
|
-
export declare const GuardrailTopicType: {
|
|
1115
|
-
readonly DENY: "DENY";
|
|
1116
|
-
};
|
|
1117
|
-
/**
|
|
1378
|
+
* <p>The schema for the tool. The top level schema type must be <code>object</code>. </p>
|
|
1118
1379
|
* @public
|
|
1119
1380
|
*/
|
|
1120
|
-
export type
|
|
1381
|
+
export type ToolInputSchema = ToolInputSchema.JsonMember | ToolInputSchema.$UnknownMember;
|
|
1121
1382
|
/**
|
|
1122
|
-
* <p>Information about a topic guardrail.</p>
|
|
1123
1383
|
* @public
|
|
1124
1384
|
*/
|
|
1125
|
-
export
|
|
1126
|
-
/**
|
|
1127
|
-
* <p>The name for the guardrail.</p>
|
|
1128
|
-
* @public
|
|
1129
|
-
*/
|
|
1130
|
-
name: string | undefined;
|
|
1385
|
+
export declare namespace ToolInputSchema {
|
|
1131
1386
|
/**
|
|
1132
|
-
* <p>The
|
|
1387
|
+
* <p>The JSON schema for the tool. For more information, see <a href="https://json-schema.org/understanding-json-schema/reference">JSON Schema Reference</a>.</p>
|
|
1133
1388
|
* @public
|
|
1134
1389
|
*/
|
|
1135
|
-
|
|
1390
|
+
interface JsonMember {
|
|
1391
|
+
json: __DocumentType;
|
|
1392
|
+
$unknown?: never;
|
|
1393
|
+
}
|
|
1136
1394
|
/**
|
|
1137
|
-
* <p>The action the guardrail should take when it intervenes on a topic.</p>
|
|
1138
1395
|
* @public
|
|
1139
1396
|
*/
|
|
1140
|
-
|
|
1397
|
+
interface $UnknownMember {
|
|
1398
|
+
json?: never;
|
|
1399
|
+
$unknown: [string, any];
|
|
1400
|
+
}
|
|
1401
|
+
interface Visitor<T> {
|
|
1402
|
+
json: (value: __DocumentType) => T;
|
|
1403
|
+
_: (name: string, value: any) => T;
|
|
1404
|
+
}
|
|
1405
|
+
const visit: <T>(value: ToolInputSchema, visitor: Visitor<T>) => T;
|
|
1141
1406
|
}
|
|
1142
1407
|
/**
|
|
1143
|
-
* <p>
|
|
1408
|
+
* <p>The specification for the tool.</p>
|
|
1144
1409
|
* @public
|
|
1145
1410
|
*/
|
|
1146
|
-
export interface
|
|
1411
|
+
export interface ToolSpecification {
|
|
1412
|
+
/**
|
|
1413
|
+
* <p>The name for the tool.</p>
|
|
1414
|
+
* @public
|
|
1415
|
+
*/
|
|
1416
|
+
name: string | undefined;
|
|
1147
1417
|
/**
|
|
1148
|
-
* <p>The
|
|
1418
|
+
* <p>The description for the tool.</p>
|
|
1149
1419
|
* @public
|
|
1150
1420
|
*/
|
|
1151
|
-
|
|
1421
|
+
description?: string;
|
|
1422
|
+
/**
|
|
1423
|
+
* <p>The input schema for the tool in JSON format.</p>
|
|
1424
|
+
* @public
|
|
1425
|
+
*/
|
|
1426
|
+
inputSchema: ToolInputSchema | undefined;
|
|
1152
1427
|
}
|
|
1153
1428
|
/**
|
|
1154
|
-
*
|
|
1155
|
-
* @enum
|
|
1156
|
-
*/
|
|
1157
|
-
export declare const GuardrailWordPolicyAction: {
|
|
1158
|
-
readonly BLOCKED: "BLOCKED";
|
|
1159
|
-
};
|
|
1160
|
-
/**
|
|
1429
|
+
* <p>Information about a tool that you can use with the Converse API. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html">Tool use (function calling)</a> in the Amazon Bedrock User Guide.</p>
|
|
1161
1430
|
* @public
|
|
1162
1431
|
*/
|
|
1163
|
-
export type
|
|
1432
|
+
export type Tool = Tool.ToolSpecMember | Tool.$UnknownMember;
|
|
1164
1433
|
/**
|
|
1165
|
-
* <p>A custom word configured in a guardrail.</p>
|
|
1166
1434
|
* @public
|
|
1167
1435
|
*/
|
|
1168
|
-
export
|
|
1436
|
+
export declare namespace Tool {
|
|
1169
1437
|
/**
|
|
1170
|
-
* <p>The
|
|
1438
|
+
* <p>The specfication for the tool.</p>
|
|
1171
1439
|
* @public
|
|
1172
1440
|
*/
|
|
1173
|
-
|
|
1441
|
+
interface ToolSpecMember {
|
|
1442
|
+
toolSpec: ToolSpecification;
|
|
1443
|
+
$unknown?: never;
|
|
1444
|
+
}
|
|
1174
1445
|
/**
|
|
1175
|
-
* <p>The action for the custom word.</p>
|
|
1176
1446
|
* @public
|
|
1177
1447
|
*/
|
|
1178
|
-
|
|
1448
|
+
interface $UnknownMember {
|
|
1449
|
+
toolSpec?: never;
|
|
1450
|
+
$unknown: [string, any];
|
|
1451
|
+
}
|
|
1452
|
+
interface Visitor<T> {
|
|
1453
|
+
toolSpec: (value: ToolSpecification) => T;
|
|
1454
|
+
_: (name: string, value: any) => T;
|
|
1455
|
+
}
|
|
1456
|
+
const visit: <T>(value: Tool, visitor: Visitor<T>) => T;
|
|
1179
1457
|
}
|
|
1180
1458
|
/**
|
|
1181
|
-
*
|
|
1182
|
-
*
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
readonly PROFANITY: "PROFANITY";
|
|
1186
|
-
};
|
|
1187
|
-
/**
|
|
1459
|
+
* <p>Configuration information for the tools that you pass to a model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html">Tool use (function calling)</a> in the Amazon Bedrock User Guide.</p>
|
|
1460
|
+
* <note>
|
|
1461
|
+
* <p>This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere Command R+, and Mistral Large models.</p>
|
|
1462
|
+
* </note>
|
|
1188
1463
|
* @public
|
|
1189
1464
|
*/
|
|
1190
|
-
export
|
|
1465
|
+
export interface ToolConfiguration {
|
|
1466
|
+
/**
|
|
1467
|
+
* <p>An array of tools that you want to pass to a model.</p>
|
|
1468
|
+
* @public
|
|
1469
|
+
*/
|
|
1470
|
+
tools: Tool[] | undefined;
|
|
1471
|
+
/**
|
|
1472
|
+
* <p>If supported by model, forces the model to request a tool.</p>
|
|
1473
|
+
* @public
|
|
1474
|
+
*/
|
|
1475
|
+
toolChoice?: ToolChoice;
|
|
1476
|
+
}
|
|
1191
1477
|
/**
|
|
1192
|
-
* <p>A managed word configured in a guardrail.</p>
|
|
1193
1478
|
* @public
|
|
1194
1479
|
*/
|
|
1195
|
-
export interface
|
|
1480
|
+
export interface ConverseRequest {
|
|
1196
1481
|
/**
|
|
1197
|
-
* <p>The
|
|
1482
|
+
* <p>The identifier for the model that you want to call.</p>
|
|
1483
|
+
* <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
|
|
1484
|
+
* <ul>
|
|
1485
|
+
* <li>
|
|
1486
|
+
* <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p>
|
|
1487
|
+
* </li>
|
|
1488
|
+
* <li>
|
|
1489
|
+
* <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p>
|
|
1490
|
+
* </li>
|
|
1491
|
+
* <li>
|
|
1492
|
+
* <p>If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p>
|
|
1493
|
+
* </li>
|
|
1494
|
+
* </ul>
|
|
1198
1495
|
* @public
|
|
1199
1496
|
*/
|
|
1200
|
-
|
|
1497
|
+
modelId: string | undefined;
|
|
1201
1498
|
/**
|
|
1202
|
-
* <p>The
|
|
1499
|
+
* <p>The messages that you want to send to the model.</p>
|
|
1203
1500
|
* @public
|
|
1204
1501
|
*/
|
|
1205
|
-
|
|
1502
|
+
messages: Message[] | undefined;
|
|
1206
1503
|
/**
|
|
1207
|
-
* <p>
|
|
1504
|
+
* <p>A system prompt to pass to the model.</p>
|
|
1208
1505
|
* @public
|
|
1209
1506
|
*/
|
|
1210
|
-
|
|
1211
|
-
}
|
|
1212
|
-
/**
|
|
1213
|
-
* <p>The word policy assessment.</p>
|
|
1214
|
-
* @public
|
|
1215
|
-
*/
|
|
1216
|
-
export interface GuardrailWordPolicyAssessment {
|
|
1507
|
+
system?: SystemContentBlock[];
|
|
1217
1508
|
/**
|
|
1218
|
-
* <p>
|
|
1509
|
+
* <p>Inference parameters to pass to the model. <code>Converse</code> supports a base
|
|
1510
|
+
* set of inference parameters. If you need to pass additional parameters that the model
|
|
1511
|
+
* supports, use the <code>additionalModelRequestFields</code> request field.</p>
|
|
1219
1512
|
* @public
|
|
1220
1513
|
*/
|
|
1221
|
-
|
|
1514
|
+
inferenceConfig?: InferenceConfiguration;
|
|
1222
1515
|
/**
|
|
1223
|
-
* <p>
|
|
1516
|
+
* <p>Configuration information for the tools that the model can use when generating a response. </p>
|
|
1517
|
+
* <note>
|
|
1518
|
+
* <p>This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere Command R+, and Mistral Large models.</p>
|
|
1519
|
+
* </note>
|
|
1224
1520
|
* @public
|
|
1225
1521
|
*/
|
|
1226
|
-
|
|
1522
|
+
toolConfig?: ToolConfiguration;
|
|
1523
|
+
/**
|
|
1524
|
+
* <p>Configuration information for a guardrail that you want to use in the request. </p>
|
|
1525
|
+
* @public
|
|
1526
|
+
*/
|
|
1527
|
+
guardrailConfig?: GuardrailConfiguration;
|
|
1528
|
+
/**
|
|
1529
|
+
* <p>Additional inference parameters that the model supports, beyond the
|
|
1530
|
+
* base set of inference parameters that <code>Converse</code> supports in the <code>inferenceConfig</code>
|
|
1531
|
+
* field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
|
|
1532
|
+
* @public
|
|
1533
|
+
*/
|
|
1534
|
+
additionalModelRequestFields?: __DocumentType;
|
|
1535
|
+
/**
|
|
1536
|
+
* <p>Additional model parameters field paths to return in the
|
|
1537
|
+
* response. <code>Converse</code> returns the requested fields as a JSON Pointer object in the
|
|
1538
|
+
* <code>additionalModelResponseFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
|
|
1539
|
+
* <p>
|
|
1540
|
+
* <code>[
|
|
1541
|
+
* "/stop_sequence"
|
|
1542
|
+
* ]</code>
|
|
1543
|
+
* </p>
|
|
1544
|
+
* <p>For information about the JSON Pointer syntax, see the
|
|
1545
|
+
* <a href="https://datatracker.ietf.org/doc/html/rfc6901">Internet Engineering Task Force (IETF)</a> documentation.</p>
|
|
1546
|
+
* <p>
|
|
1547
|
+
* <code>Converse</code> rejects an empty JSON Pointer or incorrectly structured
|
|
1548
|
+
* JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested
|
|
1549
|
+
* field is not in the model response, it is ignored by <code>Converse</code>.</p>
|
|
1550
|
+
* @public
|
|
1551
|
+
*/
|
|
1552
|
+
additionalModelResponseFieldPaths?: string[];
|
|
1227
1553
|
}
|
|
1228
1554
|
/**
|
|
1229
|
-
* <p>
|
|
1555
|
+
* <p>Metrics for a call to <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html">Converse</a>.</p>
|
|
1230
1556
|
* @public
|
|
1231
1557
|
*/
|
|
1232
|
-
export interface
|
|
1233
|
-
/**
|
|
1234
|
-
* <p>The topic policy.</p>
|
|
1235
|
-
* @public
|
|
1236
|
-
*/
|
|
1237
|
-
topicPolicy?: GuardrailTopicPolicyAssessment;
|
|
1558
|
+
export interface ConverseMetrics {
|
|
1238
1559
|
/**
|
|
1239
|
-
* <p>The
|
|
1560
|
+
* <p>The latency of the call to <code>Converse</code>, in milliseconds.
|
|
1561
|
+
* </p>
|
|
1240
1562
|
* @public
|
|
1241
1563
|
*/
|
|
1242
|
-
|
|
1564
|
+
latencyMs: number | undefined;
|
|
1565
|
+
}
|
|
1566
|
+
/**
|
|
1567
|
+
* <p>The output from a call to <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html">Converse</a>.</p>
|
|
1568
|
+
* @public
|
|
1569
|
+
*/
|
|
1570
|
+
export type ConverseOutput = ConverseOutput.MessageMember | ConverseOutput.$UnknownMember;
|
|
1571
|
+
/**
|
|
1572
|
+
* @public
|
|
1573
|
+
*/
|
|
1574
|
+
export declare namespace ConverseOutput {
|
|
1243
1575
|
/**
|
|
1244
|
-
* <p>The
|
|
1576
|
+
* <p>The message that the model generates.</p>
|
|
1245
1577
|
* @public
|
|
1246
1578
|
*/
|
|
1247
|
-
|
|
1579
|
+
interface MessageMember {
|
|
1580
|
+
message: Message;
|
|
1581
|
+
$unknown?: never;
|
|
1582
|
+
}
|
|
1248
1583
|
/**
|
|
1249
|
-
* <p>The sensitive information policy.</p>
|
|
1250
1584
|
* @public
|
|
1251
1585
|
*/
|
|
1252
|
-
|
|
1586
|
+
interface $UnknownMember {
|
|
1587
|
+
message?: never;
|
|
1588
|
+
$unknown: [string, any];
|
|
1589
|
+
}
|
|
1590
|
+
interface Visitor<T> {
|
|
1591
|
+
message: (value: Message) => T;
|
|
1592
|
+
_: (name: string, value: any) => T;
|
|
1593
|
+
}
|
|
1594
|
+
const visit: <T>(value: ConverseOutput, visitor: Visitor<T>) => T;
|
|
1253
1595
|
}
|
|
1596
|
+
/**
|
|
1597
|
+
* @public
|
|
1598
|
+
* @enum
|
|
1599
|
+
*/
|
|
1600
|
+
export declare const StopReason: {
|
|
1601
|
+
readonly CONTENT_FILTERED: "content_filtered";
|
|
1602
|
+
readonly END_TURN: "end_turn";
|
|
1603
|
+
readonly GUARDRAIL_INTERVENED: "guardrail_intervened";
|
|
1604
|
+
readonly MAX_TOKENS: "max_tokens";
|
|
1605
|
+
readonly STOP_SEQUENCE: "stop_sequence";
|
|
1606
|
+
readonly TOOL_USE: "tool_use";
|
|
1607
|
+
};
|
|
1608
|
+
/**
|
|
1609
|
+
* @public
|
|
1610
|
+
*/
|
|
1611
|
+
export type StopReason = (typeof StopReason)[keyof typeof StopReason];
|
|
1254
1612
|
/**
|
|
1255
1613
|
* <p>A Top level guardrail trace object. For more information, see <a>ConverseTrace</a>.</p>
|
|
1256
1614
|
* @public
|
|
@@ -1273,7 +1631,7 @@ export interface GuardrailTraceAssessment {
|
|
|
1273
1631
|
outputAssessments?: Record<string, GuardrailAssessment[]>;
|
|
1274
1632
|
}
|
|
1275
1633
|
/**
|
|
1276
|
-
* <p>The trace object in a response from <a>Converse</a>. Currently, you can only trace guardrails.</p>
|
|
1634
|
+
* <p>The trace object in a response from <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html">Converse</a>. Currently, you can only trace guardrails.</p>
|
|
1277
1635
|
* @public
|
|
1278
1636
|
*/
|
|
1279
1637
|
export interface ConverseTrace {
|
|
@@ -1340,18 +1698,6 @@ export interface ConverseResponse {
|
|
|
1340
1698
|
*/
|
|
1341
1699
|
trace?: ConverseTrace;
|
|
1342
1700
|
}
|
|
1343
|
-
/**
|
|
1344
|
-
* <p>An internal server error occurred. Retry your request.</p>
|
|
1345
|
-
* @public
|
|
1346
|
-
*/
|
|
1347
|
-
export declare class InternalServerException extends __BaseException {
|
|
1348
|
-
readonly name: "InternalServerException";
|
|
1349
|
-
readonly $fault: "server";
|
|
1350
|
-
/**
|
|
1351
|
-
* @internal
|
|
1352
|
-
*/
|
|
1353
|
-
constructor(opts: __ExceptionOptionType<InternalServerException, __BaseException>);
|
|
1354
|
-
}
|
|
1355
1701
|
/**
|
|
1356
1702
|
* <p>The request failed due to an error while processing the model.</p>
|
|
1357
1703
|
* @public
|
|
@@ -1398,42 +1744,6 @@ export declare class ModelTimeoutException extends __BaseException {
|
|
|
1398
1744
|
*/
|
|
1399
1745
|
constructor(opts: __ExceptionOptionType<ModelTimeoutException, __BaseException>);
|
|
1400
1746
|
}
|
|
1401
|
-
/**
|
|
1402
|
-
* <p>The specified resource ARN was not found. Check the ARN and try your request again.</p>
|
|
1403
|
-
* @public
|
|
1404
|
-
*/
|
|
1405
|
-
export declare class ResourceNotFoundException extends __BaseException {
|
|
1406
|
-
readonly name: "ResourceNotFoundException";
|
|
1407
|
-
readonly $fault: "client";
|
|
1408
|
-
/**
|
|
1409
|
-
* @internal
|
|
1410
|
-
*/
|
|
1411
|
-
constructor(opts: __ExceptionOptionType<ResourceNotFoundException, __BaseException>);
|
|
1412
|
-
}
|
|
1413
|
-
/**
|
|
1414
|
-
* <p>The number of requests exceeds the limit. Resubmit your request later.</p>
|
|
1415
|
-
* @public
|
|
1416
|
-
*/
|
|
1417
|
-
export declare class ThrottlingException extends __BaseException {
|
|
1418
|
-
readonly name: "ThrottlingException";
|
|
1419
|
-
readonly $fault: "client";
|
|
1420
|
-
/**
|
|
1421
|
-
* @internal
|
|
1422
|
-
*/
|
|
1423
|
-
constructor(opts: __ExceptionOptionType<ThrottlingException, __BaseException>);
|
|
1424
|
-
}
|
|
1425
|
-
/**
|
|
1426
|
-
* <p>Input validation failed. Check your request parameters and retry the request.</p>
|
|
1427
|
-
* @public
|
|
1428
|
-
*/
|
|
1429
|
-
export declare class ValidationException extends __BaseException {
|
|
1430
|
-
readonly name: "ValidationException";
|
|
1431
|
-
readonly $fault: "client";
|
|
1432
|
-
/**
|
|
1433
|
-
* @internal
|
|
1434
|
-
*/
|
|
1435
|
-
constructor(opts: __ExceptionOptionType<ValidationException, __BaseException>);
|
|
1436
|
-
}
|
|
1437
1747
|
/**
|
|
1438
1748
|
* @public
|
|
1439
1749
|
* @enum
|
|
@@ -1733,7 +2043,7 @@ export interface ConverseStreamMetrics {
|
|
|
1733
2043
|
latencyMs: number | undefined;
|
|
1734
2044
|
}
|
|
1735
2045
|
/**
|
|
1736
|
-
* <p>The trace object in a response from <a>ConverseStream</a>. Currently, you can only trace guardrails.</p>
|
|
2046
|
+
* <p>The trace object in a response from <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html">ConverseStream</a>. Currently, you can only trace guardrails.</p>
|
|
1737
2047
|
* @public
|
|
1738
2048
|
*/
|
|
1739
2049
|
export interface ConverseStreamTrace {
|
|
@@ -1759,7 +2069,7 @@ export interface ConverseStreamMetadataEvent {
|
|
|
1759
2069
|
*/
|
|
1760
2070
|
metrics: ConverseStreamMetrics | undefined;
|
|
1761
2071
|
/**
|
|
1762
|
-
* <p>The trace object in the response from <a>ConverseStream</a> that contains information about the guardrail behavior.</p>
|
|
2072
|
+
* <p>The trace object in the response from <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html">ConverseStream</a> that contains information about the guardrail behavior.</p>
|
|
1763
2073
|
* @public
|
|
1764
2074
|
*/
|
|
1765
2075
|
trace?: ConverseStreamTrace;
|
|
@@ -2099,18 +2409,6 @@ export interface InvokeModelResponse {
|
|
|
2099
2409
|
*/
|
|
2100
2410
|
contentType: string | undefined;
|
|
2101
2411
|
}
|
|
2102
|
-
/**
|
|
2103
|
-
* <p>The number of requests exceeds the service quota. Resubmit your request later.</p>
|
|
2104
|
-
* @public
|
|
2105
|
-
*/
|
|
2106
|
-
export declare class ServiceQuotaExceededException extends __BaseException {
|
|
2107
|
-
readonly name: "ServiceQuotaExceededException";
|
|
2108
|
-
readonly $fault: "client";
|
|
2109
|
-
/**
|
|
2110
|
-
* @internal
|
|
2111
|
-
*/
|
|
2112
|
-
constructor(opts: __ExceptionOptionType<ServiceQuotaExceededException, __BaseException>);
|
|
2113
|
-
}
|
|
2114
2412
|
/**
|
|
2115
2413
|
* @public
|
|
2116
2414
|
*/
|