types-boto3-bedrock-runtime 1.36.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1032 @@
1
+ """
2
+ Type annotations for bedrock-runtime service type definitions.
3
+
4
+ [Documentation](https://youtype.github.io/types_boto3_docs/types_boto3_bedrock_runtime/type_defs/)
5
+
6
+ Usage::
7
+
8
+ ```python
9
+ from types_boto3_bedrock_runtime.type_defs import GuardrailOutputContentTypeDef
10
+
11
+ data: GuardrailOutputContentTypeDef = ...
12
+ ```
13
+
14
+ Copyright 2025 Vlad Emelianov
15
+ """
16
+
17
+ from __future__ import annotations
18
+
19
+ import sys
20
+ from datetime import datetime
21
+ from typing import IO, Any, Union
22
+
23
+ from botocore.eventstream import EventStream
24
+ from botocore.response import StreamingBody
25
+
26
+ from .literals import (
27
+ AsyncInvokeStatusType,
28
+ ConversationRoleType,
29
+ DocumentFormatType,
30
+ GuardrailActionType,
31
+ GuardrailContentFilterConfidenceType,
32
+ GuardrailContentFilterStrengthType,
33
+ GuardrailContentFilterTypeType,
34
+ GuardrailContentQualifierType,
35
+ GuardrailContentSourceType,
36
+ GuardrailContextualGroundingFilterTypeType,
37
+ GuardrailContextualGroundingPolicyActionType,
38
+ GuardrailConverseContentQualifierType,
39
+ GuardrailConverseImageFormatType,
40
+ GuardrailImageFormatType,
41
+ GuardrailPiiEntityTypeType,
42
+ GuardrailSensitiveInformationPolicyActionType,
43
+ GuardrailStreamProcessingModeType,
44
+ GuardrailTraceType,
45
+ ImageFormatType,
46
+ PerformanceConfigLatencyType,
47
+ SortOrderType,
48
+ StopReasonType,
49
+ ToolResultStatusType,
50
+ TraceType,
51
+ VideoFormatType,
52
+ )
53
+
54
+ if sys.version_info >= (3, 9):
55
+ from builtins import dict as Dict
56
+ from builtins import list as List
57
+ from collections.abc import Mapping, Sequence
58
+ else:
59
+ from typing import Dict, List, Mapping, Sequence
60
+ if sys.version_info >= (3, 12):
61
+ from typing import Literal, NotRequired, TypedDict
62
+ else:
63
+ from typing_extensions import Literal, NotRequired, TypedDict
64
+
65
+
66
+ __all__ = (
67
+ "ApplyGuardrailRequestRequestTypeDef",
68
+ "ApplyGuardrailResponseTypeDef",
69
+ "AsyncInvokeOutputDataConfigTypeDef",
70
+ "AsyncInvokeS3OutputDataConfigTypeDef",
71
+ "AsyncInvokeSummaryTypeDef",
72
+ "BlobTypeDef",
73
+ "ContentBlockDeltaEventTypeDef",
74
+ "ContentBlockDeltaTypeDef",
75
+ "ContentBlockOutputTypeDef",
76
+ "ContentBlockStartEventTypeDef",
77
+ "ContentBlockStartTypeDef",
78
+ "ContentBlockStopEventTypeDef",
79
+ "ContentBlockTypeDef",
80
+ "ContentBlockUnionTypeDef",
81
+ "ConverseMetricsTypeDef",
82
+ "ConverseOutputTypeDef",
83
+ "ConverseRequestRequestTypeDef",
84
+ "ConverseResponseTypeDef",
85
+ "ConverseStreamMetadataEventTypeDef",
86
+ "ConverseStreamMetricsTypeDef",
87
+ "ConverseStreamOutputTypeDef",
88
+ "ConverseStreamRequestRequestTypeDef",
89
+ "ConverseStreamResponseTypeDef",
90
+ "ConverseStreamTraceTypeDef",
91
+ "ConverseTraceTypeDef",
92
+ "DocumentBlockOutputTypeDef",
93
+ "DocumentBlockTypeDef",
94
+ "DocumentBlockUnionTypeDef",
95
+ "DocumentSourceOutputTypeDef",
96
+ "DocumentSourceTypeDef",
97
+ "DocumentSourceUnionTypeDef",
98
+ "GetAsyncInvokeRequestRequestTypeDef",
99
+ "GetAsyncInvokeResponseTypeDef",
100
+ "GuardrailAssessmentTypeDef",
101
+ "GuardrailConfigurationTypeDef",
102
+ "GuardrailContentBlockTypeDef",
103
+ "GuardrailContentFilterTypeDef",
104
+ "GuardrailContentPolicyAssessmentTypeDef",
105
+ "GuardrailContextualGroundingFilterTypeDef",
106
+ "GuardrailContextualGroundingPolicyAssessmentTypeDef",
107
+ "GuardrailConverseContentBlockOutputTypeDef",
108
+ "GuardrailConverseContentBlockTypeDef",
109
+ "GuardrailConverseContentBlockUnionTypeDef",
110
+ "GuardrailConverseImageBlockOutputTypeDef",
111
+ "GuardrailConverseImageBlockTypeDef",
112
+ "GuardrailConverseImageBlockUnionTypeDef",
113
+ "GuardrailConverseImageSourceOutputTypeDef",
114
+ "GuardrailConverseImageSourceTypeDef",
115
+ "GuardrailConverseImageSourceUnionTypeDef",
116
+ "GuardrailConverseTextBlockOutputTypeDef",
117
+ "GuardrailConverseTextBlockTypeDef",
118
+ "GuardrailConverseTextBlockUnionTypeDef",
119
+ "GuardrailCoverageTypeDef",
120
+ "GuardrailCustomWordTypeDef",
121
+ "GuardrailImageBlockTypeDef",
122
+ "GuardrailImageCoverageTypeDef",
123
+ "GuardrailImageSourceTypeDef",
124
+ "GuardrailInvocationMetricsTypeDef",
125
+ "GuardrailManagedWordTypeDef",
126
+ "GuardrailOutputContentTypeDef",
127
+ "GuardrailPiiEntityFilterTypeDef",
128
+ "GuardrailRegexFilterTypeDef",
129
+ "GuardrailSensitiveInformationPolicyAssessmentTypeDef",
130
+ "GuardrailStreamConfigurationTypeDef",
131
+ "GuardrailTextBlockTypeDef",
132
+ "GuardrailTextCharactersCoverageTypeDef",
133
+ "GuardrailTopicPolicyAssessmentTypeDef",
134
+ "GuardrailTopicTypeDef",
135
+ "GuardrailTraceAssessmentTypeDef",
136
+ "GuardrailUsageTypeDef",
137
+ "GuardrailWordPolicyAssessmentTypeDef",
138
+ "ImageBlockOutputTypeDef",
139
+ "ImageBlockTypeDef",
140
+ "ImageBlockUnionTypeDef",
141
+ "ImageSourceOutputTypeDef",
142
+ "ImageSourceTypeDef",
143
+ "ImageSourceUnionTypeDef",
144
+ "InferenceConfigurationTypeDef",
145
+ "InternalServerExceptionTypeDef",
146
+ "InvokeModelRequestRequestTypeDef",
147
+ "InvokeModelResponseTypeDef",
148
+ "InvokeModelWithResponseStreamRequestRequestTypeDef",
149
+ "InvokeModelWithResponseStreamResponseTypeDef",
150
+ "ListAsyncInvokesRequestPaginateTypeDef",
151
+ "ListAsyncInvokesRequestRequestTypeDef",
152
+ "ListAsyncInvokesResponseTypeDef",
153
+ "MessageOutputTypeDef",
154
+ "MessageStartEventTypeDef",
155
+ "MessageStopEventTypeDef",
156
+ "MessageTypeDef",
157
+ "MessageUnionTypeDef",
158
+ "ModelStreamErrorExceptionTypeDef",
159
+ "ModelTimeoutExceptionTypeDef",
160
+ "PaginatorConfigTypeDef",
161
+ "PayloadPartTypeDef",
162
+ "PerformanceConfigurationTypeDef",
163
+ "PromptRouterTraceTypeDef",
164
+ "PromptVariableValuesTypeDef",
165
+ "ResponseMetadataTypeDef",
166
+ "ResponseStreamTypeDef",
167
+ "S3LocationTypeDef",
168
+ "ServiceUnavailableExceptionTypeDef",
169
+ "SpecificToolChoiceTypeDef",
170
+ "StartAsyncInvokeRequestRequestTypeDef",
171
+ "StartAsyncInvokeResponseTypeDef",
172
+ "SystemContentBlockTypeDef",
173
+ "TagTypeDef",
174
+ "ThrottlingExceptionTypeDef",
175
+ "TimestampTypeDef",
176
+ "TokenUsageTypeDef",
177
+ "ToolChoiceTypeDef",
178
+ "ToolConfigurationTypeDef",
179
+ "ToolInputSchemaTypeDef",
180
+ "ToolResultBlockOutputTypeDef",
181
+ "ToolResultBlockTypeDef",
182
+ "ToolResultBlockUnionTypeDef",
183
+ "ToolResultContentBlockOutputTypeDef",
184
+ "ToolResultContentBlockTypeDef",
185
+ "ToolResultContentBlockUnionTypeDef",
186
+ "ToolSpecificationTypeDef",
187
+ "ToolTypeDef",
188
+ "ToolUseBlockDeltaTypeDef",
189
+ "ToolUseBlockOutputTypeDef",
190
+ "ToolUseBlockStartTypeDef",
191
+ "ToolUseBlockTypeDef",
192
+ "ToolUseBlockUnionTypeDef",
193
+ "ValidationExceptionTypeDef",
194
+ "VideoBlockOutputTypeDef",
195
+ "VideoBlockTypeDef",
196
+ "VideoBlockUnionTypeDef",
197
+ "VideoSourceOutputTypeDef",
198
+ "VideoSourceTypeDef",
199
+ "VideoSourceUnionTypeDef",
200
+ )
201
+
202
+
203
+ class GuardrailOutputContentTypeDef(TypedDict):
204
+ text: NotRequired[str]
205
+
206
+
207
+ class GuardrailUsageTypeDef(TypedDict):
208
+ topicPolicyUnits: int
209
+ contentPolicyUnits: int
210
+ wordPolicyUnits: int
211
+ sensitiveInformationPolicyUnits: int
212
+ sensitiveInformationPolicyFreeUnits: int
213
+ contextualGroundingPolicyUnits: int
214
+
215
+
216
+ class ResponseMetadataTypeDef(TypedDict):
217
+ RequestId: str
218
+ HTTPStatusCode: int
219
+ HTTPHeaders: Dict[str, str]
220
+ RetryAttempts: int
221
+ HostId: NotRequired[str]
222
+
223
+
224
+ class AsyncInvokeS3OutputDataConfigTypeDef(TypedDict):
225
+ s3Uri: str
226
+ kmsKeyId: NotRequired[str]
227
+ bucketOwner: NotRequired[str]
228
+
229
+
230
+ BlobTypeDef = Union[str, bytes, IO[Any], StreamingBody]
231
+ ToolUseBlockDeltaTypeDef = TypedDict(
232
+ "ToolUseBlockDeltaTypeDef",
233
+ {
234
+ "input": str,
235
+ },
236
+ )
237
+ ToolUseBlockOutputTypeDef = TypedDict(
238
+ "ToolUseBlockOutputTypeDef",
239
+ {
240
+ "toolUseId": str,
241
+ "name": str,
242
+ "input": Dict[str, Any],
243
+ },
244
+ )
245
+
246
+
247
+ class ToolUseBlockStartTypeDef(TypedDict):
248
+ toolUseId: str
249
+ name: str
250
+
251
+
252
+ class ContentBlockStopEventTypeDef(TypedDict):
253
+ contentBlockIndex: int
254
+
255
+
256
+ class ConverseMetricsTypeDef(TypedDict):
257
+ latencyMs: int
258
+
259
+
260
+ class GuardrailConfigurationTypeDef(TypedDict):
261
+ guardrailIdentifier: str
262
+ guardrailVersion: str
263
+ trace: NotRequired[GuardrailTraceType]
264
+
265
+
266
+ class InferenceConfigurationTypeDef(TypedDict):
267
+ maxTokens: NotRequired[int]
268
+ temperature: NotRequired[float]
269
+ topP: NotRequired[float]
270
+ stopSequences: NotRequired[Sequence[str]]
271
+
272
+
273
+ class PerformanceConfigurationTypeDef(TypedDict):
274
+ latency: NotRequired[PerformanceConfigLatencyType]
275
+
276
+
277
+ class PromptVariableValuesTypeDef(TypedDict):
278
+ text: NotRequired[str]
279
+
280
+
281
+ class TokenUsageTypeDef(TypedDict):
282
+ inputTokens: int
283
+ outputTokens: int
284
+ totalTokens: int
285
+
286
+
287
+ class ConverseStreamMetricsTypeDef(TypedDict):
288
+ latencyMs: int
289
+
290
+
291
+ class InternalServerExceptionTypeDef(TypedDict):
292
+ message: NotRequired[str]
293
+
294
+
295
+ class MessageStartEventTypeDef(TypedDict):
296
+ role: ConversationRoleType
297
+
298
+
299
+ class MessageStopEventTypeDef(TypedDict):
300
+ stopReason: StopReasonType
301
+ additionalModelResponseFields: NotRequired[Dict[str, Any]]
302
+
303
+
304
+ class ModelStreamErrorExceptionTypeDef(TypedDict):
305
+ message: NotRequired[str]
306
+ originalStatusCode: NotRequired[int]
307
+ originalMessage: NotRequired[str]
308
+
309
+
310
+ class ServiceUnavailableExceptionTypeDef(TypedDict):
311
+ message: NotRequired[str]
312
+
313
+
314
+ class ThrottlingExceptionTypeDef(TypedDict):
315
+ message: NotRequired[str]
316
+
317
+
318
+ class ValidationExceptionTypeDef(TypedDict):
319
+ message: NotRequired[str]
320
+
321
+
322
+ class GuardrailStreamConfigurationTypeDef(TypedDict):
323
+ guardrailIdentifier: str
324
+ guardrailVersion: str
325
+ trace: NotRequired[GuardrailTraceType]
326
+ streamProcessingMode: NotRequired[GuardrailStreamProcessingModeType]
327
+
328
+
329
+ class PromptRouterTraceTypeDef(TypedDict):
330
+ invokedModelId: NotRequired[str]
331
+
332
+
333
+ DocumentSourceOutputTypeDef = TypedDict(
334
+ "DocumentSourceOutputTypeDef",
335
+ {
336
+ "bytes": NotRequired[bytes],
337
+ },
338
+ )
339
+
340
+
341
+ class GetAsyncInvokeRequestRequestTypeDef(TypedDict):
342
+ invocationArn: str
343
+
344
+
345
+ class GuardrailTextBlockTypeDef(TypedDict):
346
+ text: str
347
+ qualifiers: NotRequired[Sequence[GuardrailContentQualifierType]]
348
+
349
+
350
+ GuardrailContentFilterTypeDef = TypedDict(
351
+ "GuardrailContentFilterTypeDef",
352
+ {
353
+ "type": GuardrailContentFilterTypeType,
354
+ "confidence": GuardrailContentFilterConfidenceType,
355
+ "action": Literal["BLOCKED"],
356
+ "filterStrength": NotRequired[GuardrailContentFilterStrengthType],
357
+ },
358
+ )
359
+ GuardrailContextualGroundingFilterTypeDef = TypedDict(
360
+ "GuardrailContextualGroundingFilterTypeDef",
361
+ {
362
+ "type": GuardrailContextualGroundingFilterTypeType,
363
+ "threshold": float,
364
+ "score": float,
365
+ "action": GuardrailContextualGroundingPolicyActionType,
366
+ },
367
+ )
368
+
369
+
370
+ class GuardrailConverseTextBlockOutputTypeDef(TypedDict):
371
+ text: str
372
+ qualifiers: NotRequired[List[GuardrailConverseContentQualifierType]]
373
+
374
+
375
+ GuardrailConverseImageSourceOutputTypeDef = TypedDict(
376
+ "GuardrailConverseImageSourceOutputTypeDef",
377
+ {
378
+ "bytes": NotRequired[bytes],
379
+ },
380
+ )
381
+
382
+
383
+ class GuardrailConverseTextBlockTypeDef(TypedDict):
384
+ text: str
385
+ qualifiers: NotRequired[Sequence[GuardrailConverseContentQualifierType]]
386
+
387
+
388
+ class GuardrailImageCoverageTypeDef(TypedDict):
389
+ guarded: NotRequired[int]
390
+ total: NotRequired[int]
391
+
392
+
393
+ class GuardrailTextCharactersCoverageTypeDef(TypedDict):
394
+ guarded: NotRequired[int]
395
+ total: NotRequired[int]
396
+
397
+
398
+ class GuardrailCustomWordTypeDef(TypedDict):
399
+ match: str
400
+ action: Literal["BLOCKED"]
401
+
402
+
403
+ GuardrailManagedWordTypeDef = TypedDict(
404
+ "GuardrailManagedWordTypeDef",
405
+ {
406
+ "match": str,
407
+ "type": Literal["PROFANITY"],
408
+ "action": Literal["BLOCKED"],
409
+ },
410
+ )
411
+ GuardrailPiiEntityFilterTypeDef = TypedDict(
412
+ "GuardrailPiiEntityFilterTypeDef",
413
+ {
414
+ "match": str,
415
+ "type": GuardrailPiiEntityTypeType,
416
+ "action": GuardrailSensitiveInformationPolicyActionType,
417
+ },
418
+ )
419
+
420
+
421
+ class GuardrailRegexFilterTypeDef(TypedDict):
422
+ action: GuardrailSensitiveInformationPolicyActionType
423
+ name: NotRequired[str]
424
+ match: NotRequired[str]
425
+ regex: NotRequired[str]
426
+
427
+
428
+ GuardrailTopicTypeDef = TypedDict(
429
+ "GuardrailTopicTypeDef",
430
+ {
431
+ "name": str,
432
+ "type": Literal["DENY"],
433
+ "action": Literal["BLOCKED"],
434
+ },
435
+ )
436
+ ImageSourceOutputTypeDef = TypedDict(
437
+ "ImageSourceOutputTypeDef",
438
+ {
439
+ "bytes": NotRequired[bytes],
440
+ },
441
+ )
442
+
443
+
444
+ class PaginatorConfigTypeDef(TypedDict):
445
+ MaxItems: NotRequired[int]
446
+ PageSize: NotRequired[int]
447
+ StartingToken: NotRequired[str]
448
+
449
+
450
+ TimestampTypeDef = Union[datetime, str]
451
+
452
+
453
+ class ModelTimeoutExceptionTypeDef(TypedDict):
454
+ message: NotRequired[str]
455
+
456
+
457
+ PayloadPartTypeDef = TypedDict(
458
+ "PayloadPartTypeDef",
459
+ {
460
+ "bytes": NotRequired[bytes],
461
+ },
462
+ )
463
+
464
+
465
+ class S3LocationTypeDef(TypedDict):
466
+ uri: str
467
+ bucketOwner: NotRequired[str]
468
+
469
+
470
+ class SpecificToolChoiceTypeDef(TypedDict):
471
+ name: str
472
+
473
+
474
+ class TagTypeDef(TypedDict):
475
+ key: str
476
+ value: str
477
+
478
+
479
+ class ToolInputSchemaTypeDef(TypedDict):
480
+ json: NotRequired[Mapping[str, Any]]
481
+
482
+
483
+ ToolUseBlockTypeDef = TypedDict(
484
+ "ToolUseBlockTypeDef",
485
+ {
486
+ "toolUseId": str,
487
+ "name": str,
488
+ "input": Mapping[str, Any],
489
+ },
490
+ )
491
+
492
+
493
+ class InvokeModelResponseTypeDef(TypedDict):
494
+ body: StreamingBody
495
+ contentType: str
496
+ performanceConfigLatency: PerformanceConfigLatencyType
497
+ ResponseMetadata: ResponseMetadataTypeDef
498
+
499
+
500
+ class StartAsyncInvokeResponseTypeDef(TypedDict):
501
+ invocationArn: str
502
+ ResponseMetadata: ResponseMetadataTypeDef
503
+
504
+
505
+ class AsyncInvokeOutputDataConfigTypeDef(TypedDict):
506
+ s3OutputDataConfig: NotRequired[AsyncInvokeS3OutputDataConfigTypeDef]
507
+
508
+
509
+ DocumentSourceTypeDef = TypedDict(
510
+ "DocumentSourceTypeDef",
511
+ {
512
+ "bytes": NotRequired[BlobTypeDef],
513
+ },
514
+ )
515
+ GuardrailConverseImageSourceTypeDef = TypedDict(
516
+ "GuardrailConverseImageSourceTypeDef",
517
+ {
518
+ "bytes": NotRequired[BlobTypeDef],
519
+ },
520
+ )
521
+ GuardrailImageSourceTypeDef = TypedDict(
522
+ "GuardrailImageSourceTypeDef",
523
+ {
524
+ "bytes": NotRequired[BlobTypeDef],
525
+ },
526
+ )
527
+ ImageSourceTypeDef = TypedDict(
528
+ "ImageSourceTypeDef",
529
+ {
530
+ "bytes": NotRequired[BlobTypeDef],
531
+ },
532
+ )
533
+
534
+
535
+ class InvokeModelRequestRequestTypeDef(TypedDict):
536
+ modelId: str
537
+ body: NotRequired[BlobTypeDef]
538
+ contentType: NotRequired[str]
539
+ accept: NotRequired[str]
540
+ trace: NotRequired[TraceType]
541
+ guardrailIdentifier: NotRequired[str]
542
+ guardrailVersion: NotRequired[str]
543
+ performanceConfigLatency: NotRequired[PerformanceConfigLatencyType]
544
+
545
+
546
+ class InvokeModelWithResponseStreamRequestRequestTypeDef(TypedDict):
547
+ modelId: str
548
+ body: NotRequired[BlobTypeDef]
549
+ contentType: NotRequired[str]
550
+ accept: NotRequired[str]
551
+ trace: NotRequired[TraceType]
552
+ guardrailIdentifier: NotRequired[str]
553
+ guardrailVersion: NotRequired[str]
554
+ performanceConfigLatency: NotRequired[PerformanceConfigLatencyType]
555
+
556
+
557
+ class ContentBlockDeltaTypeDef(TypedDict):
558
+ text: NotRequired[str]
559
+ toolUse: NotRequired[ToolUseBlockDeltaTypeDef]
560
+
561
+
562
+ class ContentBlockStartTypeDef(TypedDict):
563
+ toolUse: NotRequired[ToolUseBlockStartTypeDef]
564
+
565
+
566
+ DocumentBlockOutputTypeDef = TypedDict(
567
+ "DocumentBlockOutputTypeDef",
568
+ {
569
+ "format": DocumentFormatType,
570
+ "name": str,
571
+ "source": DocumentSourceOutputTypeDef,
572
+ },
573
+ )
574
+
575
+
576
+ class GuardrailContentPolicyAssessmentTypeDef(TypedDict):
577
+ filters: List[GuardrailContentFilterTypeDef]
578
+
579
+
580
+ class GuardrailContextualGroundingPolicyAssessmentTypeDef(TypedDict):
581
+ filters: NotRequired[List[GuardrailContextualGroundingFilterTypeDef]]
582
+
583
+
584
+ GuardrailConverseImageBlockOutputTypeDef = TypedDict(
585
+ "GuardrailConverseImageBlockOutputTypeDef",
586
+ {
587
+ "format": GuardrailConverseImageFormatType,
588
+ "source": GuardrailConverseImageSourceOutputTypeDef,
589
+ },
590
+ )
591
+ GuardrailConverseTextBlockUnionTypeDef = Union[
592
+ GuardrailConverseTextBlockTypeDef, GuardrailConverseTextBlockOutputTypeDef
593
+ ]
594
+
595
+
596
+ class GuardrailCoverageTypeDef(TypedDict):
597
+ textCharacters: NotRequired[GuardrailTextCharactersCoverageTypeDef]
598
+ images: NotRequired[GuardrailImageCoverageTypeDef]
599
+
600
+
601
+ class GuardrailWordPolicyAssessmentTypeDef(TypedDict):
602
+ customWords: List[GuardrailCustomWordTypeDef]
603
+ managedWordLists: List[GuardrailManagedWordTypeDef]
604
+
605
+
606
+ class GuardrailSensitiveInformationPolicyAssessmentTypeDef(TypedDict):
607
+ piiEntities: List[GuardrailPiiEntityFilterTypeDef]
608
+ regexes: List[GuardrailRegexFilterTypeDef]
609
+
610
+
611
+ class GuardrailTopicPolicyAssessmentTypeDef(TypedDict):
612
+ topics: List[GuardrailTopicTypeDef]
613
+
614
+
615
+ ImageBlockOutputTypeDef = TypedDict(
616
+ "ImageBlockOutputTypeDef",
617
+ {
618
+ "format": ImageFormatType,
619
+ "source": ImageSourceOutputTypeDef,
620
+ },
621
+ )
622
+
623
+
624
+ class ListAsyncInvokesRequestPaginateTypeDef(TypedDict):
625
+ submitTimeAfter: NotRequired[TimestampTypeDef]
626
+ submitTimeBefore: NotRequired[TimestampTypeDef]
627
+ statusEquals: NotRequired[AsyncInvokeStatusType]
628
+ sortBy: NotRequired[Literal["SubmissionTime"]]
629
+ sortOrder: NotRequired[SortOrderType]
630
+ PaginationConfig: NotRequired[PaginatorConfigTypeDef]
631
+
632
+
633
+ class ListAsyncInvokesRequestRequestTypeDef(TypedDict):
634
+ submitTimeAfter: NotRequired[TimestampTypeDef]
635
+ submitTimeBefore: NotRequired[TimestampTypeDef]
636
+ statusEquals: NotRequired[AsyncInvokeStatusType]
637
+ maxResults: NotRequired[int]
638
+ nextToken: NotRequired[str]
639
+ sortBy: NotRequired[Literal["SubmissionTime"]]
640
+ sortOrder: NotRequired[SortOrderType]
641
+
642
+
643
+ class ResponseStreamTypeDef(TypedDict):
644
+ chunk: NotRequired[PayloadPartTypeDef]
645
+ internalServerException: NotRequired[InternalServerExceptionTypeDef]
646
+ modelStreamErrorException: NotRequired[ModelStreamErrorExceptionTypeDef]
647
+ validationException: NotRequired[ValidationExceptionTypeDef]
648
+ throttlingException: NotRequired[ThrottlingExceptionTypeDef]
649
+ modelTimeoutException: NotRequired[ModelTimeoutExceptionTypeDef]
650
+ serviceUnavailableException: NotRequired[ServiceUnavailableExceptionTypeDef]
651
+
652
+
653
+ VideoSourceOutputTypeDef = TypedDict(
654
+ "VideoSourceOutputTypeDef",
655
+ {
656
+ "bytes": NotRequired[bytes],
657
+ "s3Location": NotRequired[S3LocationTypeDef],
658
+ },
659
+ )
660
+ VideoSourceTypeDef = TypedDict(
661
+ "VideoSourceTypeDef",
662
+ {
663
+ "bytes": NotRequired[BlobTypeDef],
664
+ "s3Location": NotRequired[S3LocationTypeDef],
665
+ },
666
+ )
667
+ ToolChoiceTypeDef = TypedDict(
668
+ "ToolChoiceTypeDef",
669
+ {
670
+ "auto": NotRequired[Mapping[str, Any]],
671
+ "any": NotRequired[Mapping[str, Any]],
672
+ "tool": NotRequired[SpecificToolChoiceTypeDef],
673
+ },
674
+ )
675
+
676
+
677
+ class ToolSpecificationTypeDef(TypedDict):
678
+ name: str
679
+ inputSchema: ToolInputSchemaTypeDef
680
+ description: NotRequired[str]
681
+
682
+
683
+ ToolUseBlockUnionTypeDef = Union[ToolUseBlockTypeDef, ToolUseBlockOutputTypeDef]
684
+
685
+
686
+ class AsyncInvokeSummaryTypeDef(TypedDict):
687
+ invocationArn: str
688
+ modelArn: str
689
+ submitTime: datetime
690
+ outputDataConfig: AsyncInvokeOutputDataConfigTypeDef
691
+ clientRequestToken: NotRequired[str]
692
+ status: NotRequired[AsyncInvokeStatusType]
693
+ failureMessage: NotRequired[str]
694
+ lastModifiedTime: NotRequired[datetime]
695
+ endTime: NotRequired[datetime]
696
+
697
+
698
+ class GetAsyncInvokeResponseTypeDef(TypedDict):
699
+ invocationArn: str
700
+ modelArn: str
701
+ clientRequestToken: str
702
+ status: AsyncInvokeStatusType
703
+ failureMessage: str
704
+ submitTime: datetime
705
+ lastModifiedTime: datetime
706
+ endTime: datetime
707
+ outputDataConfig: AsyncInvokeOutputDataConfigTypeDef
708
+ ResponseMetadata: ResponseMetadataTypeDef
709
+
710
+
711
+ class StartAsyncInvokeRequestRequestTypeDef(TypedDict):
712
+ modelId: str
713
+ modelInput: Mapping[str, Any]
714
+ outputDataConfig: AsyncInvokeOutputDataConfigTypeDef
715
+ clientRequestToken: NotRequired[str]
716
+ tags: NotRequired[Sequence[TagTypeDef]]
717
+
718
+
719
+ DocumentSourceUnionTypeDef = Union[DocumentSourceTypeDef, DocumentSourceOutputTypeDef]
720
+ GuardrailConverseImageSourceUnionTypeDef = Union[
721
+ GuardrailConverseImageSourceTypeDef, GuardrailConverseImageSourceOutputTypeDef
722
+ ]
723
+ GuardrailImageBlockTypeDef = TypedDict(
724
+ "GuardrailImageBlockTypeDef",
725
+ {
726
+ "format": GuardrailImageFormatType,
727
+ "source": GuardrailImageSourceTypeDef,
728
+ },
729
+ )
730
+ ImageSourceUnionTypeDef = Union[ImageSourceTypeDef, ImageSourceOutputTypeDef]
731
+
732
+
733
+ class ContentBlockDeltaEventTypeDef(TypedDict):
734
+ delta: ContentBlockDeltaTypeDef
735
+ contentBlockIndex: int
736
+
737
+
738
+ class ContentBlockStartEventTypeDef(TypedDict):
739
+ start: ContentBlockStartTypeDef
740
+ contentBlockIndex: int
741
+
742
+
743
+ class GuardrailConverseContentBlockOutputTypeDef(TypedDict):
744
+ text: NotRequired[GuardrailConverseTextBlockOutputTypeDef]
745
+ image: NotRequired[GuardrailConverseImageBlockOutputTypeDef]
746
+
747
+
748
+ class GuardrailInvocationMetricsTypeDef(TypedDict):
749
+ guardrailProcessingLatency: NotRequired[int]
750
+ usage: NotRequired[GuardrailUsageTypeDef]
751
+ guardrailCoverage: NotRequired[GuardrailCoverageTypeDef]
752
+
753
+
754
+ class InvokeModelWithResponseStreamResponseTypeDef(TypedDict):
755
+ body: EventStream[ResponseStreamTypeDef]
756
+ contentType: str
757
+ performanceConfigLatency: PerformanceConfigLatencyType
758
+ ResponseMetadata: ResponseMetadataTypeDef
759
+
760
+
761
+ VideoBlockOutputTypeDef = TypedDict(
762
+ "VideoBlockOutputTypeDef",
763
+ {
764
+ "format": VideoFormatType,
765
+ "source": VideoSourceOutputTypeDef,
766
+ },
767
+ )
768
+ VideoSourceUnionTypeDef = Union[VideoSourceTypeDef, VideoSourceOutputTypeDef]
769
+
770
+
771
+ class ToolTypeDef(TypedDict):
772
+ toolSpec: NotRequired[ToolSpecificationTypeDef]
773
+
774
+
775
+ class ListAsyncInvokesResponseTypeDef(TypedDict):
776
+ asyncInvokeSummaries: List[AsyncInvokeSummaryTypeDef]
777
+ ResponseMetadata: ResponseMetadataTypeDef
778
+ nextToken: NotRequired[str]
779
+
780
+
781
+ DocumentBlockTypeDef = TypedDict(
782
+ "DocumentBlockTypeDef",
783
+ {
784
+ "format": DocumentFormatType,
785
+ "name": str,
786
+ "source": DocumentSourceUnionTypeDef,
787
+ },
788
+ )
789
+ GuardrailConverseImageBlockTypeDef = TypedDict(
790
+ "GuardrailConverseImageBlockTypeDef",
791
+ {
792
+ "format": GuardrailConverseImageFormatType,
793
+ "source": GuardrailConverseImageSourceUnionTypeDef,
794
+ },
795
+ )
796
+
797
+
798
+ class GuardrailContentBlockTypeDef(TypedDict):
799
+ text: NotRequired[GuardrailTextBlockTypeDef]
800
+ image: NotRequired[GuardrailImageBlockTypeDef]
801
+
802
+
803
+ ImageBlockTypeDef = TypedDict(
804
+ "ImageBlockTypeDef",
805
+ {
806
+ "format": ImageFormatType,
807
+ "source": ImageSourceUnionTypeDef,
808
+ },
809
+ )
810
+
811
+
812
+ class GuardrailAssessmentTypeDef(TypedDict):
813
+ topicPolicy: NotRequired[GuardrailTopicPolicyAssessmentTypeDef]
814
+ contentPolicy: NotRequired[GuardrailContentPolicyAssessmentTypeDef]
815
+ wordPolicy: NotRequired[GuardrailWordPolicyAssessmentTypeDef]
816
+ sensitiveInformationPolicy: NotRequired[GuardrailSensitiveInformationPolicyAssessmentTypeDef]
817
+ contextualGroundingPolicy: NotRequired[GuardrailContextualGroundingPolicyAssessmentTypeDef]
818
+ invocationMetrics: NotRequired[GuardrailInvocationMetricsTypeDef]
819
+
820
+
821
+ class ToolResultContentBlockOutputTypeDef(TypedDict):
822
+ json: NotRequired[Dict[str, Any]]
823
+ text: NotRequired[str]
824
+ image: NotRequired[ImageBlockOutputTypeDef]
825
+ document: NotRequired[DocumentBlockOutputTypeDef]
826
+ video: NotRequired[VideoBlockOutputTypeDef]
827
+
828
+
829
+ VideoBlockTypeDef = TypedDict(
830
+ "VideoBlockTypeDef",
831
+ {
832
+ "format": VideoFormatType,
833
+ "source": VideoSourceUnionTypeDef,
834
+ },
835
+ )
836
+
837
+
838
+ class ToolConfigurationTypeDef(TypedDict):
839
+ tools: Sequence[ToolTypeDef]
840
+ toolChoice: NotRequired[ToolChoiceTypeDef]
841
+
842
+
843
+ DocumentBlockUnionTypeDef = Union[DocumentBlockTypeDef, DocumentBlockOutputTypeDef]
844
+ GuardrailConverseImageBlockUnionTypeDef = Union[
845
+ GuardrailConverseImageBlockTypeDef, GuardrailConverseImageBlockOutputTypeDef
846
+ ]
847
+
848
+
849
+ class ApplyGuardrailRequestRequestTypeDef(TypedDict):
850
+ guardrailIdentifier: str
851
+ guardrailVersion: str
852
+ source: GuardrailContentSourceType
853
+ content: Sequence[GuardrailContentBlockTypeDef]
854
+
855
+
856
+ ImageBlockUnionTypeDef = Union[ImageBlockTypeDef, ImageBlockOutputTypeDef]
857
+
858
+
859
+ class ApplyGuardrailResponseTypeDef(TypedDict):
860
+ usage: GuardrailUsageTypeDef
861
+ action: GuardrailActionType
862
+ outputs: List[GuardrailOutputContentTypeDef]
863
+ assessments: List[GuardrailAssessmentTypeDef]
864
+ guardrailCoverage: GuardrailCoverageTypeDef
865
+ ResponseMetadata: ResponseMetadataTypeDef
866
+
867
+
868
+ class GuardrailTraceAssessmentTypeDef(TypedDict):
869
+ modelOutput: NotRequired[List[str]]
870
+ inputAssessment: NotRequired[Dict[str, GuardrailAssessmentTypeDef]]
871
+ outputAssessments: NotRequired[Dict[str, List[GuardrailAssessmentTypeDef]]]
872
+
873
+
874
+ class ToolResultBlockOutputTypeDef(TypedDict):
875
+ toolUseId: str
876
+ content: List[ToolResultContentBlockOutputTypeDef]
877
+ status: NotRequired[ToolResultStatusType]
878
+
879
+
880
+ VideoBlockUnionTypeDef = Union[VideoBlockTypeDef, VideoBlockOutputTypeDef]
881
+
882
+
883
+ class GuardrailConverseContentBlockTypeDef(TypedDict):
884
+ text: NotRequired[GuardrailConverseTextBlockUnionTypeDef]
885
+ image: NotRequired[GuardrailConverseImageBlockUnionTypeDef]
886
+
887
+
888
+ class ConverseStreamTraceTypeDef(TypedDict):
889
+ guardrail: NotRequired[GuardrailTraceAssessmentTypeDef]
890
+ promptRouter: NotRequired[PromptRouterTraceTypeDef]
891
+
892
+
893
+ class ConverseTraceTypeDef(TypedDict):
894
+ guardrail: NotRequired[GuardrailTraceAssessmentTypeDef]
895
+ promptRouter: NotRequired[PromptRouterTraceTypeDef]
896
+
897
+
898
+ class ContentBlockOutputTypeDef(TypedDict):
899
+ text: NotRequired[str]
900
+ image: NotRequired[ImageBlockOutputTypeDef]
901
+ document: NotRequired[DocumentBlockOutputTypeDef]
902
+ video: NotRequired[VideoBlockOutputTypeDef]
903
+ toolUse: NotRequired[ToolUseBlockOutputTypeDef]
904
+ toolResult: NotRequired[ToolResultBlockOutputTypeDef]
905
+ guardContent: NotRequired[GuardrailConverseContentBlockOutputTypeDef]
906
+
907
+
908
+ class ToolResultContentBlockTypeDef(TypedDict):
909
+ json: NotRequired[Mapping[str, Any]]
910
+ text: NotRequired[str]
911
+ image: NotRequired[ImageBlockUnionTypeDef]
912
+ document: NotRequired[DocumentBlockUnionTypeDef]
913
+ video: NotRequired[VideoBlockUnionTypeDef]
914
+
915
+
916
+ GuardrailConverseContentBlockUnionTypeDef = Union[
917
+ GuardrailConverseContentBlockTypeDef, GuardrailConverseContentBlockOutputTypeDef
918
+ ]
919
+
920
+
921
+ class ConverseStreamMetadataEventTypeDef(TypedDict):
922
+ usage: TokenUsageTypeDef
923
+ metrics: ConverseStreamMetricsTypeDef
924
+ trace: NotRequired[ConverseStreamTraceTypeDef]
925
+ performanceConfig: NotRequired[PerformanceConfigurationTypeDef]
926
+
927
+
928
+ class MessageOutputTypeDef(TypedDict):
929
+ role: ConversationRoleType
930
+ content: List[ContentBlockOutputTypeDef]
931
+
932
+
933
+ ToolResultContentBlockUnionTypeDef = Union[
934
+ ToolResultContentBlockTypeDef, ToolResultContentBlockOutputTypeDef
935
+ ]
936
+
937
+
938
+ class SystemContentBlockTypeDef(TypedDict):
939
+ text: NotRequired[str]
940
+ guardContent: NotRequired[GuardrailConverseContentBlockUnionTypeDef]
941
+
942
+
943
+ class ConverseStreamOutputTypeDef(TypedDict):
944
+ messageStart: NotRequired[MessageStartEventTypeDef]
945
+ contentBlockStart: NotRequired[ContentBlockStartEventTypeDef]
946
+ contentBlockDelta: NotRequired[ContentBlockDeltaEventTypeDef]
947
+ contentBlockStop: NotRequired[ContentBlockStopEventTypeDef]
948
+ messageStop: NotRequired[MessageStopEventTypeDef]
949
+ metadata: NotRequired[ConverseStreamMetadataEventTypeDef]
950
+ internalServerException: NotRequired[InternalServerExceptionTypeDef]
951
+ modelStreamErrorException: NotRequired[ModelStreamErrorExceptionTypeDef]
952
+ validationException: NotRequired[ValidationExceptionTypeDef]
953
+ throttlingException: NotRequired[ThrottlingExceptionTypeDef]
954
+ serviceUnavailableException: NotRequired[ServiceUnavailableExceptionTypeDef]
955
+
956
+
957
+ class ConverseOutputTypeDef(TypedDict):
958
+ message: NotRequired[MessageOutputTypeDef]
959
+
960
+
961
+ class ToolResultBlockTypeDef(TypedDict):
962
+ toolUseId: str
963
+ content: Sequence[ToolResultContentBlockUnionTypeDef]
964
+ status: NotRequired[ToolResultStatusType]
965
+
966
+
967
+ class ConverseStreamResponseTypeDef(TypedDict):
968
+ stream: EventStream[ConverseStreamOutputTypeDef]
969
+ ResponseMetadata: ResponseMetadataTypeDef
970
+
971
+
972
+ class ConverseResponseTypeDef(TypedDict):
973
+ output: ConverseOutputTypeDef
974
+ stopReason: StopReasonType
975
+ usage: TokenUsageTypeDef
976
+ metrics: ConverseMetricsTypeDef
977
+ additionalModelResponseFields: Dict[str, Any]
978
+ trace: ConverseTraceTypeDef
979
+ performanceConfig: PerformanceConfigurationTypeDef
980
+ ResponseMetadata: ResponseMetadataTypeDef
981
+
982
+
983
+ ToolResultBlockUnionTypeDef = Union[ToolResultBlockTypeDef, ToolResultBlockOutputTypeDef]
984
+
985
+
986
+ class ContentBlockTypeDef(TypedDict):
987
+ text: NotRequired[str]
988
+ image: NotRequired[ImageBlockUnionTypeDef]
989
+ document: NotRequired[DocumentBlockUnionTypeDef]
990
+ video: NotRequired[VideoBlockUnionTypeDef]
991
+ toolUse: NotRequired[ToolUseBlockUnionTypeDef]
992
+ toolResult: NotRequired[ToolResultBlockUnionTypeDef]
993
+ guardContent: NotRequired[GuardrailConverseContentBlockUnionTypeDef]
994
+
995
+
996
+ ContentBlockUnionTypeDef = Union[ContentBlockTypeDef, ContentBlockOutputTypeDef]
997
+
998
+
999
+ class MessageTypeDef(TypedDict):
1000
+ role: ConversationRoleType
1001
+ content: Sequence[ContentBlockUnionTypeDef]
1002
+
1003
+
1004
+ class ConverseStreamRequestRequestTypeDef(TypedDict):
1005
+ modelId: str
1006
+ messages: NotRequired[Sequence[MessageTypeDef]]
1007
+ system: NotRequired[Sequence[SystemContentBlockTypeDef]]
1008
+ inferenceConfig: NotRequired[InferenceConfigurationTypeDef]
1009
+ toolConfig: NotRequired[ToolConfigurationTypeDef]
1010
+ guardrailConfig: NotRequired[GuardrailStreamConfigurationTypeDef]
1011
+ additionalModelRequestFields: NotRequired[Mapping[str, Any]]
1012
+ promptVariables: NotRequired[Mapping[str, PromptVariableValuesTypeDef]]
1013
+ additionalModelResponseFieldPaths: NotRequired[Sequence[str]]
1014
+ requestMetadata: NotRequired[Mapping[str, str]]
1015
+ performanceConfig: NotRequired[PerformanceConfigurationTypeDef]
1016
+
1017
+
1018
+ MessageUnionTypeDef = Union[MessageTypeDef, MessageOutputTypeDef]
1019
+
1020
+
1021
+ class ConverseRequestRequestTypeDef(TypedDict):
1022
+ modelId: str
1023
+ messages: NotRequired[Sequence[MessageUnionTypeDef]]
1024
+ system: NotRequired[Sequence[SystemContentBlockTypeDef]]
1025
+ inferenceConfig: NotRequired[InferenceConfigurationTypeDef]
1026
+ toolConfig: NotRequired[ToolConfigurationTypeDef]
1027
+ guardrailConfig: NotRequired[GuardrailConfigurationTypeDef]
1028
+ additionalModelRequestFields: NotRequired[Mapping[str, Any]]
1029
+ promptVariables: NotRequired[Mapping[str, PromptVariableValuesTypeDef]]
1030
+ additionalModelResponseFieldPaths: NotRequired[Sequence[str]]
1031
+ requestMetadata: NotRequired[Mapping[str, str]]
1032
+ performanceConfig: NotRequired[PerformanceConfigurationTypeDef]