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