@effect/ai-amazon-bedrock 0.6.2 → 0.7.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/AmazonBedrockTool/package.json +6 -0
- package/dist/cjs/AmazonBedrockClient.js +71 -145
- package/dist/cjs/AmazonBedrockClient.js.map +1 -1
- package/dist/cjs/AmazonBedrockLanguageModel.js +833 -337
- package/dist/cjs/AmazonBedrockLanguageModel.js.map +1 -1
- package/dist/cjs/AmazonBedrockSchema.js +94 -39
- package/dist/cjs/AmazonBedrockSchema.js.map +1 -1
- package/dist/cjs/AmazonBedrockTool.js +53 -0
- package/dist/cjs/AmazonBedrockTool.js.map +1 -0
- package/dist/cjs/EventStreamEncoding.js +5 -4
- package/dist/cjs/EventStreamEncoding.js.map +1 -1
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/internal/utilities.js +3 -1
- package/dist/cjs/internal/utilities.js.map +1 -1
- package/dist/dts/AmazonBedrockClient.d.ts +34 -34
- package/dist/dts/AmazonBedrockClient.d.ts.map +1 -1
- package/dist/dts/AmazonBedrockLanguageModel.d.ts +72 -20
- package/dist/dts/AmazonBedrockLanguageModel.d.ts.map +1 -1
- package/dist/dts/AmazonBedrockSchema.d.ts +543 -102
- package/dist/dts/AmazonBedrockSchema.d.ts.map +1 -1
- package/dist/dts/AmazonBedrockTool.d.ts +184 -0
- package/dist/dts/AmazonBedrockTool.d.ts.map +1 -0
- package/dist/dts/EventStreamEncoding.d.ts +2 -2
- package/dist/dts/EventStreamEncoding.d.ts.map +1 -1
- package/dist/dts/index.d.ts +4 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/esm/AmazonBedrockClient.js +71 -144
- package/dist/esm/AmazonBedrockClient.js.map +1 -1
- package/dist/esm/AmazonBedrockLanguageModel.js +830 -333
- package/dist/esm/AmazonBedrockLanguageModel.js.map +1 -1
- package/dist/esm/AmazonBedrockSchema.js +93 -37
- package/dist/esm/AmazonBedrockSchema.js.map +1 -1
- package/dist/esm/AmazonBedrockTool.js +45 -0
- package/dist/esm/AmazonBedrockTool.js.map +1 -0
- package/dist/esm/EventStreamEncoding.js +5 -3
- package/dist/esm/EventStreamEncoding.js.map +1 -1
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/internal/utilities.js +2 -0
- package/dist/esm/internal/utilities.js.map +1 -1
- package/package.json +13 -4
- package/src/AmazonBedrockClient.ts +144 -241
- package/src/AmazonBedrockLanguageModel.ts +962 -372
- package/src/AmazonBedrockSchema.ts +134 -46
- package/src/AmazonBedrockTool.ts +251 -0
- package/src/EventStreamEncoding.ts +80 -73
- package/src/index.ts +5 -0
- package/src/internal/utilities.ts +6 -3
|
@@ -160,14 +160,25 @@ declare const JsonBlock_base: Schema.Class<JsonBlock, {
|
|
|
160
160
|
*/
|
|
161
161
|
export declare class JsonBlock extends JsonBlock_base {
|
|
162
162
|
}
|
|
163
|
-
declare const ReasoningContentBlock_base: Schema.Union<[Schema.
|
|
164
|
-
reasoningText:
|
|
165
|
-
text:
|
|
166
|
-
signature
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
}
|
|
163
|
+
declare const ReasoningContentBlock_base: Schema.Union<[Schema.SchemaClass<{
|
|
164
|
+
readonly reasoningText: {
|
|
165
|
+
readonly text: string;
|
|
166
|
+
readonly signature?: string | undefined;
|
|
167
|
+
};
|
|
168
|
+
} & {
|
|
169
|
+
readonly type: "reasoning";
|
|
170
|
+
}, {
|
|
171
|
+
readonly reasoningText: {
|
|
172
|
+
readonly text: string;
|
|
173
|
+
readonly signature?: string | undefined;
|
|
174
|
+
};
|
|
175
|
+
}, never>, Schema.SchemaClass<{
|
|
176
|
+
readonly redactedContent: string;
|
|
177
|
+
} & {
|
|
178
|
+
readonly type: "redacted-reasoning";
|
|
179
|
+
}, {
|
|
180
|
+
readonly redactedContent: string;
|
|
181
|
+
}, never>]>;
|
|
171
182
|
/**
|
|
172
183
|
* @since 1.0.0
|
|
173
184
|
* @category Schemas
|
|
@@ -284,25 +295,151 @@ declare const ToolUseBlock_base: Schema.Class<ToolUseBlock, {
|
|
|
284
295
|
*/
|
|
285
296
|
export declare class ToolUseBlock extends ToolUseBlock_base {
|
|
286
297
|
}
|
|
287
|
-
declare const ContentBlock_base: Schema.Union<[Schema.
|
|
288
|
-
cachePoint:
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}>, Schema.
|
|
296
|
-
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
}
|
|
298
|
+
declare const ContentBlock_base: Schema.Union<[Schema.SchemaClass<{
|
|
299
|
+
readonly cachePoint: CachePointBlock;
|
|
300
|
+
} & {
|
|
301
|
+
readonly type: "cachePoint";
|
|
302
|
+
}, {
|
|
303
|
+
readonly cachePoint: {
|
|
304
|
+
readonly type: "default";
|
|
305
|
+
};
|
|
306
|
+
}, never>, Schema.SchemaClass<{
|
|
307
|
+
readonly document: DocumentBlock;
|
|
308
|
+
} & {
|
|
309
|
+
readonly type: "document";
|
|
310
|
+
}, {
|
|
311
|
+
readonly document: {
|
|
312
|
+
readonly format: "csv" | "doc" | "docx" | "html" | "md" | "pdf" | "txt" | "xls" | "xlsx";
|
|
313
|
+
readonly name: string;
|
|
314
|
+
readonly source: {
|
|
315
|
+
readonly bytes: string;
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
}, never>, Schema.SchemaClass<{
|
|
319
|
+
readonly guardContent: GuardrailConverseImageBlock | GuardrailConverseTextBlock;
|
|
320
|
+
} & {
|
|
321
|
+
readonly type: "guardContent";
|
|
322
|
+
}, {
|
|
323
|
+
readonly guardContent: {
|
|
324
|
+
readonly format: "png" | "jpg";
|
|
325
|
+
readonly source: {
|
|
326
|
+
readonly bytes: string;
|
|
327
|
+
};
|
|
328
|
+
} | {
|
|
329
|
+
readonly text: string;
|
|
330
|
+
readonly qualifiers?: readonly ("guard_content" | "grounding_source" | "query")[] | undefined;
|
|
331
|
+
};
|
|
332
|
+
}, never>, Schema.SchemaClass<{
|
|
333
|
+
readonly image: ImageBlock;
|
|
334
|
+
} & {
|
|
335
|
+
readonly type: "image";
|
|
336
|
+
}, {
|
|
337
|
+
readonly image: {
|
|
338
|
+
readonly format: "png" | "gif" | "jpeg" | "webp";
|
|
339
|
+
readonly source: {
|
|
340
|
+
readonly bytes: string;
|
|
341
|
+
};
|
|
342
|
+
};
|
|
343
|
+
}, never>, Schema.SchemaClass<{
|
|
344
|
+
readonly reasoningContent: ({
|
|
345
|
+
readonly reasoningText: {
|
|
346
|
+
readonly text: string;
|
|
347
|
+
readonly signature?: string | undefined;
|
|
348
|
+
};
|
|
349
|
+
} & {
|
|
350
|
+
readonly type: "reasoning";
|
|
351
|
+
}) | ({
|
|
352
|
+
readonly redactedContent: string;
|
|
353
|
+
} & {
|
|
354
|
+
readonly type: "redacted-reasoning";
|
|
355
|
+
});
|
|
356
|
+
} & {
|
|
357
|
+
readonly type: "reasoningContent";
|
|
358
|
+
}, {
|
|
359
|
+
readonly reasoningContent: {
|
|
360
|
+
readonly reasoningText: {
|
|
361
|
+
readonly text: string;
|
|
362
|
+
readonly signature?: string | undefined;
|
|
363
|
+
};
|
|
364
|
+
} | {
|
|
365
|
+
readonly redactedContent: string;
|
|
366
|
+
};
|
|
367
|
+
}, never>, Schema.SchemaClass<{
|
|
368
|
+
readonly text: string;
|
|
369
|
+
} & {
|
|
370
|
+
readonly type: "text";
|
|
371
|
+
}, {
|
|
372
|
+
readonly text: string;
|
|
373
|
+
}, never>, Schema.SchemaClass<{
|
|
374
|
+
readonly toolResult: ToolResultBlock;
|
|
375
|
+
} & {
|
|
376
|
+
readonly type: "toolResult";
|
|
377
|
+
}, {
|
|
378
|
+
readonly toolResult: {
|
|
379
|
+
readonly content: readonly ({
|
|
380
|
+
readonly document: {
|
|
381
|
+
readonly format: "csv" | "doc" | "docx" | "html" | "md" | "pdf" | "txt" | "xls" | "xlsx";
|
|
382
|
+
readonly name: string;
|
|
383
|
+
readonly source: {
|
|
384
|
+
readonly bytes: string;
|
|
385
|
+
};
|
|
386
|
+
};
|
|
387
|
+
} | {
|
|
388
|
+
readonly image: {
|
|
389
|
+
readonly format: "png" | "gif" | "jpeg" | "webp";
|
|
390
|
+
readonly source: {
|
|
391
|
+
readonly bytes: string;
|
|
392
|
+
};
|
|
393
|
+
};
|
|
394
|
+
} | {
|
|
395
|
+
readonly text: string;
|
|
396
|
+
} | {
|
|
397
|
+
readonly json: {
|
|
398
|
+
readonly json: unknown;
|
|
399
|
+
};
|
|
400
|
+
} | {
|
|
401
|
+
readonly video: {
|
|
402
|
+
readonly format: "flv" | "mkv" | "mov" | "mp4" | "mpg" | "mpeg" | "three_gp" | "webm";
|
|
403
|
+
readonly source: {
|
|
404
|
+
readonly bytes: string;
|
|
405
|
+
} | {
|
|
406
|
+
readonly s3Location: {
|
|
407
|
+
readonly uri: string;
|
|
408
|
+
readonly bucketOwner?: string | undefined;
|
|
409
|
+
};
|
|
410
|
+
};
|
|
411
|
+
};
|
|
412
|
+
})[];
|
|
413
|
+
readonly toolUseId: string;
|
|
414
|
+
readonly status?: "success" | "error" | undefined;
|
|
415
|
+
};
|
|
416
|
+
}, never>, Schema.SchemaClass<{
|
|
417
|
+
readonly toolUse: ToolUseBlock;
|
|
418
|
+
} & {
|
|
419
|
+
readonly type: "toolUse";
|
|
420
|
+
}, {
|
|
421
|
+
readonly toolUse: {
|
|
422
|
+
readonly name: string;
|
|
423
|
+
readonly toolUseId: string;
|
|
424
|
+
readonly input: unknown;
|
|
425
|
+
};
|
|
426
|
+
}, never>, Schema.SchemaClass<{
|
|
427
|
+
readonly video: VideoBlock;
|
|
428
|
+
} & {
|
|
429
|
+
readonly type: "video";
|
|
430
|
+
}, {
|
|
431
|
+
readonly video: {
|
|
432
|
+
readonly format: "flv" | "mkv" | "mov" | "mp4" | "mpg" | "mpeg" | "three_gp" | "webm";
|
|
433
|
+
readonly source: {
|
|
434
|
+
readonly bytes: string;
|
|
435
|
+
} | {
|
|
436
|
+
readonly s3Location: {
|
|
437
|
+
readonly uri: string;
|
|
438
|
+
readonly bucketOwner?: string | undefined;
|
|
439
|
+
};
|
|
440
|
+
};
|
|
441
|
+
};
|
|
442
|
+
}, never>]>;
|
|
306
443
|
/**
|
|
307
444
|
* @since 1.0.0
|
|
308
445
|
* @category Schemas
|
|
@@ -316,32 +453,54 @@ declare const Message_base: Schema.Class<Message, {
|
|
|
316
453
|
role: Schema.Literal<["user", "assistant"]>;
|
|
317
454
|
content: Schema.Array$<typeof ContentBlock>;
|
|
318
455
|
}>, never, {
|
|
319
|
-
readonly content: readonly ({
|
|
456
|
+
readonly content: readonly (({
|
|
320
457
|
readonly cachePoint: CachePointBlock;
|
|
321
|
-
}
|
|
458
|
+
} & {
|
|
459
|
+
readonly type: "cachePoint";
|
|
460
|
+
}) | ({
|
|
322
461
|
readonly document: DocumentBlock;
|
|
323
|
-
}
|
|
462
|
+
} & {
|
|
463
|
+
readonly type: "document";
|
|
464
|
+
}) | ({
|
|
324
465
|
readonly guardContent: GuardrailConverseImageBlock | GuardrailConverseTextBlock;
|
|
325
|
-
}
|
|
466
|
+
} & {
|
|
467
|
+
readonly type: "guardContent";
|
|
468
|
+
}) | ({
|
|
326
469
|
readonly image: ImageBlock;
|
|
327
|
-
}
|
|
328
|
-
readonly
|
|
470
|
+
} & {
|
|
471
|
+
readonly type: "image";
|
|
472
|
+
}) | ({
|
|
473
|
+
readonly reasoningContent: ({
|
|
329
474
|
readonly reasoningText: {
|
|
330
475
|
readonly text: string;
|
|
331
476
|
readonly signature?: string | undefined;
|
|
332
477
|
};
|
|
333
|
-
}
|
|
334
|
-
readonly
|
|
335
|
-
}
|
|
336
|
-
|
|
478
|
+
} & {
|
|
479
|
+
readonly type: "reasoning";
|
|
480
|
+
}) | ({
|
|
481
|
+
readonly redactedContent: string;
|
|
482
|
+
} & {
|
|
483
|
+
readonly type: "redacted-reasoning";
|
|
484
|
+
});
|
|
485
|
+
} & {
|
|
486
|
+
readonly type: "reasoningContent";
|
|
487
|
+
}) | ({
|
|
337
488
|
readonly text: string;
|
|
338
|
-
}
|
|
489
|
+
} & {
|
|
490
|
+
readonly type: "text";
|
|
491
|
+
}) | ({
|
|
339
492
|
readonly toolResult: ToolResultBlock;
|
|
340
|
-
}
|
|
493
|
+
} & {
|
|
494
|
+
readonly type: "toolResult";
|
|
495
|
+
}) | ({
|
|
341
496
|
readonly toolUse: ToolUseBlock;
|
|
342
|
-
}
|
|
497
|
+
} & {
|
|
498
|
+
readonly type: "toolUse";
|
|
499
|
+
}) | ({
|
|
343
500
|
readonly video: VideoBlock;
|
|
344
|
-
}
|
|
501
|
+
} & {
|
|
502
|
+
readonly type: "video";
|
|
503
|
+
}))[];
|
|
345
504
|
} & {
|
|
346
505
|
readonly role: "user" | "assistant";
|
|
347
506
|
}, {}, {}>;
|
|
@@ -1143,7 +1302,7 @@ declare const ConverseResponse_base: Schema.Class<ConverseResponse, {
|
|
|
1143
1302
|
export declare class ConverseResponse extends ConverseResponse_base {
|
|
1144
1303
|
}
|
|
1145
1304
|
declare const ReasoningContentBlockDelta_base: Schema.Union<[Schema.Struct<{
|
|
1146
|
-
redactedContent: Schema.
|
|
1305
|
+
redactedContent: typeof Schema.String;
|
|
1147
1306
|
}>, Schema.Struct<{
|
|
1148
1307
|
signature: typeof Schema.String;
|
|
1149
1308
|
}>, Schema.Struct<{
|
|
@@ -1173,11 +1332,11 @@ declare const ToolUseBlockStart_base: Schema.Class<ToolUseBlockStart, {
|
|
|
1173
1332
|
export declare class ToolUseBlockStart extends ToolUseBlockStart_base {
|
|
1174
1333
|
}
|
|
1175
1334
|
declare const ContentBlockStart_base: Schema.Class<ContentBlockStart, {
|
|
1176
|
-
toolUse: typeof ToolUseBlockStart
|
|
1335
|
+
toolUse: Schema.optional<typeof ToolUseBlockStart>;
|
|
1177
1336
|
}, Schema.Struct.Encoded<{
|
|
1178
|
-
toolUse: typeof ToolUseBlockStart
|
|
1337
|
+
toolUse: Schema.optional<typeof ToolUseBlockStart>;
|
|
1179
1338
|
}>, never, {
|
|
1180
|
-
readonly toolUse
|
|
1339
|
+
readonly toolUse?: ToolUseBlockStart | undefined;
|
|
1181
1340
|
}, {}, {}>;
|
|
1182
1341
|
/**
|
|
1183
1342
|
* @since 1.0.0
|
|
@@ -1228,13 +1387,39 @@ declare const ToolUseBlockDelta_base: Schema.Class<ToolUseBlockDelta, {
|
|
|
1228
1387
|
*/
|
|
1229
1388
|
export declare class ToolUseBlockDelta extends ToolUseBlockDelta_base {
|
|
1230
1389
|
}
|
|
1231
|
-
declare const ContentBlockDelta_base: Schema.Union<[Schema.
|
|
1232
|
-
reasoningContent:
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1390
|
+
declare const ContentBlockDelta_base: Schema.Union<[Schema.SchemaClass<{
|
|
1391
|
+
readonly reasoningContent: {
|
|
1392
|
+
readonly redactedContent: string;
|
|
1393
|
+
} | {
|
|
1394
|
+
readonly signature: string;
|
|
1395
|
+
} | {
|
|
1396
|
+
readonly text: string;
|
|
1397
|
+
};
|
|
1398
|
+
} & {
|
|
1399
|
+
readonly type: "reasoningContent";
|
|
1400
|
+
}, {
|
|
1401
|
+
readonly reasoningContent: {
|
|
1402
|
+
readonly redactedContent: string;
|
|
1403
|
+
} | {
|
|
1404
|
+
readonly signature: string;
|
|
1405
|
+
} | {
|
|
1406
|
+
readonly text: string;
|
|
1407
|
+
};
|
|
1408
|
+
}, never>, Schema.SchemaClass<{
|
|
1409
|
+
readonly text: string;
|
|
1410
|
+
} & {
|
|
1411
|
+
readonly type: "text";
|
|
1412
|
+
}, {
|
|
1413
|
+
readonly text: string;
|
|
1414
|
+
}, never>, Schema.SchemaClass<{
|
|
1415
|
+
readonly toolUse: ToolUseBlockDelta;
|
|
1416
|
+
} & {
|
|
1417
|
+
readonly type: "toolUse";
|
|
1418
|
+
}, {
|
|
1419
|
+
readonly toolUse: {
|
|
1420
|
+
readonly input: string;
|
|
1421
|
+
};
|
|
1422
|
+
}, never>]>;
|
|
1238
1423
|
/**
|
|
1239
1424
|
* @since 1.0.0
|
|
1240
1425
|
* @category Schemas
|
|
@@ -1250,19 +1435,25 @@ declare const ContentBlockDeltaEvent_base: Schema.Class<ContentBlockDeltaEvent,
|
|
|
1250
1435
|
}>, never, {
|
|
1251
1436
|
readonly contentBlockIndex: number;
|
|
1252
1437
|
} & {
|
|
1253
|
-
readonly delta: {
|
|
1438
|
+
readonly delta: ({
|
|
1254
1439
|
readonly reasoningContent: {
|
|
1255
|
-
readonly redactedContent:
|
|
1440
|
+
readonly redactedContent: string;
|
|
1256
1441
|
} | {
|
|
1257
1442
|
readonly signature: string;
|
|
1258
1443
|
} | {
|
|
1259
1444
|
readonly text: string;
|
|
1260
1445
|
};
|
|
1261
|
-
}
|
|
1446
|
+
} & {
|
|
1447
|
+
readonly type: "reasoningContent";
|
|
1448
|
+
}) | ({
|
|
1262
1449
|
readonly text: string;
|
|
1263
|
-
}
|
|
1450
|
+
} & {
|
|
1451
|
+
readonly type: "text";
|
|
1452
|
+
}) | ({
|
|
1264
1453
|
readonly toolUse: ToolUseBlockDelta;
|
|
1265
|
-
}
|
|
1454
|
+
} & {
|
|
1455
|
+
readonly type: "toolUse";
|
|
1456
|
+
});
|
|
1266
1457
|
}, {}, {}>;
|
|
1267
1458
|
/**
|
|
1268
1459
|
* @since 1.0.0
|
|
@@ -1367,68 +1558,318 @@ declare const ConverseStreamMetadataEvent_base: Schema.Class<ConverseStreamMetad
|
|
|
1367
1558
|
*/
|
|
1368
1559
|
export declare class ConverseStreamMetadataEvent extends ConverseStreamMetadataEvent_base {
|
|
1369
1560
|
}
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
metadata: Schema.optional<typeof ConverseStreamMetadataEvent>;
|
|
1377
|
-
internalServerException: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1378
|
-
modelStreamErrorException: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1379
|
-
serviceUnavailableException: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1380
|
-
throttlingException: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1381
|
-
validationException: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1382
|
-
}, Schema.Struct.Encoded<{
|
|
1383
|
-
contentBlockStart: Schema.optional<typeof ContentBlockStartEvent>;
|
|
1384
|
-
contentBlockStop: Schema.optional<typeof ContentBlockStopEvent>;
|
|
1385
|
-
contentBlockDelta: Schema.optional<typeof ContentBlockDeltaEvent>;
|
|
1386
|
-
messageStart: Schema.optional<typeof MessageStartEvent>;
|
|
1387
|
-
messageStop: Schema.optional<typeof MessageStopEvent>;
|
|
1388
|
-
metadata: Schema.optional<typeof ConverseStreamMetadataEvent>;
|
|
1389
|
-
internalServerException: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1390
|
-
modelStreamErrorException: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1391
|
-
serviceUnavailableException: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1392
|
-
throttlingException: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1393
|
-
validationException: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
|
|
1394
|
-
}>, never, {
|
|
1395
|
-
readonly contentBlockStart?: ContentBlockStartEvent | undefined;
|
|
1561
|
+
/**
|
|
1562
|
+
* @since 1.0.0
|
|
1563
|
+
* @category Schemas
|
|
1564
|
+
*/
|
|
1565
|
+
export declare const ConverseResponseStreamEvent: Schema.Schema<({
|
|
1566
|
+
readonly messageStart: MessageStartEvent;
|
|
1396
1567
|
} & {
|
|
1397
|
-
readonly
|
|
1568
|
+
readonly type: "messageStart";
|
|
1569
|
+
}) | ({
|
|
1570
|
+
readonly messageStop: MessageStopEvent;
|
|
1398
1571
|
} & {
|
|
1399
|
-
readonly
|
|
1572
|
+
readonly type: "messageStop";
|
|
1573
|
+
}) | ({
|
|
1574
|
+
readonly contentBlockStart: ContentBlockStartEvent;
|
|
1400
1575
|
} & {
|
|
1401
|
-
readonly
|
|
1576
|
+
readonly type: "contentBlockStart";
|
|
1577
|
+
}) | ({
|
|
1578
|
+
readonly contentBlockDelta: ContentBlockDeltaEvent;
|
|
1402
1579
|
} & {
|
|
1403
|
-
readonly
|
|
1580
|
+
readonly type: "contentBlockDelta";
|
|
1581
|
+
}) | ({
|
|
1582
|
+
readonly contentBlockStop: ContentBlockStopEvent;
|
|
1404
1583
|
} & {
|
|
1405
|
-
readonly
|
|
1584
|
+
readonly type: "contentBlockStop";
|
|
1585
|
+
}) | ({
|
|
1586
|
+
readonly metadata: ConverseStreamMetadataEvent;
|
|
1406
1587
|
} & {
|
|
1407
|
-
readonly
|
|
1588
|
+
readonly type: "metadata";
|
|
1589
|
+
}) | ({
|
|
1590
|
+
readonly internalServerException: {
|
|
1408
1591
|
readonly [x: string]: unknown;
|
|
1409
|
-
}
|
|
1592
|
+
};
|
|
1410
1593
|
} & {
|
|
1411
|
-
readonly
|
|
1594
|
+
readonly type: "internalServerException";
|
|
1595
|
+
}) | ({
|
|
1596
|
+
readonly modelStreamErrorException: {
|
|
1412
1597
|
readonly [x: string]: unknown;
|
|
1413
|
-
}
|
|
1598
|
+
};
|
|
1414
1599
|
} & {
|
|
1415
|
-
readonly
|
|
1600
|
+
readonly type: "modelStreamErrorException";
|
|
1601
|
+
}) | ({
|
|
1602
|
+
readonly serviceUnavailableException: {
|
|
1416
1603
|
readonly [x: string]: unknown;
|
|
1417
|
-
}
|
|
1604
|
+
};
|
|
1418
1605
|
} & {
|
|
1419
|
-
readonly
|
|
1606
|
+
readonly type: "serviceUnavailableException";
|
|
1607
|
+
}) | ({
|
|
1608
|
+
readonly throttlingException: {
|
|
1420
1609
|
readonly [x: string]: unknown;
|
|
1421
|
-
}
|
|
1610
|
+
};
|
|
1422
1611
|
} & {
|
|
1423
|
-
readonly
|
|
1612
|
+
readonly type: "throttlingException";
|
|
1613
|
+
}) | ({
|
|
1614
|
+
readonly validationException: {
|
|
1424
1615
|
readonly [x: string]: unknown;
|
|
1425
|
-
}
|
|
1426
|
-
}
|
|
1616
|
+
};
|
|
1617
|
+
} & {
|
|
1618
|
+
readonly type: "validationException";
|
|
1619
|
+
}), {
|
|
1620
|
+
readonly messageStart: {
|
|
1621
|
+
readonly role: "user" | "assistant";
|
|
1622
|
+
};
|
|
1623
|
+
} | {
|
|
1624
|
+
readonly messageStop: {
|
|
1625
|
+
readonly stopReason: "content_filtered" | "end_turn" | "tool_use" | "max_tokens" | "stop_sequence" | "guardrail_intervened";
|
|
1626
|
+
readonly additionalModelResponseFields?: {
|
|
1627
|
+
readonly [x: string]: unknown;
|
|
1628
|
+
} | undefined;
|
|
1629
|
+
};
|
|
1630
|
+
} | {
|
|
1631
|
+
readonly contentBlockStart: {
|
|
1632
|
+
readonly start: {
|
|
1633
|
+
readonly toolUse?: {
|
|
1634
|
+
readonly name: string;
|
|
1635
|
+
readonly toolUseId: string;
|
|
1636
|
+
} | undefined;
|
|
1637
|
+
};
|
|
1638
|
+
readonly contentBlockIndex: number;
|
|
1639
|
+
};
|
|
1640
|
+
} | {
|
|
1641
|
+
readonly contentBlockDelta: {
|
|
1642
|
+
readonly contentBlockIndex: number;
|
|
1643
|
+
readonly delta: {
|
|
1644
|
+
readonly reasoningContent: {
|
|
1645
|
+
readonly redactedContent: string;
|
|
1646
|
+
} | {
|
|
1647
|
+
readonly signature: string;
|
|
1648
|
+
} | {
|
|
1649
|
+
readonly text: string;
|
|
1650
|
+
};
|
|
1651
|
+
} | {
|
|
1652
|
+
readonly text: string;
|
|
1653
|
+
} | {
|
|
1654
|
+
readonly toolUse: {
|
|
1655
|
+
readonly input: string;
|
|
1656
|
+
};
|
|
1657
|
+
};
|
|
1658
|
+
};
|
|
1659
|
+
} | {
|
|
1660
|
+
readonly contentBlockStop: {
|
|
1661
|
+
readonly contentBlockIndex: number;
|
|
1662
|
+
};
|
|
1663
|
+
} | {
|
|
1664
|
+
readonly metadata: {
|
|
1665
|
+
readonly usage: {
|
|
1666
|
+
readonly inputTokens: number;
|
|
1667
|
+
readonly outputTokens: number;
|
|
1668
|
+
readonly totalTokens: number;
|
|
1669
|
+
readonly cacheReadInputTokens?: number | undefined;
|
|
1670
|
+
readonly cacheWriteInputTokens?: number | undefined;
|
|
1671
|
+
};
|
|
1672
|
+
readonly metrics: {
|
|
1673
|
+
readonly latencyMs: number;
|
|
1674
|
+
};
|
|
1675
|
+
readonly trace?: {
|
|
1676
|
+
readonly guardrail?: {
|
|
1677
|
+
readonly actionReason?: string | undefined;
|
|
1678
|
+
readonly inputAssessment?: {
|
|
1679
|
+
readonly [x: string]: {
|
|
1680
|
+
readonly contentPolicy?: {
|
|
1681
|
+
readonly filters: readonly {
|
|
1682
|
+
readonly type: "HATE" | "INSULTS" | "MISCONDUCT" | "PROMPT_ATTACK" | "SEXUAL" | "VIOLENCE";
|
|
1683
|
+
readonly action: "BLOCKED" | "NONE";
|
|
1684
|
+
readonly confidence: "NONE" | "LOW" | "MEDIUM" | "HIGH";
|
|
1685
|
+
readonly detected?: boolean | undefined;
|
|
1686
|
+
readonly filterStrength?: "NONE" | "LOW" | "MEDIUM" | "HIGH" | undefined;
|
|
1687
|
+
}[];
|
|
1688
|
+
} | undefined;
|
|
1689
|
+
readonly contextualGroundingPolicy?: {
|
|
1690
|
+
readonly filters?: readonly {
|
|
1691
|
+
readonly type: "GROUNDING" | "RELEVANCE";
|
|
1692
|
+
readonly action: "BLOCKED" | "NONE";
|
|
1693
|
+
readonly score: number;
|
|
1694
|
+
readonly threshold: number;
|
|
1695
|
+
readonly detected?: boolean | undefined;
|
|
1696
|
+
}[] | undefined;
|
|
1697
|
+
} | undefined;
|
|
1698
|
+
readonly invocationMetrics?: {
|
|
1699
|
+
readonly guardrailCoverage?: {
|
|
1700
|
+
readonly images?: {
|
|
1701
|
+
readonly guarded?: number | undefined;
|
|
1702
|
+
readonly total?: number | undefined;
|
|
1703
|
+
} | undefined;
|
|
1704
|
+
readonly textCharacters?: {
|
|
1705
|
+
readonly guarded?: number | undefined;
|
|
1706
|
+
readonly total?: number | undefined;
|
|
1707
|
+
} | undefined;
|
|
1708
|
+
} | undefined;
|
|
1709
|
+
readonly guardrailProcessingLatency?: number | undefined;
|
|
1710
|
+
readonly usage?: {
|
|
1711
|
+
readonly contentPolicyUnits: number;
|
|
1712
|
+
readonly contextualGroundingPolicyUnits: number;
|
|
1713
|
+
readonly sensitiveInformationPolicyFreeUnits: number;
|
|
1714
|
+
readonly sensitiveInformationPolicyUnits: number;
|
|
1715
|
+
readonly topicPolicyUnits: number;
|
|
1716
|
+
readonly wordPolicyUnits: number;
|
|
1717
|
+
readonly contentPolicyImageUnits?: number | undefined;
|
|
1718
|
+
} | undefined;
|
|
1719
|
+
} | undefined;
|
|
1720
|
+
readonly sensitiveInformationPolicy?: {
|
|
1721
|
+
readonly piiEntities: readonly {
|
|
1722
|
+
readonly type: "ADDRESS" | "AGE" | "AWS_ACCESS_KEY" | "AWS_SECRET_KEY" | "CA_HEALTH_NUMBER" | "CA_SOCIAL_INSURANCE_NUMBER" | "CREDIT_DEBIT_CARD_CVV" | "CREDIT_DEBIT_CARD_EXPIRY" | "CREDIT_DEBIT_CARD_NUMBER" | "DRIVER_ID" | "EMAIL" | "INTERNATIONAL_BANK_ACCOUNT_NUMBER" | "IP_ADDRESS" | "LICENSE_PLATE" | "MAC_ADDRESS" | "NAME" | "PASSWORD" | "PHONE" | "PIN" | "SWIFT_CODE" | "UK_NATIONAL_HEALTH_SERVICE_NUMBER" | "UK_NATIONAL_INSURANCE_NUMBER" | "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER" | "URL" | "USERNAME" | "US_BANK_ACCOUNT_NUMBER" | "US_BANK_ROUTING_NUMBER" | "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER" | "US_PASSPORT_NUMBER" | "US_SOCIAL_SECURITY_NUMBER" | "VEHICLE_IDENTIFICATION_NUMBER";
|
|
1723
|
+
readonly action: "BLOCKED" | "NONE" | "ANONYMIZED";
|
|
1724
|
+
readonly match: string;
|
|
1725
|
+
readonly detected?: boolean | undefined;
|
|
1726
|
+
}[];
|
|
1727
|
+
readonly regexes: readonly {
|
|
1728
|
+
readonly action: "BLOCKED" | "NONE" | "ANONYMIZED";
|
|
1729
|
+
readonly name?: string | undefined;
|
|
1730
|
+
readonly detected?: boolean | undefined;
|
|
1731
|
+
readonly match?: string | undefined;
|
|
1732
|
+
readonly regex?: string | undefined;
|
|
1733
|
+
}[];
|
|
1734
|
+
} | undefined;
|
|
1735
|
+
readonly topicPolicy?: {
|
|
1736
|
+
readonly topics: readonly {
|
|
1737
|
+
readonly type: "DENY";
|
|
1738
|
+
readonly name: string;
|
|
1739
|
+
readonly action: "BLOCKED" | "NONE";
|
|
1740
|
+
readonly detected?: boolean | undefined;
|
|
1741
|
+
}[];
|
|
1742
|
+
} | undefined;
|
|
1743
|
+
readonly wordPolicy?: {
|
|
1744
|
+
readonly customWords: {
|
|
1745
|
+
readonly action: "BLOCKED" | "NONE";
|
|
1746
|
+
readonly match: string;
|
|
1747
|
+
readonly detected?: boolean | undefined;
|
|
1748
|
+
};
|
|
1749
|
+
readonly managedWordLists: {
|
|
1750
|
+
readonly type: "PROFANITY";
|
|
1751
|
+
readonly action: "BLOCKED" | "NONE";
|
|
1752
|
+
readonly match: string;
|
|
1753
|
+
readonly detected?: boolean | undefined;
|
|
1754
|
+
};
|
|
1755
|
+
} | undefined;
|
|
1756
|
+
};
|
|
1757
|
+
} | undefined;
|
|
1758
|
+
readonly modelOutput?: readonly string[] | undefined;
|
|
1759
|
+
readonly outputAssessments?: {
|
|
1760
|
+
readonly [x: string]: {
|
|
1761
|
+
readonly contentPolicy?: {
|
|
1762
|
+
readonly filters: readonly {
|
|
1763
|
+
readonly type: "HATE" | "INSULTS" | "MISCONDUCT" | "PROMPT_ATTACK" | "SEXUAL" | "VIOLENCE";
|
|
1764
|
+
readonly action: "BLOCKED" | "NONE";
|
|
1765
|
+
readonly confidence: "NONE" | "LOW" | "MEDIUM" | "HIGH";
|
|
1766
|
+
readonly detected?: boolean | undefined;
|
|
1767
|
+
readonly filterStrength?: "NONE" | "LOW" | "MEDIUM" | "HIGH" | undefined;
|
|
1768
|
+
}[];
|
|
1769
|
+
} | undefined;
|
|
1770
|
+
readonly contextualGroundingPolicy?: {
|
|
1771
|
+
readonly filters?: readonly {
|
|
1772
|
+
readonly type: "GROUNDING" | "RELEVANCE";
|
|
1773
|
+
readonly action: "BLOCKED" | "NONE";
|
|
1774
|
+
readonly score: number;
|
|
1775
|
+
readonly threshold: number;
|
|
1776
|
+
readonly detected?: boolean | undefined;
|
|
1777
|
+
}[] | undefined;
|
|
1778
|
+
} | undefined;
|
|
1779
|
+
readonly invocationMetrics?: {
|
|
1780
|
+
readonly guardrailCoverage?: {
|
|
1781
|
+
readonly images?: {
|
|
1782
|
+
readonly guarded?: number | undefined;
|
|
1783
|
+
readonly total?: number | undefined;
|
|
1784
|
+
} | undefined;
|
|
1785
|
+
readonly textCharacters?: {
|
|
1786
|
+
readonly guarded?: number | undefined;
|
|
1787
|
+
readonly total?: number | undefined;
|
|
1788
|
+
} | undefined;
|
|
1789
|
+
} | undefined;
|
|
1790
|
+
readonly guardrailProcessingLatency?: number | undefined;
|
|
1791
|
+
readonly usage?: {
|
|
1792
|
+
readonly contentPolicyUnits: number;
|
|
1793
|
+
readonly contextualGroundingPolicyUnits: number;
|
|
1794
|
+
readonly sensitiveInformationPolicyFreeUnits: number;
|
|
1795
|
+
readonly sensitiveInformationPolicyUnits: number;
|
|
1796
|
+
readonly topicPolicyUnits: number;
|
|
1797
|
+
readonly wordPolicyUnits: number;
|
|
1798
|
+
readonly contentPolicyImageUnits?: number | undefined;
|
|
1799
|
+
} | undefined;
|
|
1800
|
+
} | undefined;
|
|
1801
|
+
readonly sensitiveInformationPolicy?: {
|
|
1802
|
+
readonly piiEntities: readonly {
|
|
1803
|
+
readonly type: "ADDRESS" | "AGE" | "AWS_ACCESS_KEY" | "AWS_SECRET_KEY" | "CA_HEALTH_NUMBER" | "CA_SOCIAL_INSURANCE_NUMBER" | "CREDIT_DEBIT_CARD_CVV" | "CREDIT_DEBIT_CARD_EXPIRY" | "CREDIT_DEBIT_CARD_NUMBER" | "DRIVER_ID" | "EMAIL" | "INTERNATIONAL_BANK_ACCOUNT_NUMBER" | "IP_ADDRESS" | "LICENSE_PLATE" | "MAC_ADDRESS" | "NAME" | "PASSWORD" | "PHONE" | "PIN" | "SWIFT_CODE" | "UK_NATIONAL_HEALTH_SERVICE_NUMBER" | "UK_NATIONAL_INSURANCE_NUMBER" | "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER" | "URL" | "USERNAME" | "US_BANK_ACCOUNT_NUMBER" | "US_BANK_ROUTING_NUMBER" | "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER" | "US_PASSPORT_NUMBER" | "US_SOCIAL_SECURITY_NUMBER" | "VEHICLE_IDENTIFICATION_NUMBER";
|
|
1804
|
+
readonly action: "BLOCKED" | "NONE" | "ANONYMIZED";
|
|
1805
|
+
readonly match: string;
|
|
1806
|
+
readonly detected?: boolean | undefined;
|
|
1807
|
+
}[];
|
|
1808
|
+
readonly regexes: readonly {
|
|
1809
|
+
readonly action: "BLOCKED" | "NONE" | "ANONYMIZED";
|
|
1810
|
+
readonly name?: string | undefined;
|
|
1811
|
+
readonly detected?: boolean | undefined;
|
|
1812
|
+
readonly match?: string | undefined;
|
|
1813
|
+
readonly regex?: string | undefined;
|
|
1814
|
+
}[];
|
|
1815
|
+
} | undefined;
|
|
1816
|
+
readonly topicPolicy?: {
|
|
1817
|
+
readonly topics: readonly {
|
|
1818
|
+
readonly type: "DENY";
|
|
1819
|
+
readonly name: string;
|
|
1820
|
+
readonly action: "BLOCKED" | "NONE";
|
|
1821
|
+
readonly detected?: boolean | undefined;
|
|
1822
|
+
}[];
|
|
1823
|
+
} | undefined;
|
|
1824
|
+
readonly wordPolicy?: {
|
|
1825
|
+
readonly customWords: {
|
|
1826
|
+
readonly action: "BLOCKED" | "NONE";
|
|
1827
|
+
readonly match: string;
|
|
1828
|
+
readonly detected?: boolean | undefined;
|
|
1829
|
+
};
|
|
1830
|
+
readonly managedWordLists: {
|
|
1831
|
+
readonly type: "PROFANITY";
|
|
1832
|
+
readonly action: "BLOCKED" | "NONE";
|
|
1833
|
+
readonly match: string;
|
|
1834
|
+
readonly detected?: boolean | undefined;
|
|
1835
|
+
};
|
|
1836
|
+
} | undefined;
|
|
1837
|
+
};
|
|
1838
|
+
} | undefined;
|
|
1839
|
+
} | undefined;
|
|
1840
|
+
readonly promptRouter?: {
|
|
1841
|
+
readonly invokedModelId?: string | undefined;
|
|
1842
|
+
} | undefined;
|
|
1843
|
+
} | undefined;
|
|
1844
|
+
readonly performanceConfig?: {
|
|
1845
|
+
readonly latency?: "standard" | "optimized" | undefined;
|
|
1846
|
+
} | undefined;
|
|
1847
|
+
};
|
|
1848
|
+
} | {
|
|
1849
|
+
readonly internalServerException: {
|
|
1850
|
+
readonly [x: string]: unknown;
|
|
1851
|
+
};
|
|
1852
|
+
} | {
|
|
1853
|
+
readonly modelStreamErrorException: {
|
|
1854
|
+
readonly [x: string]: unknown;
|
|
1855
|
+
};
|
|
1856
|
+
} | {
|
|
1857
|
+
readonly serviceUnavailableException: {
|
|
1858
|
+
readonly [x: string]: unknown;
|
|
1859
|
+
};
|
|
1860
|
+
} | {
|
|
1861
|
+
readonly throttlingException: {
|
|
1862
|
+
readonly [x: string]: unknown;
|
|
1863
|
+
};
|
|
1864
|
+
} | {
|
|
1865
|
+
readonly validationException: {
|
|
1866
|
+
readonly [x: string]: unknown;
|
|
1867
|
+
};
|
|
1868
|
+
}, never>;
|
|
1427
1869
|
/**
|
|
1428
1870
|
* @since 1.0.0
|
|
1429
|
-
* @category
|
|
1871
|
+
* @category Models
|
|
1430
1872
|
*/
|
|
1431
|
-
export
|
|
1432
|
-
}
|
|
1873
|
+
export type ConverseResponseStreamEvent = typeof ConverseResponseStreamEvent.Type;
|
|
1433
1874
|
export {};
|
|
1434
1875
|
//# sourceMappingURL=AmazonBedrockSchema.d.ts.map
|