@aws-sdk/client-bedrock-runtime 3.583.0 → 3.588.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 +23 -7
- package/dist-cjs/index.js +653 -31
- package/dist-es/BedrockRuntime.js +4 -0
- package/dist-es/commands/ConverseCommand.js +24 -0
- package/dist-es/commands/ConverseStreamCommand.js +29 -0
- package/dist-es/commands/index.js +2 -0
- package/dist-es/models/models_0.js +187 -16
- package/dist-es/protocols/Aws_restJson1.js +381 -6
- package/dist-types/BedrockRuntime.d.ts +14 -0
- package/dist-types/BedrockRuntimeClient.d.ts +4 -2
- package/dist-types/commands/ConverseCommand.d.ts +208 -0
- package/dist-types/commands/ConverseStreamCommand.d.ts +221 -0
- package/dist-types/commands/index.d.ts +2 -0
- package/dist-types/models/models_0.d.ts +1413 -108
- package/dist-types/protocols/Aws_restJson1.d.ts +18 -0
- package/dist-types/ts3.4/BedrockRuntime.d.ts +34 -0
- package/dist-types/ts3.4/BedrockRuntimeClient.d.ts +12 -0
- package/dist-types/ts3.4/commands/ConverseCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/ConverseStreamCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/index.d.ts +2 -0
- package/dist-types/ts3.4/models/models_0.d.ts +602 -33
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +24 -0
- package/package.json +18 -18
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client";
|
|
2
|
+
import { DocumentType as __DocumentType } from "@smithy/types";
|
|
2
3
|
import { BedrockRuntimeServiceException as __BaseException } from "./BedrockRuntimeServiceException";
|
|
3
4
|
/**
|
|
4
5
|
* <p>The request is denied because of missing access permissions.</p>
|
|
@@ -12,17 +13,1417 @@ export declare class AccessDeniedException extends __BaseException {
|
|
|
12
13
|
*/
|
|
13
14
|
constructor(opts: __ExceptionOptionType<AccessDeniedException, __BaseException>);
|
|
14
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* <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,
|
|
18
|
+
* see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundation models</a>.</p>
|
|
19
|
+
* <p>If you need to pass additional parameters that the model
|
|
20
|
+
* supports, use the <code>additionalModelRequestFields</code> request field in the call to <code>Converse</code>
|
|
21
|
+
* or <code>ConverseStream</code>.
|
|
22
|
+
* For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
export interface InferenceConfiguration {
|
|
26
|
+
/**
|
|
27
|
+
* <p>The maximum number of tokens to allow in the generated response. The default value is
|
|
28
|
+
* the maximum allowed value for the model that you are using. For more information, see
|
|
29
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundatio\{
|
|
30
|
+
* "messages": [
|
|
31
|
+
* \{
|
|
32
|
+
* "role": "user",
|
|
33
|
+
* "content": [
|
|
34
|
+
* \{
|
|
35
|
+
* "text": "what's the weather in Queens, NY and Austin, TX?"
|
|
36
|
+
* \}
|
|
37
|
+
* ]
|
|
38
|
+
* \},
|
|
39
|
+
* \{
|
|
40
|
+
* "role": "assistant",
|
|
41
|
+
* "content": [
|
|
42
|
+
* \{
|
|
43
|
+
* "toolUse": \{
|
|
44
|
+
* "toolUseId": "1",
|
|
45
|
+
* "name": "get_weather",
|
|
46
|
+
* "input": \{
|
|
47
|
+
* "city": "Queens",
|
|
48
|
+
* "state": "NY"
|
|
49
|
+
* \}
|
|
50
|
+
* \}
|
|
51
|
+
* \},
|
|
52
|
+
* \{
|
|
53
|
+
* "toolUse": \{
|
|
54
|
+
* "toolUseId": "2",
|
|
55
|
+
* "name": "get_weather",
|
|
56
|
+
* "input": \{
|
|
57
|
+
* "city": "Austin",
|
|
58
|
+
* "state": "TX"
|
|
59
|
+
* \}
|
|
60
|
+
* \}
|
|
61
|
+
* \}
|
|
62
|
+
* ]
|
|
63
|
+
* \},
|
|
64
|
+
* \{
|
|
65
|
+
* "role": "user",
|
|
66
|
+
* "content": [
|
|
67
|
+
* \{
|
|
68
|
+
* "toolResult": \{
|
|
69
|
+
* "toolUseId": "2",
|
|
70
|
+
* "content": [
|
|
71
|
+
* \{
|
|
72
|
+
* "json": \{
|
|
73
|
+
* "weather": "40"
|
|
74
|
+
* \}
|
|
75
|
+
* \}
|
|
76
|
+
* ]
|
|
77
|
+
* \}
|
|
78
|
+
* \},
|
|
79
|
+
* \{
|
|
80
|
+
* "text": "..."
|
|
81
|
+
* \},
|
|
82
|
+
* \{
|
|
83
|
+
* "toolResult": \{
|
|
84
|
+
* "toolUseId": "1",
|
|
85
|
+
* "content": [
|
|
86
|
+
* \{
|
|
87
|
+
* "text": "result text"
|
|
88
|
+
* \}
|
|
89
|
+
* ]
|
|
90
|
+
* \}
|
|
91
|
+
* \}
|
|
92
|
+
* ]
|
|
93
|
+
* \}
|
|
94
|
+
* ],
|
|
95
|
+
* "toolConfig": \{
|
|
96
|
+
* "tools": [
|
|
97
|
+
* \{
|
|
98
|
+
* "name": "get_weather",
|
|
99
|
+
* "description": "Get weather",
|
|
100
|
+
* "inputSchema": \{
|
|
101
|
+
* "type": "object",
|
|
102
|
+
* "properties": \{
|
|
103
|
+
* "city": \{
|
|
104
|
+
* "type": "string",
|
|
105
|
+
* "description": "City of location"
|
|
106
|
+
* \},
|
|
107
|
+
* "state": \{
|
|
108
|
+
* "type": "string",
|
|
109
|
+
* "description": "State of location"
|
|
110
|
+
* \}
|
|
111
|
+
* \},
|
|
112
|
+
* "required": ["city", "state"]
|
|
113
|
+
* \}
|
|
114
|
+
* \}
|
|
115
|
+
* ]
|
|
116
|
+
* \}
|
|
117
|
+
* \}
|
|
118
|
+
* n models</a>. </p>
|
|
119
|
+
* @public
|
|
120
|
+
*/
|
|
121
|
+
maxTokens?: number;
|
|
122
|
+
/**
|
|
123
|
+
* <p>The likelihood of the model selecting higher-probability options while generating a
|
|
124
|
+
* response. A lower value makes the model more likely to choose higher-probability options,
|
|
125
|
+
* while a higher value makes the model more likely to choose lower-probability
|
|
126
|
+
* options.</p>
|
|
127
|
+
* <p>The default value is the default value for the model that
|
|
128
|
+
* you are using. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundation
|
|
129
|
+
* models</a>. </p>
|
|
130
|
+
* @public
|
|
131
|
+
*/
|
|
132
|
+
temperature?: number;
|
|
133
|
+
/**
|
|
134
|
+
* <p>The percentage of most-likely candidates that the model considers for the next token. For
|
|
135
|
+
* example, if you choose a value of 0.8 for <code>topP</code>, the model selects from the top 80% of the
|
|
136
|
+
* probability distribution of tokens that could be next in the sequence.</p>
|
|
137
|
+
* <p>The default value is the default value for the model that you are using. For more information, see
|
|
138
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundation models</a>. </p>
|
|
139
|
+
* @public
|
|
140
|
+
*/
|
|
141
|
+
topP?: number;
|
|
142
|
+
/**
|
|
143
|
+
* <p>A list of stop sequences. A stop sequence is a sequence of characters that causes the
|
|
144
|
+
* model to stop generating the response. </p>
|
|
145
|
+
* @public
|
|
146
|
+
*/
|
|
147
|
+
stopSequences?: string[];
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* @public
|
|
151
|
+
* @enum
|
|
152
|
+
*/
|
|
153
|
+
export declare const ImageFormat: {
|
|
154
|
+
readonly GIF: "gif";
|
|
155
|
+
readonly JPEG: "jpeg";
|
|
156
|
+
readonly PNG: "png";
|
|
157
|
+
readonly WEBP: "webp";
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* @public
|
|
161
|
+
*/
|
|
162
|
+
export type ImageFormat = (typeof ImageFormat)[keyof typeof ImageFormat];
|
|
163
|
+
/**
|
|
164
|
+
* <p>The source for an image.</p>
|
|
165
|
+
* @public
|
|
166
|
+
*/
|
|
167
|
+
export type ImageSource = ImageSource.BytesMember | ImageSource.$UnknownMember;
|
|
168
|
+
/**
|
|
169
|
+
* @public
|
|
170
|
+
*/
|
|
171
|
+
export declare namespace ImageSource {
|
|
172
|
+
/**
|
|
173
|
+
* <p>The raw image bytes for the image. If you use an AWS SDK, you don't need to base64 encode the image bytes.</p>
|
|
174
|
+
* @public
|
|
175
|
+
*/
|
|
176
|
+
interface BytesMember {
|
|
177
|
+
bytes: Uint8Array;
|
|
178
|
+
$unknown?: never;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* @public
|
|
182
|
+
*/
|
|
183
|
+
interface $UnknownMember {
|
|
184
|
+
bytes?: never;
|
|
185
|
+
$unknown: [string, any];
|
|
186
|
+
}
|
|
187
|
+
interface Visitor<T> {
|
|
188
|
+
bytes: (value: Uint8Array) => T;
|
|
189
|
+
_: (name: string, value: any) => T;
|
|
190
|
+
}
|
|
191
|
+
const visit: <T>(value: ImageSource, visitor: Visitor<T>) => T;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* <p>Image content for a message.</p>
|
|
195
|
+
* @public
|
|
196
|
+
*/
|
|
197
|
+
export interface ImageBlock {
|
|
198
|
+
/**
|
|
199
|
+
* <p>The format of the image.</p>
|
|
200
|
+
* @public
|
|
201
|
+
*/
|
|
202
|
+
format: ImageFormat | undefined;
|
|
203
|
+
/**
|
|
204
|
+
* <p>The source for the image.</p>
|
|
205
|
+
* @public
|
|
206
|
+
*/
|
|
207
|
+
source: ImageSource | undefined;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* <p>The tool result content block.</p>
|
|
211
|
+
* @public
|
|
212
|
+
*/
|
|
213
|
+
export type ToolResultContentBlock = ToolResultContentBlock.ImageMember | ToolResultContentBlock.JsonMember | ToolResultContentBlock.TextMember | ToolResultContentBlock.$UnknownMember;
|
|
214
|
+
/**
|
|
215
|
+
* @public
|
|
216
|
+
*/
|
|
217
|
+
export declare namespace ToolResultContentBlock {
|
|
218
|
+
/**
|
|
219
|
+
* <p>A tool result that is JSON format data.</p>
|
|
220
|
+
* @public
|
|
221
|
+
*/
|
|
222
|
+
interface JsonMember {
|
|
223
|
+
json: __DocumentType;
|
|
224
|
+
text?: never;
|
|
225
|
+
image?: never;
|
|
226
|
+
$unknown?: never;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* <p>A tool result that is text.</p>
|
|
230
|
+
* @public
|
|
231
|
+
*/
|
|
232
|
+
interface TextMember {
|
|
233
|
+
json?: never;
|
|
234
|
+
text: string;
|
|
235
|
+
image?: never;
|
|
236
|
+
$unknown?: never;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* <p>A tool result that is an image.</p>
|
|
240
|
+
* <note>
|
|
241
|
+
* <p>This field is only supported by Anthropic Claude 3 models.</p>
|
|
242
|
+
* </note>
|
|
243
|
+
* @public
|
|
244
|
+
*/
|
|
245
|
+
interface ImageMember {
|
|
246
|
+
json?: never;
|
|
247
|
+
text?: never;
|
|
248
|
+
image: ImageBlock;
|
|
249
|
+
$unknown?: never;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* @public
|
|
253
|
+
*/
|
|
254
|
+
interface $UnknownMember {
|
|
255
|
+
json?: never;
|
|
256
|
+
text?: never;
|
|
257
|
+
image?: never;
|
|
258
|
+
$unknown: [string, any];
|
|
259
|
+
}
|
|
260
|
+
interface Visitor<T> {
|
|
261
|
+
json: (value: __DocumentType) => T;
|
|
262
|
+
text: (value: string) => T;
|
|
263
|
+
image: (value: ImageBlock) => T;
|
|
264
|
+
_: (name: string, value: any) => T;
|
|
265
|
+
}
|
|
266
|
+
const visit: <T>(value: ToolResultContentBlock, visitor: Visitor<T>) => T;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* @public
|
|
270
|
+
* @enum
|
|
271
|
+
*/
|
|
272
|
+
export declare const ToolResultStatus: {
|
|
273
|
+
readonly ERROR: "error";
|
|
274
|
+
readonly SUCCESS: "success";
|
|
275
|
+
};
|
|
276
|
+
/**
|
|
277
|
+
* @public
|
|
278
|
+
*/
|
|
279
|
+
export type ToolResultStatus = (typeof ToolResultStatus)[keyof typeof ToolResultStatus];
|
|
280
|
+
/**
|
|
281
|
+
* <p>A tool result block that contains the results for a tool request that
|
|
282
|
+
* the model previously made.</p>
|
|
283
|
+
* @public
|
|
284
|
+
*/
|
|
285
|
+
export interface ToolResultBlock {
|
|
286
|
+
/**
|
|
287
|
+
* <p>The ID of the tool request that this is the result for.</p>
|
|
288
|
+
* @public
|
|
289
|
+
*/
|
|
290
|
+
toolUseId: string | undefined;
|
|
291
|
+
/**
|
|
292
|
+
* <p>The content for tool result content block.</p>
|
|
293
|
+
* @public
|
|
294
|
+
*/
|
|
295
|
+
content: ToolResultContentBlock[] | undefined;
|
|
296
|
+
/**
|
|
297
|
+
* <p>The status for the tool result content block.</p>
|
|
298
|
+
* <note>
|
|
299
|
+
* <p>This field is only supported Anthropic Claude 3 models.</p>
|
|
300
|
+
* </note>
|
|
301
|
+
* @public
|
|
302
|
+
*/
|
|
303
|
+
status?: ToolResultStatus;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* <p>A tool use content block. Contains information about a tool that the model
|
|
307
|
+
* is requesting be run., The model uses the result from the tool to generate a response. </p>
|
|
308
|
+
* @public
|
|
309
|
+
*/
|
|
310
|
+
export interface ToolUseBlock {
|
|
311
|
+
/**
|
|
312
|
+
* <p>The ID for the tool request.</p>
|
|
313
|
+
* @public
|
|
314
|
+
*/
|
|
315
|
+
toolUseId: string | undefined;
|
|
316
|
+
/**
|
|
317
|
+
* <p>The name of the tool that the model wants to use.</p>
|
|
318
|
+
* @public
|
|
319
|
+
*/
|
|
320
|
+
name: string | undefined;
|
|
321
|
+
/**
|
|
322
|
+
* <p>The input to pass to the tool. </p>
|
|
323
|
+
* @public
|
|
324
|
+
*/
|
|
325
|
+
input: __DocumentType | undefined;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* <p>A block of content for a message.</p>
|
|
329
|
+
* @public
|
|
330
|
+
*/
|
|
331
|
+
export type ContentBlock = ContentBlock.ImageMember | ContentBlock.TextMember | ContentBlock.ToolResultMember | ContentBlock.ToolUseMember | ContentBlock.$UnknownMember;
|
|
332
|
+
/**
|
|
333
|
+
* @public
|
|
334
|
+
*/
|
|
335
|
+
export declare namespace ContentBlock {
|
|
336
|
+
/**
|
|
337
|
+
* <p>Text to include in the message.</p>
|
|
338
|
+
* @public
|
|
339
|
+
*/
|
|
340
|
+
interface TextMember {
|
|
341
|
+
text: string;
|
|
342
|
+
image?: never;
|
|
343
|
+
toolUse?: never;
|
|
344
|
+
toolResult?: never;
|
|
345
|
+
$unknown?: never;
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* <p>Image to include in the message. </p>
|
|
349
|
+
* <note>
|
|
350
|
+
* <p>This field is only supported by Anthropic Claude 3 models.</p>
|
|
351
|
+
* </note>
|
|
352
|
+
* @public
|
|
353
|
+
*/
|
|
354
|
+
interface ImageMember {
|
|
355
|
+
text?: never;
|
|
356
|
+
image: ImageBlock;
|
|
357
|
+
toolUse?: never;
|
|
358
|
+
toolResult?: never;
|
|
359
|
+
$unknown?: never;
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* <p>Information about a tool use request from a model. </p>
|
|
363
|
+
* @public
|
|
364
|
+
*/
|
|
365
|
+
interface ToolUseMember {
|
|
366
|
+
text?: never;
|
|
367
|
+
image?: never;
|
|
368
|
+
toolUse: ToolUseBlock;
|
|
369
|
+
toolResult?: never;
|
|
370
|
+
$unknown?: never;
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* <p>The result for a tool request that a model makes.</p>
|
|
374
|
+
* @public
|
|
375
|
+
*/
|
|
376
|
+
interface ToolResultMember {
|
|
377
|
+
text?: never;
|
|
378
|
+
image?: never;
|
|
379
|
+
toolUse?: never;
|
|
380
|
+
toolResult: ToolResultBlock;
|
|
381
|
+
$unknown?: never;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* @public
|
|
385
|
+
*/
|
|
386
|
+
interface $UnknownMember {
|
|
387
|
+
text?: never;
|
|
388
|
+
image?: never;
|
|
389
|
+
toolUse?: never;
|
|
390
|
+
toolResult?: never;
|
|
391
|
+
$unknown: [string, any];
|
|
392
|
+
}
|
|
393
|
+
interface Visitor<T> {
|
|
394
|
+
text: (value: string) => T;
|
|
395
|
+
image: (value: ImageBlock) => T;
|
|
396
|
+
toolUse: (value: ToolUseBlock) => T;
|
|
397
|
+
toolResult: (value: ToolResultBlock) => T;
|
|
398
|
+
_: (name: string, value: any) => T;
|
|
399
|
+
}
|
|
400
|
+
const visit: <T>(value: ContentBlock, visitor: Visitor<T>) => T;
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* @public
|
|
404
|
+
* @enum
|
|
405
|
+
*/
|
|
406
|
+
export declare const ConversationRole: {
|
|
407
|
+
readonly ASSISTANT: "assistant";
|
|
408
|
+
readonly USER: "user";
|
|
409
|
+
};
|
|
410
|
+
/**
|
|
411
|
+
* @public
|
|
412
|
+
*/
|
|
413
|
+
export type ConversationRole = (typeof ConversationRole)[keyof typeof ConversationRole];
|
|
414
|
+
/**
|
|
415
|
+
* <p>A message in the <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Message.html">Message</a> field. Use to send a message in a call to
|
|
416
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html">Converse</a>. </p>
|
|
417
|
+
* @public
|
|
418
|
+
*/
|
|
419
|
+
export interface Message {
|
|
420
|
+
/**
|
|
421
|
+
* <p>The role that the message plays in the message.</p>
|
|
422
|
+
* @public
|
|
423
|
+
*/
|
|
424
|
+
role: ConversationRole | undefined;
|
|
425
|
+
/**
|
|
426
|
+
* <p>The message content.</p>
|
|
427
|
+
* @public
|
|
428
|
+
*/
|
|
429
|
+
content: ContentBlock[] | undefined;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* <p>A system content block</p>
|
|
433
|
+
* @public
|
|
434
|
+
*/
|
|
435
|
+
export type SystemContentBlock = SystemContentBlock.TextMember | SystemContentBlock.$UnknownMember;
|
|
436
|
+
/**
|
|
437
|
+
* @public
|
|
438
|
+
*/
|
|
439
|
+
export declare namespace SystemContentBlock {
|
|
440
|
+
/**
|
|
441
|
+
* <p>A system prompt for the model. </p>
|
|
442
|
+
* @public
|
|
443
|
+
*/
|
|
444
|
+
interface TextMember {
|
|
445
|
+
text: string;
|
|
446
|
+
$unknown?: never;
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* @public
|
|
450
|
+
*/
|
|
451
|
+
interface $UnknownMember {
|
|
452
|
+
text?: never;
|
|
453
|
+
$unknown: [string, any];
|
|
454
|
+
}
|
|
455
|
+
interface Visitor<T> {
|
|
456
|
+
text: (value: string) => T;
|
|
457
|
+
_: (name: string, value: any) => T;
|
|
458
|
+
}
|
|
459
|
+
const visit: <T>(value: SystemContentBlock, visitor: Visitor<T>) => T;
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* <p>The model must request at least one tool (no text is generated).</p>
|
|
463
|
+
* @public
|
|
464
|
+
*/
|
|
465
|
+
export interface AnyToolChoice {
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* <p>The Model automatically decides if a tool should be called or to whether to generate text instead.</p>
|
|
469
|
+
* @public
|
|
470
|
+
*/
|
|
471
|
+
export interface AutoToolChoice {
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* <p>The model must request a specific tool.</p>
|
|
475
|
+
* <note>
|
|
476
|
+
* <p>This field is only supported by Anthropic Claude 3 models.</p>
|
|
477
|
+
* </note>
|
|
478
|
+
* @public
|
|
479
|
+
*/
|
|
480
|
+
export interface SpecificToolChoice {
|
|
481
|
+
/**
|
|
482
|
+
* <p>The name of the tool that the model must request. </p>
|
|
483
|
+
* @public
|
|
484
|
+
*/
|
|
485
|
+
name: string | undefined;
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* <p>Forces a model to use a tool.</p>
|
|
489
|
+
* @public
|
|
490
|
+
*/
|
|
491
|
+
export type ToolChoice = ToolChoice.AnyMember | ToolChoice.AutoMember | ToolChoice.ToolMember | ToolChoice.$UnknownMember;
|
|
492
|
+
/**
|
|
493
|
+
* @public
|
|
494
|
+
*/
|
|
495
|
+
export declare namespace ToolChoice {
|
|
496
|
+
/**
|
|
497
|
+
* <p>The Model automatically decides if a tool should be called or to whether to generate text instead.</p>
|
|
498
|
+
* @public
|
|
499
|
+
*/
|
|
500
|
+
interface AutoMember {
|
|
501
|
+
auto: AutoToolChoice;
|
|
502
|
+
any?: never;
|
|
503
|
+
tool?: never;
|
|
504
|
+
$unknown?: never;
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* <p>The model must request at least one tool (no text is generated).</p>
|
|
508
|
+
* @public
|
|
509
|
+
*/
|
|
510
|
+
interface AnyMember {
|
|
511
|
+
auto?: never;
|
|
512
|
+
any: AnyToolChoice;
|
|
513
|
+
tool?: never;
|
|
514
|
+
$unknown?: never;
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* <p>The Model must request the specified tool.</p>
|
|
518
|
+
* @public
|
|
519
|
+
*/
|
|
520
|
+
interface ToolMember {
|
|
521
|
+
auto?: never;
|
|
522
|
+
any?: never;
|
|
523
|
+
tool: SpecificToolChoice;
|
|
524
|
+
$unknown?: never;
|
|
525
|
+
}
|
|
526
|
+
/**
|
|
527
|
+
* @public
|
|
528
|
+
*/
|
|
529
|
+
interface $UnknownMember {
|
|
530
|
+
auto?: never;
|
|
531
|
+
any?: never;
|
|
532
|
+
tool?: never;
|
|
533
|
+
$unknown: [string, any];
|
|
534
|
+
}
|
|
535
|
+
interface Visitor<T> {
|
|
536
|
+
auto: (value: AutoToolChoice) => T;
|
|
537
|
+
any: (value: AnyToolChoice) => T;
|
|
538
|
+
tool: (value: SpecificToolChoice) => T;
|
|
539
|
+
_: (name: string, value: any) => T;
|
|
540
|
+
}
|
|
541
|
+
const visit: <T>(value: ToolChoice, visitor: Visitor<T>) => T;
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* <p>The schema for the tool. The top level schema type must be <code>object</code>. </p>
|
|
545
|
+
* @public
|
|
546
|
+
*/
|
|
547
|
+
export type ToolInputSchema = ToolInputSchema.JsonMember | ToolInputSchema.$UnknownMember;
|
|
548
|
+
/**
|
|
549
|
+
* @public
|
|
550
|
+
*/
|
|
551
|
+
export declare namespace ToolInputSchema {
|
|
552
|
+
/**
|
|
553
|
+
* <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>
|
|
554
|
+
* @public
|
|
555
|
+
*/
|
|
556
|
+
interface JsonMember {
|
|
557
|
+
json: __DocumentType;
|
|
558
|
+
$unknown?: never;
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* @public
|
|
562
|
+
*/
|
|
563
|
+
interface $UnknownMember {
|
|
564
|
+
json?: never;
|
|
565
|
+
$unknown: [string, any];
|
|
566
|
+
}
|
|
567
|
+
interface Visitor<T> {
|
|
568
|
+
json: (value: __DocumentType) => T;
|
|
569
|
+
_: (name: string, value: any) => T;
|
|
570
|
+
}
|
|
571
|
+
const visit: <T>(value: ToolInputSchema, visitor: Visitor<T>) => T;
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* <p>The specification for the tool.</p>
|
|
575
|
+
* @public
|
|
576
|
+
*/
|
|
577
|
+
export interface ToolSpecification {
|
|
578
|
+
/**
|
|
579
|
+
* <p>The name for the tool.</p>
|
|
580
|
+
* @public
|
|
581
|
+
*/
|
|
582
|
+
name: string | undefined;
|
|
583
|
+
/**
|
|
584
|
+
* <p>The description for the tool.</p>
|
|
585
|
+
* @public
|
|
586
|
+
*/
|
|
587
|
+
description?: string;
|
|
588
|
+
/**
|
|
589
|
+
* <p>The input schema for the tool in JSON format.</p>
|
|
590
|
+
* @public
|
|
591
|
+
*/
|
|
592
|
+
inputSchema: ToolInputSchema | undefined;
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* <p>Information about a tool that you can use with the Converse API. </p>
|
|
596
|
+
* @public
|
|
597
|
+
*/
|
|
598
|
+
export type Tool = Tool.ToolSpecMember | Tool.$UnknownMember;
|
|
599
|
+
/**
|
|
600
|
+
* @public
|
|
601
|
+
*/
|
|
602
|
+
export declare namespace Tool {
|
|
603
|
+
/**
|
|
604
|
+
* <p>The specfication for the tool.</p>
|
|
605
|
+
* @public
|
|
606
|
+
*/
|
|
607
|
+
interface ToolSpecMember {
|
|
608
|
+
toolSpec: ToolSpecification;
|
|
609
|
+
$unknown?: never;
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* @public
|
|
613
|
+
*/
|
|
614
|
+
interface $UnknownMember {
|
|
615
|
+
toolSpec?: never;
|
|
616
|
+
$unknown: [string, any];
|
|
617
|
+
}
|
|
618
|
+
interface Visitor<T> {
|
|
619
|
+
toolSpec: (value: ToolSpecification) => T;
|
|
620
|
+
_: (name: string, value: any) => T;
|
|
621
|
+
}
|
|
622
|
+
const visit: <T>(value: Tool, visitor: Visitor<T>) => T;
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* <p>Configuration information for the tools that you pass to a model.</p>
|
|
626
|
+
* <note>
|
|
627
|
+
* <p>This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere Command R+, and Mistral Large models.</p>
|
|
628
|
+
* </note>
|
|
629
|
+
* @public
|
|
630
|
+
*/
|
|
631
|
+
export interface ToolConfiguration {
|
|
632
|
+
/**
|
|
633
|
+
* <p>An array of tools that you want to pass to a model.</p>
|
|
634
|
+
* @public
|
|
635
|
+
*/
|
|
636
|
+
tools: Tool[] | undefined;
|
|
637
|
+
/**
|
|
638
|
+
* <p>If supported by model, forces the model to request a tool.</p>
|
|
639
|
+
* @public
|
|
640
|
+
*/
|
|
641
|
+
toolChoice?: ToolChoice;
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* @public
|
|
645
|
+
*/
|
|
646
|
+
export interface ConverseRequest {
|
|
647
|
+
/**
|
|
648
|
+
* <p>The identifier for the model that you want to call.</p>
|
|
649
|
+
* <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
|
|
650
|
+
* <ul>
|
|
651
|
+
* <li>
|
|
652
|
+
* <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>
|
|
653
|
+
* </li>
|
|
654
|
+
* <li>
|
|
655
|
+
* <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>
|
|
656
|
+
* </li>
|
|
657
|
+
* <li>
|
|
658
|
+
* <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>
|
|
659
|
+
* </li>
|
|
660
|
+
* </ul>
|
|
661
|
+
* @public
|
|
662
|
+
*/
|
|
663
|
+
modelId: string | undefined;
|
|
664
|
+
/**
|
|
665
|
+
* <p>The messages that you want to send to the model.</p>
|
|
666
|
+
* @public
|
|
667
|
+
*/
|
|
668
|
+
messages: Message[] | undefined;
|
|
669
|
+
/**
|
|
670
|
+
* <p>A system prompt to pass to the model.</p>
|
|
671
|
+
* @public
|
|
672
|
+
*/
|
|
673
|
+
system?: SystemContentBlock[];
|
|
674
|
+
/**
|
|
675
|
+
* <p>Inference parameters to pass to the model. <code>Converse</code> supports a base
|
|
676
|
+
* set of inference parameters. If you need to pass additional parameters that the model
|
|
677
|
+
* supports, use the <code>additionalModelRequestFields</code> request field.</p>
|
|
678
|
+
* @public
|
|
679
|
+
*/
|
|
680
|
+
inferenceConfig?: InferenceConfiguration;
|
|
681
|
+
/**
|
|
682
|
+
* <p>Configuration information for the tools that the model can use when generating a response. </p>
|
|
683
|
+
* <note>
|
|
684
|
+
* <p>This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere Command R+, and Mistral Large models.</p>
|
|
685
|
+
* </note>
|
|
686
|
+
* @public
|
|
687
|
+
*/
|
|
688
|
+
toolConfig?: ToolConfiguration;
|
|
689
|
+
/**
|
|
690
|
+
* <p>Additional inference parameters that the model supports, beyond the
|
|
691
|
+
* base set of inference parameters that <code>Converse</code> supports in the <code>inferenceConfig</code>
|
|
692
|
+
* field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Model parameters</a>.</p>
|
|
693
|
+
* @public
|
|
694
|
+
*/
|
|
695
|
+
additionalModelRequestFields?: __DocumentType;
|
|
696
|
+
/**
|
|
697
|
+
* <p>Additional model parameters field paths to return in the
|
|
698
|
+
* response. <code>Converse</code> returns the requested fields as a JSON Pointer object in the
|
|
699
|
+
* <code>additionalModelResultFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
|
|
700
|
+
* <p>
|
|
701
|
+
* <code>[
|
|
702
|
+
* "/stop_sequence"
|
|
703
|
+
* ]</code>
|
|
704
|
+
* </p>
|
|
705
|
+
* <p>For information about the JSON Pointer syntax, see the
|
|
706
|
+
* <a href="https://datatracker.ietf.org/doc/html/rfc6901">Internet Engineering Task Force (IETF)</a> documentation.</p>
|
|
707
|
+
* <p>
|
|
708
|
+
* <code>Converse</code> rejects an empty JSON Pointer or incorrectly structured
|
|
709
|
+
* JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested
|
|
710
|
+
* field is not in the model response, it is ignored by <code>Converse</code>.</p>
|
|
711
|
+
* @public
|
|
712
|
+
*/
|
|
713
|
+
additionalModelResponseFieldPaths?: string[];
|
|
714
|
+
}
|
|
715
|
+
/**
|
|
716
|
+
* <p>Metrics for a call to <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html">Converse</a>.</p>
|
|
717
|
+
* @public
|
|
718
|
+
*/
|
|
719
|
+
export interface ConverseMetrics {
|
|
720
|
+
/**
|
|
721
|
+
* <p>The latency of the call to <code>Converse</code>, in milliseconds.
|
|
722
|
+
* </p>
|
|
723
|
+
* @public
|
|
724
|
+
*/
|
|
725
|
+
latencyMs: number | undefined;
|
|
726
|
+
}
|
|
727
|
+
/**
|
|
728
|
+
* <p>The output from a call to <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html">Converse</a>.</p>
|
|
729
|
+
* @public
|
|
730
|
+
*/
|
|
731
|
+
export type ConverseOutput = ConverseOutput.MessageMember | ConverseOutput.$UnknownMember;
|
|
732
|
+
/**
|
|
733
|
+
* @public
|
|
734
|
+
*/
|
|
735
|
+
export declare namespace ConverseOutput {
|
|
736
|
+
/**
|
|
737
|
+
* <p>The message that the model generates.</p>
|
|
738
|
+
* @public
|
|
739
|
+
*/
|
|
740
|
+
interface MessageMember {
|
|
741
|
+
message: Message;
|
|
742
|
+
$unknown?: never;
|
|
743
|
+
}
|
|
744
|
+
/**
|
|
745
|
+
* @public
|
|
746
|
+
*/
|
|
747
|
+
interface $UnknownMember {
|
|
748
|
+
message?: never;
|
|
749
|
+
$unknown: [string, any];
|
|
750
|
+
}
|
|
751
|
+
interface Visitor<T> {
|
|
752
|
+
message: (value: Message) => T;
|
|
753
|
+
_: (name: string, value: any) => T;
|
|
754
|
+
}
|
|
755
|
+
const visit: <T>(value: ConverseOutput, visitor: Visitor<T>) => T;
|
|
756
|
+
}
|
|
757
|
+
/**
|
|
758
|
+
* @public
|
|
759
|
+
* @enum
|
|
760
|
+
*/
|
|
761
|
+
export declare const StopReason: {
|
|
762
|
+
readonly CONTENT_FILTERED: "content_filtered";
|
|
763
|
+
readonly END_TURN: "end_turn";
|
|
764
|
+
readonly MAX_TOKENS: "max_tokens";
|
|
765
|
+
readonly STOP_SEQUENCE: "stop_sequence";
|
|
766
|
+
readonly TOOL_USE: "tool_use";
|
|
767
|
+
};
|
|
768
|
+
/**
|
|
769
|
+
* @public
|
|
770
|
+
*/
|
|
771
|
+
export type StopReason = (typeof StopReason)[keyof typeof StopReason];
|
|
772
|
+
/**
|
|
773
|
+
* <p>The tokens used in a message API inference call. </p>
|
|
774
|
+
* @public
|
|
775
|
+
*/
|
|
776
|
+
export interface TokenUsage {
|
|
777
|
+
/**
|
|
778
|
+
* <p>The number of tokens sent in the request to the model.</p>
|
|
779
|
+
* @public
|
|
780
|
+
*/
|
|
781
|
+
inputTokens: number | undefined;
|
|
782
|
+
/**
|
|
783
|
+
* <p>The number of tokens that the model generated for the request.</p>
|
|
784
|
+
* @public
|
|
785
|
+
*/
|
|
786
|
+
outputTokens: number | undefined;
|
|
787
|
+
/**
|
|
788
|
+
* <p>The total of input tokens and tokens generated by the model.</p>
|
|
789
|
+
* @public
|
|
790
|
+
*/
|
|
791
|
+
totalTokens: number | undefined;
|
|
792
|
+
}
|
|
793
|
+
/**
|
|
794
|
+
* @public
|
|
795
|
+
*/
|
|
796
|
+
export interface ConverseResponse {
|
|
797
|
+
/**
|
|
798
|
+
* <p>The result from the call to <code>Converse</code>.</p>
|
|
799
|
+
* @public
|
|
800
|
+
*/
|
|
801
|
+
output: ConverseOutput | undefined;
|
|
802
|
+
/**
|
|
803
|
+
* <p>The reason why the model stopped generating output.</p>
|
|
804
|
+
* @public
|
|
805
|
+
*/
|
|
806
|
+
stopReason: StopReason | undefined;
|
|
807
|
+
/**
|
|
808
|
+
* <p>The total number of tokens used in the call to <code>Converse</code>. The total includes
|
|
809
|
+
* the tokens input to the model and the tokens generated by the model.</p>
|
|
810
|
+
* @public
|
|
811
|
+
*/
|
|
812
|
+
usage: TokenUsage | undefined;
|
|
813
|
+
/**
|
|
814
|
+
* <p>Metrics for the call to <code>Converse</code>.</p>
|
|
815
|
+
* @public
|
|
816
|
+
*/
|
|
817
|
+
metrics: ConverseMetrics | undefined;
|
|
818
|
+
/**
|
|
819
|
+
* <p>Additional fields in the response that are unique to the model. </p>
|
|
820
|
+
* @public
|
|
821
|
+
*/
|
|
822
|
+
additionalModelResponseFields?: __DocumentType;
|
|
823
|
+
}
|
|
15
824
|
/**
|
|
16
825
|
* <p>An internal server error occurred. Retry your request.</p>
|
|
17
826
|
* @public
|
|
18
827
|
*/
|
|
19
|
-
export declare class InternalServerException extends __BaseException {
|
|
20
|
-
readonly name: "InternalServerException";
|
|
21
|
-
readonly $fault: "server";
|
|
828
|
+
export declare class InternalServerException extends __BaseException {
|
|
829
|
+
readonly name: "InternalServerException";
|
|
830
|
+
readonly $fault: "server";
|
|
831
|
+
/**
|
|
832
|
+
* @internal
|
|
833
|
+
*/
|
|
834
|
+
constructor(opts: __ExceptionOptionType<InternalServerException, __BaseException>);
|
|
835
|
+
}
|
|
836
|
+
/**
|
|
837
|
+
* <p>The request failed due to an error while processing the model.</p>
|
|
838
|
+
* @public
|
|
839
|
+
*/
|
|
840
|
+
export declare class ModelErrorException extends __BaseException {
|
|
841
|
+
readonly name: "ModelErrorException";
|
|
842
|
+
readonly $fault: "client";
|
|
843
|
+
/**
|
|
844
|
+
* <p>The original status code.</p>
|
|
845
|
+
* @public
|
|
846
|
+
*/
|
|
847
|
+
originalStatusCode?: number;
|
|
848
|
+
/**
|
|
849
|
+
* <p>The resource name.</p>
|
|
850
|
+
* @public
|
|
851
|
+
*/
|
|
852
|
+
resourceName?: string;
|
|
853
|
+
/**
|
|
854
|
+
* @internal
|
|
855
|
+
*/
|
|
856
|
+
constructor(opts: __ExceptionOptionType<ModelErrorException, __BaseException>);
|
|
857
|
+
}
|
|
858
|
+
/**
|
|
859
|
+
* <p>The model specified in the request is not ready to serve inference requests.</p>
|
|
860
|
+
* @public
|
|
861
|
+
*/
|
|
862
|
+
export declare class ModelNotReadyException extends __BaseException {
|
|
863
|
+
readonly name: "ModelNotReadyException";
|
|
864
|
+
readonly $fault: "client";
|
|
865
|
+
/**
|
|
866
|
+
* @internal
|
|
867
|
+
*/
|
|
868
|
+
constructor(opts: __ExceptionOptionType<ModelNotReadyException, __BaseException>);
|
|
869
|
+
}
|
|
870
|
+
/**
|
|
871
|
+
* <p>The request took too long to process. Processing time exceeded the model timeout length.</p>
|
|
872
|
+
* @public
|
|
873
|
+
*/
|
|
874
|
+
export declare class ModelTimeoutException extends __BaseException {
|
|
875
|
+
readonly name: "ModelTimeoutException";
|
|
876
|
+
readonly $fault: "client";
|
|
877
|
+
/**
|
|
878
|
+
* @internal
|
|
879
|
+
*/
|
|
880
|
+
constructor(opts: __ExceptionOptionType<ModelTimeoutException, __BaseException>);
|
|
881
|
+
}
|
|
882
|
+
/**
|
|
883
|
+
* <p>The specified resource ARN was not found. Check the ARN and try your request again.</p>
|
|
884
|
+
* @public
|
|
885
|
+
*/
|
|
886
|
+
export declare class ResourceNotFoundException extends __BaseException {
|
|
887
|
+
readonly name: "ResourceNotFoundException";
|
|
888
|
+
readonly $fault: "client";
|
|
889
|
+
/**
|
|
890
|
+
* @internal
|
|
891
|
+
*/
|
|
892
|
+
constructor(opts: __ExceptionOptionType<ResourceNotFoundException, __BaseException>);
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* <p>The number of requests exceeds the limit. Resubmit your request later.</p>
|
|
896
|
+
* @public
|
|
897
|
+
*/
|
|
898
|
+
export declare class ThrottlingException extends __BaseException {
|
|
899
|
+
readonly name: "ThrottlingException";
|
|
900
|
+
readonly $fault: "client";
|
|
901
|
+
/**
|
|
902
|
+
* @internal
|
|
903
|
+
*/
|
|
904
|
+
constructor(opts: __ExceptionOptionType<ThrottlingException, __BaseException>);
|
|
905
|
+
}
|
|
906
|
+
/**
|
|
907
|
+
* <p>Input validation failed. Check your request parameters and retry the request.</p>
|
|
908
|
+
* @public
|
|
909
|
+
*/
|
|
910
|
+
export declare class ValidationException extends __BaseException {
|
|
911
|
+
readonly name: "ValidationException";
|
|
912
|
+
readonly $fault: "client";
|
|
913
|
+
/**
|
|
914
|
+
* @internal
|
|
915
|
+
*/
|
|
916
|
+
constructor(opts: __ExceptionOptionType<ValidationException, __BaseException>);
|
|
917
|
+
}
|
|
918
|
+
/**
|
|
919
|
+
* @public
|
|
920
|
+
*/
|
|
921
|
+
export interface ConverseStreamRequest {
|
|
922
|
+
/**
|
|
923
|
+
* <p>The ID for the model.</p>
|
|
924
|
+
* <p>The <code>modelId</code> to provide depends on the type of model that you use:</p>
|
|
925
|
+
* <ul>
|
|
926
|
+
* <li>
|
|
927
|
+
* <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>
|
|
928
|
+
* </li>
|
|
929
|
+
* <li>
|
|
930
|
+
* <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>
|
|
931
|
+
* </li>
|
|
932
|
+
* <li>
|
|
933
|
+
* <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>
|
|
934
|
+
* </li>
|
|
935
|
+
* </ul>
|
|
936
|
+
* @public
|
|
937
|
+
*/
|
|
938
|
+
modelId: string | undefined;
|
|
939
|
+
/**
|
|
940
|
+
* <p>The messages that you want to send to the model.</p>
|
|
941
|
+
* @public
|
|
942
|
+
*/
|
|
943
|
+
messages: Message[] | undefined;
|
|
944
|
+
/**
|
|
945
|
+
* <p>A system prompt to send to the model.</p>
|
|
946
|
+
* @public
|
|
947
|
+
*/
|
|
948
|
+
system?: SystemContentBlock[];
|
|
949
|
+
/**
|
|
950
|
+
* <p>Inference parameters to pass to the model. <code>ConverseStream</code> supports a base
|
|
951
|
+
* set of inference parameters. If you need to pass additional parameters that the model
|
|
952
|
+
* supports, use the <code>additionalModelRequestFields</code> request field.</p>
|
|
953
|
+
* @public
|
|
954
|
+
*/
|
|
955
|
+
inferenceConfig?: InferenceConfiguration;
|
|
956
|
+
/**
|
|
957
|
+
* <p>Configuration information for the tools that the model can use when generating a response.</p>
|
|
958
|
+
* <note>
|
|
959
|
+
* <p>This field is only supported by Anthropic Claude 3 models.</p>
|
|
960
|
+
* </note>
|
|
961
|
+
* @public
|
|
962
|
+
*/
|
|
963
|
+
toolConfig?: ToolConfiguration;
|
|
964
|
+
/**
|
|
965
|
+
* <p>Additional inference parameters that the model supports, beyond the
|
|
966
|
+
* base set of inference parameters that <code>ConverseStream</code> supports in the <code>inferenceConfig</code>
|
|
967
|
+
* field.</p>
|
|
968
|
+
* @public
|
|
969
|
+
*/
|
|
970
|
+
additionalModelRequestFields?: __DocumentType;
|
|
971
|
+
/**
|
|
972
|
+
* <p>Additional model parameters field paths to return in the
|
|
973
|
+
* response. <code>ConverseStream</code> returns the requested fields as a JSON Pointer object in the
|
|
974
|
+
* <code>additionalModelResultFields</code> field. The following is example JSON for <code>additionalModelResponseFieldPaths</code>.</p>
|
|
975
|
+
* <p>
|
|
976
|
+
* <code>[
|
|
977
|
+
* "/stop_sequence"
|
|
978
|
+
* ]</code>
|
|
979
|
+
* </p>
|
|
980
|
+
* <p>For information about the JSON Pointer syntax, see the
|
|
981
|
+
* <a href="https://datatracker.ietf.org/doc/html/rfc6901">Internet Engineering Task Force (IETF)</a> documentation.</p>
|
|
982
|
+
* <p>
|
|
983
|
+
* <code>ConverseStream</code> rejects an empty JSON Pointer or incorrectly structured
|
|
984
|
+
* JSON Pointer with a <code>400</code> error code. if the JSON Pointer is valid, but the requested
|
|
985
|
+
* field is not in the model response, it is ignored by <code>ConverseStream</code>.</p>
|
|
986
|
+
* @public
|
|
987
|
+
*/
|
|
988
|
+
additionalModelResponseFieldPaths?: string[];
|
|
989
|
+
}
|
|
990
|
+
/**
|
|
991
|
+
* <p>The delta for a tool use block.</p>
|
|
992
|
+
* @public
|
|
993
|
+
*/
|
|
994
|
+
export interface ToolUseBlockDelta {
|
|
995
|
+
/**
|
|
996
|
+
* <p>The input for a requested tool.</p>
|
|
997
|
+
* @public
|
|
998
|
+
*/
|
|
999
|
+
input: string | undefined;
|
|
1000
|
+
}
|
|
1001
|
+
/**
|
|
1002
|
+
* <p>A bock of content in a streaming response.</p>
|
|
1003
|
+
* @public
|
|
1004
|
+
*/
|
|
1005
|
+
export type ContentBlockDelta = ContentBlockDelta.TextMember | ContentBlockDelta.ToolUseMember | ContentBlockDelta.$UnknownMember;
|
|
1006
|
+
/**
|
|
1007
|
+
* @public
|
|
1008
|
+
*/
|
|
1009
|
+
export declare namespace ContentBlockDelta {
|
|
1010
|
+
/**
|
|
1011
|
+
* <p>The content text.</p>
|
|
1012
|
+
* @public
|
|
1013
|
+
*/
|
|
1014
|
+
interface TextMember {
|
|
1015
|
+
text: string;
|
|
1016
|
+
toolUse?: never;
|
|
1017
|
+
$unknown?: never;
|
|
1018
|
+
}
|
|
1019
|
+
/**
|
|
1020
|
+
* <p>Information about a tool that the model is requesting to use.</p>
|
|
1021
|
+
* @public
|
|
1022
|
+
*/
|
|
1023
|
+
interface ToolUseMember {
|
|
1024
|
+
text?: never;
|
|
1025
|
+
toolUse: ToolUseBlockDelta;
|
|
1026
|
+
$unknown?: never;
|
|
1027
|
+
}
|
|
1028
|
+
/**
|
|
1029
|
+
* @public
|
|
1030
|
+
*/
|
|
1031
|
+
interface $UnknownMember {
|
|
1032
|
+
text?: never;
|
|
1033
|
+
toolUse?: never;
|
|
1034
|
+
$unknown: [string, any];
|
|
1035
|
+
}
|
|
1036
|
+
interface Visitor<T> {
|
|
1037
|
+
text: (value: string) => T;
|
|
1038
|
+
toolUse: (value: ToolUseBlockDelta) => T;
|
|
1039
|
+
_: (name: string, value: any) => T;
|
|
1040
|
+
}
|
|
1041
|
+
const visit: <T>(value: ContentBlockDelta, visitor: Visitor<T>) => T;
|
|
1042
|
+
}
|
|
1043
|
+
/**
|
|
1044
|
+
* <p>The content block delta event.</p>
|
|
1045
|
+
* @public
|
|
1046
|
+
*/
|
|
1047
|
+
export interface ContentBlockDeltaEvent {
|
|
1048
|
+
/**
|
|
1049
|
+
* <p>The delta for a content block delta event.</p>
|
|
1050
|
+
* @public
|
|
1051
|
+
*/
|
|
1052
|
+
delta: ContentBlockDelta | undefined;
|
|
1053
|
+
/**
|
|
1054
|
+
* <p>The block index for a content block delta event. </p>
|
|
1055
|
+
* @public
|
|
1056
|
+
*/
|
|
1057
|
+
contentBlockIndex: number | undefined;
|
|
1058
|
+
}
|
|
1059
|
+
/**
|
|
1060
|
+
* <p>The start of a tool use block.</p>
|
|
1061
|
+
* @public
|
|
1062
|
+
*/
|
|
1063
|
+
export interface ToolUseBlockStart {
|
|
1064
|
+
/**
|
|
1065
|
+
* <p>The ID for the tool request.</p>
|
|
1066
|
+
* @public
|
|
1067
|
+
*/
|
|
1068
|
+
toolUseId: string | undefined;
|
|
1069
|
+
/**
|
|
1070
|
+
* <p>The name of the tool that the model is requesting to use.</p>
|
|
1071
|
+
* @public
|
|
1072
|
+
*/
|
|
1073
|
+
name: string | undefined;
|
|
1074
|
+
}
|
|
1075
|
+
/**
|
|
1076
|
+
* <p>Content block start information.</p>
|
|
1077
|
+
* @public
|
|
1078
|
+
*/
|
|
1079
|
+
export type ContentBlockStart = ContentBlockStart.ToolUseMember | ContentBlockStart.$UnknownMember;
|
|
1080
|
+
/**
|
|
1081
|
+
* @public
|
|
1082
|
+
*/
|
|
1083
|
+
export declare namespace ContentBlockStart {
|
|
1084
|
+
/**
|
|
1085
|
+
* <p>Information about a tool that the model is requesting to use.</p>
|
|
1086
|
+
* @public
|
|
1087
|
+
*/
|
|
1088
|
+
interface ToolUseMember {
|
|
1089
|
+
toolUse: ToolUseBlockStart;
|
|
1090
|
+
$unknown?: never;
|
|
1091
|
+
}
|
|
1092
|
+
/**
|
|
1093
|
+
* @public
|
|
1094
|
+
*/
|
|
1095
|
+
interface $UnknownMember {
|
|
1096
|
+
toolUse?: never;
|
|
1097
|
+
$unknown: [string, any];
|
|
1098
|
+
}
|
|
1099
|
+
interface Visitor<T> {
|
|
1100
|
+
toolUse: (value: ToolUseBlockStart) => T;
|
|
1101
|
+
_: (name: string, value: any) => T;
|
|
1102
|
+
}
|
|
1103
|
+
const visit: <T>(value: ContentBlockStart, visitor: Visitor<T>) => T;
|
|
1104
|
+
}
|
|
1105
|
+
/**
|
|
1106
|
+
* <p>Content block start event.</p>
|
|
1107
|
+
* @public
|
|
1108
|
+
*/
|
|
1109
|
+
export interface ContentBlockStartEvent {
|
|
1110
|
+
/**
|
|
1111
|
+
* <p>Start information about a content block start event. </p>
|
|
1112
|
+
* @public
|
|
1113
|
+
*/
|
|
1114
|
+
start: ContentBlockStart | undefined;
|
|
1115
|
+
/**
|
|
1116
|
+
* <p>The index for a content block start event.</p>
|
|
1117
|
+
* @public
|
|
1118
|
+
*/
|
|
1119
|
+
contentBlockIndex: number | undefined;
|
|
1120
|
+
}
|
|
1121
|
+
/**
|
|
1122
|
+
* <p>A content block stop event.</p>
|
|
1123
|
+
* @public
|
|
1124
|
+
*/
|
|
1125
|
+
export interface ContentBlockStopEvent {
|
|
1126
|
+
/**
|
|
1127
|
+
* <p>The index for a content block.</p>
|
|
1128
|
+
* @public
|
|
1129
|
+
*/
|
|
1130
|
+
contentBlockIndex: number | undefined;
|
|
1131
|
+
}
|
|
1132
|
+
/**
|
|
1133
|
+
* <p>The start of a message.</p>
|
|
1134
|
+
* @public
|
|
1135
|
+
*/
|
|
1136
|
+
export interface MessageStartEvent {
|
|
1137
|
+
/**
|
|
1138
|
+
* <p>The role for the message.</p>
|
|
1139
|
+
* @public
|
|
1140
|
+
*/
|
|
1141
|
+
role: ConversationRole | undefined;
|
|
1142
|
+
}
|
|
1143
|
+
/**
|
|
1144
|
+
* <p>The stop event for a message.</p>
|
|
1145
|
+
* @public
|
|
1146
|
+
*/
|
|
1147
|
+
export interface MessageStopEvent {
|
|
1148
|
+
/**
|
|
1149
|
+
* <p>The reason why the model stopped generating output.</p>
|
|
1150
|
+
* @public
|
|
1151
|
+
*/
|
|
1152
|
+
stopReason: StopReason | undefined;
|
|
1153
|
+
/**
|
|
1154
|
+
* <p>The additional model response fields.</p>
|
|
1155
|
+
* @public
|
|
1156
|
+
*/
|
|
1157
|
+
additionalModelResponseFields?: __DocumentType;
|
|
1158
|
+
}
|
|
1159
|
+
/**
|
|
1160
|
+
* <p>Metrics for the stream.</p>
|
|
1161
|
+
* @public
|
|
1162
|
+
*/
|
|
1163
|
+
export interface ConverseStreamMetrics {
|
|
1164
|
+
/**
|
|
1165
|
+
* <p>The latency for the streaming request, in milliseconds.</p>
|
|
1166
|
+
* @public
|
|
1167
|
+
*/
|
|
1168
|
+
latencyMs: number | undefined;
|
|
1169
|
+
}
|
|
1170
|
+
/**
|
|
1171
|
+
* <p>A conversation stream metadata event.</p>
|
|
1172
|
+
* @public
|
|
1173
|
+
*/
|
|
1174
|
+
export interface ConverseStreamMetadataEvent {
|
|
1175
|
+
/**
|
|
1176
|
+
* <p>Usage information for the conversation stream event.</p>
|
|
1177
|
+
* @public
|
|
1178
|
+
*/
|
|
1179
|
+
usage: TokenUsage | undefined;
|
|
1180
|
+
/**
|
|
1181
|
+
* <p>The metrics for the conversation stream metadata event.</p>
|
|
1182
|
+
* @public
|
|
1183
|
+
*/
|
|
1184
|
+
metrics: ConverseStreamMetrics | undefined;
|
|
1185
|
+
}
|
|
1186
|
+
/**
|
|
1187
|
+
* <p>An error occurred while streaming the response. Retry your request.</p>
|
|
1188
|
+
* @public
|
|
1189
|
+
*/
|
|
1190
|
+
export declare class ModelStreamErrorException extends __BaseException {
|
|
1191
|
+
readonly name: "ModelStreamErrorException";
|
|
1192
|
+
readonly $fault: "client";
|
|
1193
|
+
/**
|
|
1194
|
+
* <p>The original status code.</p>
|
|
1195
|
+
* @public
|
|
1196
|
+
*/
|
|
1197
|
+
originalStatusCode?: number;
|
|
1198
|
+
/**
|
|
1199
|
+
* <p>The original message.</p>
|
|
1200
|
+
* @public
|
|
1201
|
+
*/
|
|
1202
|
+
originalMessage?: string;
|
|
22
1203
|
/**
|
|
23
1204
|
* @internal
|
|
24
1205
|
*/
|
|
25
|
-
constructor(opts: __ExceptionOptionType<
|
|
1206
|
+
constructor(opts: __ExceptionOptionType<ModelStreamErrorException, __BaseException>);
|
|
1207
|
+
}
|
|
1208
|
+
/**
|
|
1209
|
+
* <p>The messages output stream</p>
|
|
1210
|
+
* @public
|
|
1211
|
+
*/
|
|
1212
|
+
export type ConverseStreamOutput = ConverseStreamOutput.ContentBlockDeltaMember | ConverseStreamOutput.ContentBlockStartMember | ConverseStreamOutput.ContentBlockStopMember | ConverseStreamOutput.InternalServerExceptionMember | ConverseStreamOutput.MessageStartMember | ConverseStreamOutput.MessageStopMember | ConverseStreamOutput.MetadataMember | ConverseStreamOutput.ModelStreamErrorExceptionMember | ConverseStreamOutput.ThrottlingExceptionMember | ConverseStreamOutput.ValidationExceptionMember | ConverseStreamOutput.$UnknownMember;
|
|
1213
|
+
/**
|
|
1214
|
+
* @public
|
|
1215
|
+
*/
|
|
1216
|
+
export declare namespace ConverseStreamOutput {
|
|
1217
|
+
/**
|
|
1218
|
+
* <p>Message start information.</p>
|
|
1219
|
+
* @public
|
|
1220
|
+
*/
|
|
1221
|
+
interface MessageStartMember {
|
|
1222
|
+
messageStart: MessageStartEvent;
|
|
1223
|
+
contentBlockStart?: never;
|
|
1224
|
+
contentBlockDelta?: never;
|
|
1225
|
+
contentBlockStop?: never;
|
|
1226
|
+
messageStop?: never;
|
|
1227
|
+
metadata?: never;
|
|
1228
|
+
internalServerException?: never;
|
|
1229
|
+
modelStreamErrorException?: never;
|
|
1230
|
+
validationException?: never;
|
|
1231
|
+
throttlingException?: never;
|
|
1232
|
+
$unknown?: never;
|
|
1233
|
+
}
|
|
1234
|
+
/**
|
|
1235
|
+
* <p>Start information for a content block.</p>
|
|
1236
|
+
* @public
|
|
1237
|
+
*/
|
|
1238
|
+
interface ContentBlockStartMember {
|
|
1239
|
+
messageStart?: never;
|
|
1240
|
+
contentBlockStart: ContentBlockStartEvent;
|
|
1241
|
+
contentBlockDelta?: never;
|
|
1242
|
+
contentBlockStop?: never;
|
|
1243
|
+
messageStop?: never;
|
|
1244
|
+
metadata?: never;
|
|
1245
|
+
internalServerException?: never;
|
|
1246
|
+
modelStreamErrorException?: never;
|
|
1247
|
+
validationException?: never;
|
|
1248
|
+
throttlingException?: never;
|
|
1249
|
+
$unknown?: never;
|
|
1250
|
+
}
|
|
1251
|
+
/**
|
|
1252
|
+
* <p>The messages output content block delta.</p>
|
|
1253
|
+
* @public
|
|
1254
|
+
*/
|
|
1255
|
+
interface ContentBlockDeltaMember {
|
|
1256
|
+
messageStart?: never;
|
|
1257
|
+
contentBlockStart?: never;
|
|
1258
|
+
contentBlockDelta: ContentBlockDeltaEvent;
|
|
1259
|
+
contentBlockStop?: never;
|
|
1260
|
+
messageStop?: never;
|
|
1261
|
+
metadata?: never;
|
|
1262
|
+
internalServerException?: never;
|
|
1263
|
+
modelStreamErrorException?: never;
|
|
1264
|
+
validationException?: never;
|
|
1265
|
+
throttlingException?: never;
|
|
1266
|
+
$unknown?: never;
|
|
1267
|
+
}
|
|
1268
|
+
/**
|
|
1269
|
+
* <p>Stop information for a content block.</p>
|
|
1270
|
+
* @public
|
|
1271
|
+
*/
|
|
1272
|
+
interface ContentBlockStopMember {
|
|
1273
|
+
messageStart?: never;
|
|
1274
|
+
contentBlockStart?: never;
|
|
1275
|
+
contentBlockDelta?: never;
|
|
1276
|
+
contentBlockStop: ContentBlockStopEvent;
|
|
1277
|
+
messageStop?: never;
|
|
1278
|
+
metadata?: never;
|
|
1279
|
+
internalServerException?: never;
|
|
1280
|
+
modelStreamErrorException?: never;
|
|
1281
|
+
validationException?: never;
|
|
1282
|
+
throttlingException?: never;
|
|
1283
|
+
$unknown?: never;
|
|
1284
|
+
}
|
|
1285
|
+
/**
|
|
1286
|
+
* <p>Message stop information.</p>
|
|
1287
|
+
* @public
|
|
1288
|
+
*/
|
|
1289
|
+
interface MessageStopMember {
|
|
1290
|
+
messageStart?: never;
|
|
1291
|
+
contentBlockStart?: never;
|
|
1292
|
+
contentBlockDelta?: never;
|
|
1293
|
+
contentBlockStop?: never;
|
|
1294
|
+
messageStop: MessageStopEvent;
|
|
1295
|
+
metadata?: never;
|
|
1296
|
+
internalServerException?: never;
|
|
1297
|
+
modelStreamErrorException?: never;
|
|
1298
|
+
validationException?: never;
|
|
1299
|
+
throttlingException?: never;
|
|
1300
|
+
$unknown?: never;
|
|
1301
|
+
}
|
|
1302
|
+
/**
|
|
1303
|
+
* <p>Metadata for the converse output stream.</p>
|
|
1304
|
+
* @public
|
|
1305
|
+
*/
|
|
1306
|
+
interface MetadataMember {
|
|
1307
|
+
messageStart?: never;
|
|
1308
|
+
contentBlockStart?: never;
|
|
1309
|
+
contentBlockDelta?: never;
|
|
1310
|
+
contentBlockStop?: never;
|
|
1311
|
+
messageStop?: never;
|
|
1312
|
+
metadata: ConverseStreamMetadataEvent;
|
|
1313
|
+
internalServerException?: never;
|
|
1314
|
+
modelStreamErrorException?: never;
|
|
1315
|
+
validationException?: never;
|
|
1316
|
+
throttlingException?: never;
|
|
1317
|
+
$unknown?: never;
|
|
1318
|
+
}
|
|
1319
|
+
/**
|
|
1320
|
+
* <p>An internal server error occurred. Retry your request.</p>
|
|
1321
|
+
* @public
|
|
1322
|
+
*/
|
|
1323
|
+
interface InternalServerExceptionMember {
|
|
1324
|
+
messageStart?: never;
|
|
1325
|
+
contentBlockStart?: never;
|
|
1326
|
+
contentBlockDelta?: never;
|
|
1327
|
+
contentBlockStop?: never;
|
|
1328
|
+
messageStop?: never;
|
|
1329
|
+
metadata?: never;
|
|
1330
|
+
internalServerException: InternalServerException;
|
|
1331
|
+
modelStreamErrorException?: never;
|
|
1332
|
+
validationException?: never;
|
|
1333
|
+
throttlingException?: never;
|
|
1334
|
+
$unknown?: never;
|
|
1335
|
+
}
|
|
1336
|
+
/**
|
|
1337
|
+
* <p>A streaming error occurred. Retry your request.</p>
|
|
1338
|
+
* @public
|
|
1339
|
+
*/
|
|
1340
|
+
interface ModelStreamErrorExceptionMember {
|
|
1341
|
+
messageStart?: never;
|
|
1342
|
+
contentBlockStart?: never;
|
|
1343
|
+
contentBlockDelta?: never;
|
|
1344
|
+
contentBlockStop?: never;
|
|
1345
|
+
messageStop?: never;
|
|
1346
|
+
metadata?: never;
|
|
1347
|
+
internalServerException?: never;
|
|
1348
|
+
modelStreamErrorException: ModelStreamErrorException;
|
|
1349
|
+
validationException?: never;
|
|
1350
|
+
throttlingException?: never;
|
|
1351
|
+
$unknown?: never;
|
|
1352
|
+
}
|
|
1353
|
+
/**
|
|
1354
|
+
* <p>Input validation failed. Check your request parameters and retry the request.</p>
|
|
1355
|
+
* @public
|
|
1356
|
+
*/
|
|
1357
|
+
interface ValidationExceptionMember {
|
|
1358
|
+
messageStart?: never;
|
|
1359
|
+
contentBlockStart?: never;
|
|
1360
|
+
contentBlockDelta?: never;
|
|
1361
|
+
contentBlockStop?: never;
|
|
1362
|
+
messageStop?: never;
|
|
1363
|
+
metadata?: never;
|
|
1364
|
+
internalServerException?: never;
|
|
1365
|
+
modelStreamErrorException?: never;
|
|
1366
|
+
validationException: ValidationException;
|
|
1367
|
+
throttlingException?: never;
|
|
1368
|
+
$unknown?: never;
|
|
1369
|
+
}
|
|
1370
|
+
/**
|
|
1371
|
+
* <p>The number of requests exceeds the limit. Resubmit your request later.</p>
|
|
1372
|
+
* @public
|
|
1373
|
+
*/
|
|
1374
|
+
interface ThrottlingExceptionMember {
|
|
1375
|
+
messageStart?: never;
|
|
1376
|
+
contentBlockStart?: never;
|
|
1377
|
+
contentBlockDelta?: never;
|
|
1378
|
+
contentBlockStop?: never;
|
|
1379
|
+
messageStop?: never;
|
|
1380
|
+
metadata?: never;
|
|
1381
|
+
internalServerException?: never;
|
|
1382
|
+
modelStreamErrorException?: never;
|
|
1383
|
+
validationException?: never;
|
|
1384
|
+
throttlingException: ThrottlingException;
|
|
1385
|
+
$unknown?: never;
|
|
1386
|
+
}
|
|
1387
|
+
/**
|
|
1388
|
+
* @public
|
|
1389
|
+
*/
|
|
1390
|
+
interface $UnknownMember {
|
|
1391
|
+
messageStart?: never;
|
|
1392
|
+
contentBlockStart?: never;
|
|
1393
|
+
contentBlockDelta?: never;
|
|
1394
|
+
contentBlockStop?: never;
|
|
1395
|
+
messageStop?: never;
|
|
1396
|
+
metadata?: never;
|
|
1397
|
+
internalServerException?: never;
|
|
1398
|
+
modelStreamErrorException?: never;
|
|
1399
|
+
validationException?: never;
|
|
1400
|
+
throttlingException?: never;
|
|
1401
|
+
$unknown: [string, any];
|
|
1402
|
+
}
|
|
1403
|
+
interface Visitor<T> {
|
|
1404
|
+
messageStart: (value: MessageStartEvent) => T;
|
|
1405
|
+
contentBlockStart: (value: ContentBlockStartEvent) => T;
|
|
1406
|
+
contentBlockDelta: (value: ContentBlockDeltaEvent) => T;
|
|
1407
|
+
contentBlockStop: (value: ContentBlockStopEvent) => T;
|
|
1408
|
+
messageStop: (value: MessageStopEvent) => T;
|
|
1409
|
+
metadata: (value: ConverseStreamMetadataEvent) => T;
|
|
1410
|
+
internalServerException: (value: InternalServerException) => T;
|
|
1411
|
+
modelStreamErrorException: (value: ModelStreamErrorException) => T;
|
|
1412
|
+
validationException: (value: ValidationException) => T;
|
|
1413
|
+
throttlingException: (value: ThrottlingException) => T;
|
|
1414
|
+
_: (name: string, value: any) => T;
|
|
1415
|
+
}
|
|
1416
|
+
const visit: <T>(value: ConverseStreamOutput, visitor: Visitor<T>) => T;
|
|
1417
|
+
}
|
|
1418
|
+
/**
|
|
1419
|
+
* @public
|
|
1420
|
+
*/
|
|
1421
|
+
export interface ConverseStreamResponse {
|
|
1422
|
+
/**
|
|
1423
|
+
* <p>The output stream that the model generated.</p>
|
|
1424
|
+
* @public
|
|
1425
|
+
*/
|
|
1426
|
+
stream?: AsyncIterable<ConverseStreamOutput>;
|
|
26
1427
|
}
|
|
27
1428
|
/**
|
|
28
1429
|
* @public
|
|
@@ -117,64 +1518,6 @@ export interface InvokeModelResponse {
|
|
|
117
1518
|
*/
|
|
118
1519
|
contentType: string | undefined;
|
|
119
1520
|
}
|
|
120
|
-
/**
|
|
121
|
-
* <p>The request failed due to an error while processing the model.</p>
|
|
122
|
-
* @public
|
|
123
|
-
*/
|
|
124
|
-
export declare class ModelErrorException extends __BaseException {
|
|
125
|
-
readonly name: "ModelErrorException";
|
|
126
|
-
readonly $fault: "client";
|
|
127
|
-
/**
|
|
128
|
-
* <p>The original status code.</p>
|
|
129
|
-
* @public
|
|
130
|
-
*/
|
|
131
|
-
originalStatusCode?: number;
|
|
132
|
-
/**
|
|
133
|
-
* <p>The resource name.</p>
|
|
134
|
-
* @public
|
|
135
|
-
*/
|
|
136
|
-
resourceName?: string;
|
|
137
|
-
/**
|
|
138
|
-
* @internal
|
|
139
|
-
*/
|
|
140
|
-
constructor(opts: __ExceptionOptionType<ModelErrorException, __BaseException>);
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* <p>The model specified in the request is not ready to serve inference requests.</p>
|
|
144
|
-
* @public
|
|
145
|
-
*/
|
|
146
|
-
export declare class ModelNotReadyException extends __BaseException {
|
|
147
|
-
readonly name: "ModelNotReadyException";
|
|
148
|
-
readonly $fault: "client";
|
|
149
|
-
/**
|
|
150
|
-
* @internal
|
|
151
|
-
*/
|
|
152
|
-
constructor(opts: __ExceptionOptionType<ModelNotReadyException, __BaseException>);
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* <p>The request took too long to process. Processing time exceeded the model timeout length.</p>
|
|
156
|
-
* @public
|
|
157
|
-
*/
|
|
158
|
-
export declare class ModelTimeoutException extends __BaseException {
|
|
159
|
-
readonly name: "ModelTimeoutException";
|
|
160
|
-
readonly $fault: "client";
|
|
161
|
-
/**
|
|
162
|
-
* @internal
|
|
163
|
-
*/
|
|
164
|
-
constructor(opts: __ExceptionOptionType<ModelTimeoutException, __BaseException>);
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* <p>The specified resource ARN was not found. Check the ARN and try your request again.</p>
|
|
168
|
-
* @public
|
|
169
|
-
*/
|
|
170
|
-
export declare class ResourceNotFoundException extends __BaseException {
|
|
171
|
-
readonly name: "ResourceNotFoundException";
|
|
172
|
-
readonly $fault: "client";
|
|
173
|
-
/**
|
|
174
|
-
* @internal
|
|
175
|
-
*/
|
|
176
|
-
constructor(opts: __ExceptionOptionType<ResourceNotFoundException, __BaseException>);
|
|
177
|
-
}
|
|
178
1521
|
/**
|
|
179
1522
|
* <p>The number of requests exceeds the service quota. Resubmit your request later.</p>
|
|
180
1523
|
* @public
|
|
@@ -187,30 +1530,6 @@ export declare class ServiceQuotaExceededException extends __BaseException {
|
|
|
187
1530
|
*/
|
|
188
1531
|
constructor(opts: __ExceptionOptionType<ServiceQuotaExceededException, __BaseException>);
|
|
189
1532
|
}
|
|
190
|
-
/**
|
|
191
|
-
* <p>The number of requests exceeds the limit. Resubmit your request later.</p>
|
|
192
|
-
* @public
|
|
193
|
-
*/
|
|
194
|
-
export declare class ThrottlingException extends __BaseException {
|
|
195
|
-
readonly name: "ThrottlingException";
|
|
196
|
-
readonly $fault: "client";
|
|
197
|
-
/**
|
|
198
|
-
* @internal
|
|
199
|
-
*/
|
|
200
|
-
constructor(opts: __ExceptionOptionType<ThrottlingException, __BaseException>);
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* <p>Input validation failed. Check your request parameters and retry the request.</p>
|
|
204
|
-
* @public
|
|
205
|
-
*/
|
|
206
|
-
export declare class ValidationException extends __BaseException {
|
|
207
|
-
readonly name: "ValidationException";
|
|
208
|
-
readonly $fault: "client";
|
|
209
|
-
/**
|
|
210
|
-
* @internal
|
|
211
|
-
*/
|
|
212
|
-
constructor(opts: __ExceptionOptionType<ValidationException, __BaseException>);
|
|
213
|
-
}
|
|
214
1533
|
/**
|
|
215
1534
|
* @public
|
|
216
1535
|
*/
|
|
@@ -289,28 +1608,6 @@ export interface PayloadPart {
|
|
|
289
1608
|
*/
|
|
290
1609
|
bytes?: Uint8Array;
|
|
291
1610
|
}
|
|
292
|
-
/**
|
|
293
|
-
* <p>An error occurred while streaming the response. Retry your request.</p>
|
|
294
|
-
* @public
|
|
295
|
-
*/
|
|
296
|
-
export declare class ModelStreamErrorException extends __BaseException {
|
|
297
|
-
readonly name: "ModelStreamErrorException";
|
|
298
|
-
readonly $fault: "client";
|
|
299
|
-
/**
|
|
300
|
-
* <p>The original status code.</p>
|
|
301
|
-
* @public
|
|
302
|
-
*/
|
|
303
|
-
originalStatusCode?: number;
|
|
304
|
-
/**
|
|
305
|
-
* <p>The original message.</p>
|
|
306
|
-
* @public
|
|
307
|
-
*/
|
|
308
|
-
originalMessage?: string;
|
|
309
|
-
/**
|
|
310
|
-
* @internal
|
|
311
|
-
*/
|
|
312
|
-
constructor(opts: __ExceptionOptionType<ModelStreamErrorException, __BaseException>);
|
|
313
|
-
}
|
|
314
1611
|
/**
|
|
315
1612
|
* <p>Definition of content in the response stream.</p>
|
|
316
1613
|
* @public
|
|
@@ -436,6 +1733,14 @@ export interface InvokeModelWithResponseStreamResponse {
|
|
|
436
1733
|
*/
|
|
437
1734
|
contentType: string | undefined;
|
|
438
1735
|
}
|
|
1736
|
+
/**
|
|
1737
|
+
* @internal
|
|
1738
|
+
*/
|
|
1739
|
+
export declare const ConverseStreamOutputFilterSensitiveLog: (obj: ConverseStreamOutput) => any;
|
|
1740
|
+
/**
|
|
1741
|
+
* @internal
|
|
1742
|
+
*/
|
|
1743
|
+
export declare const ConverseStreamResponseFilterSensitiveLog: (obj: ConverseStreamResponse) => any;
|
|
439
1744
|
/**
|
|
440
1745
|
* @internal
|
|
441
1746
|
*/
|