Type definitions#
Index > BedrockRuntime > Type definitions
Auto-generated documentation for BedrockRuntime type annotations stubs module mypy-boto3-bedrock-runtime.
BlobTypeDef#
# BlobTypeDef definition
BlobTypeDef = Union[
str,
bytes,
IO[Any],
StreamingBody,
]
MessageUnionTypeDef#
# MessageUnionTypeDef definition
MessageUnionTypeDef = Union[
MessageTypeDef, # (1)
MessageOutputTypeDef, # (2)
]
- See MessageTypeDef
- See MessageOutputTypeDef
GuardrailOutputContentTypeDef#
# GuardrailOutputContentTypeDef definition
class GuardrailOutputContentTypeDef(TypedDict):
text: NotRequired[str],
GuardrailUsageTypeDef#
# GuardrailUsageTypeDef definition
class GuardrailUsageTypeDef(TypedDict):
topicPolicyUnits: int,
contentPolicyUnits: int,
wordPolicyUnits: int,
sensitiveInformationPolicyUnits: int,
sensitiveInformationPolicyFreeUnits: int,
contextualGroundingPolicyUnits: int,
ResponseMetadataTypeDef#
# ResponseMetadataTypeDef definition
class ResponseMetadataTypeDef(TypedDict):
RequestId: str,
HTTPStatusCode: int,
HTTPHeaders: Dict[str, str],
RetryAttempts: int,
HostId: NotRequired[str],
ToolUseBlockDeltaTypeDef#
# ToolUseBlockDeltaTypeDef definition
class ToolUseBlockDeltaTypeDef(TypedDict):
input: str,
ToolUseBlockOutputTypeDef#
# ToolUseBlockOutputTypeDef definition
class ToolUseBlockOutputTypeDef(TypedDict):
toolUseId: str,
name: str,
input: Dict[str, Any],
ToolUseBlockStartTypeDef#
# ToolUseBlockStartTypeDef definition
class ToolUseBlockStartTypeDef(TypedDict):
toolUseId: str,
name: str,
ContentBlockStopEventTypeDef#
# ContentBlockStopEventTypeDef definition
class ContentBlockStopEventTypeDef(TypedDict):
contentBlockIndex: int,
ToolUseBlockTypeDef#
# ToolUseBlockTypeDef definition
class ToolUseBlockTypeDef(TypedDict):
toolUseId: str,
name: str,
input: Mapping[str, Any],
ConverseMetricsTypeDef#
# ConverseMetricsTypeDef definition
class ConverseMetricsTypeDef(TypedDict):
latencyMs: int,
GuardrailConfigurationTypeDef#
# GuardrailConfigurationTypeDef definition
class GuardrailConfigurationTypeDef(TypedDict):
guardrailIdentifier: str,
guardrailVersion: str,
trace: NotRequired[GuardrailTraceType], # (1)
InferenceConfigurationTypeDef#
# InferenceConfigurationTypeDef definition
class InferenceConfigurationTypeDef(TypedDict):
maxTokens: NotRequired[int],
temperature: NotRequired[float],
topP: NotRequired[float],
stopSequences: NotRequired[Sequence[str]],
TokenUsageTypeDef#
# TokenUsageTypeDef definition
class TokenUsageTypeDef(TypedDict):
inputTokens: int,
outputTokens: int,
totalTokens: int,
ConverseStreamMetricsTypeDef#
# ConverseStreamMetricsTypeDef definition
class ConverseStreamMetricsTypeDef(TypedDict):
latencyMs: int,
InternalServerExceptionTypeDef#
# InternalServerExceptionTypeDef definition
class InternalServerExceptionTypeDef(TypedDict):
message: NotRequired[str],
MessageStartEventTypeDef#
# MessageStartEventTypeDef definition
class MessageStartEventTypeDef(TypedDict):
role: ConversationRoleType, # (1)
MessageStopEventTypeDef#
# MessageStopEventTypeDef definition
class MessageStopEventTypeDef(TypedDict):
stopReason: StopReasonType, # (1)
additionalModelResponseFields: NotRequired[Dict[str, Any]],
- See StopReasonType
ModelStreamErrorExceptionTypeDef#
# ModelStreamErrorExceptionTypeDef definition
class ModelStreamErrorExceptionTypeDef(TypedDict):
message: NotRequired[str],
originalStatusCode: NotRequired[int],
originalMessage: NotRequired[str],
ServiceUnavailableExceptionTypeDef#
# ServiceUnavailableExceptionTypeDef definition
class ServiceUnavailableExceptionTypeDef(TypedDict):
message: NotRequired[str],
ThrottlingExceptionTypeDef#
# ThrottlingExceptionTypeDef definition
class ThrottlingExceptionTypeDef(TypedDict):
message: NotRequired[str],
ValidationExceptionTypeDef#
# ValidationExceptionTypeDef definition
class ValidationExceptionTypeDef(TypedDict):
message: NotRequired[str],
GuardrailStreamConfigurationTypeDef#
# GuardrailStreamConfigurationTypeDef definition
class GuardrailStreamConfigurationTypeDef(TypedDict):
guardrailIdentifier: str,
guardrailVersion: str,
trace: NotRequired[GuardrailTraceType], # (1)
streamProcessingMode: NotRequired[GuardrailStreamProcessingModeType], # (2)
DocumentSourceOutputTypeDef#
# DocumentSourceOutputTypeDef definition
class DocumentSourceOutputTypeDef(TypedDict):
bytes: NotRequired[bytes],
GuardrailTextBlockTypeDef#
# GuardrailTextBlockTypeDef definition
class GuardrailTextBlockTypeDef(TypedDict):
text: str,
qualifiers: NotRequired[Sequence[GuardrailContentQualifierType]], # (1)
GuardrailContentFilterTypeDef#
# GuardrailContentFilterTypeDef definition
class GuardrailContentFilterTypeDef(TypedDict):
type: GuardrailContentFilterTypeType, # (1)
confidence: GuardrailContentFilterConfidenceType, # (2)
action: GuardrailContentPolicyActionType, # (3)
- See GuardrailContentFilterTypeType
- See GuardrailContentFilterConfidenceType
- See GuardrailContentPolicyActionType
GuardrailContextualGroundingFilterTypeDef#
# GuardrailContextualGroundingFilterTypeDef definition
class GuardrailContextualGroundingFilterTypeDef(TypedDict):
type: GuardrailContextualGroundingFilterTypeType, # (1)
threshold: float,
score: float,
action: GuardrailContextualGroundingPolicyActionType, # (2)
GuardrailConverseTextBlockOutputTypeDef#
# GuardrailConverseTextBlockOutputTypeDef definition
class GuardrailConverseTextBlockOutputTypeDef(TypedDict):
text: str,
qualifiers: NotRequired[List[GuardrailConverseContentQualifierType]], # (1)