ContentBlock¶
Union Type¶
ContentBlock
module-attribute
¶
ContentBlock = Union[ContentBlockText | ContentBlockImage | ContentBlockDocument | ContentBlockVideo | ContentBlockAudio | ContentBlockToolUse | ContentBlockToolResult | ContentBlockGuardContent | ContentBlockCachePoint | ContentBlockReasoningContent | ContentBlockCitationsContent | ContentBlockSearchResult | ContentBlockToolAddition | ContentBlockToolRemoval | ContentBlockUnknown]
A block of content for a message that you pass to, or receive from, a model with the Converse or ConverseStream API operations.
Union Member Types¶
ContentBlockText
dataclass
¶
ContentBlockImage
dataclass
¶
Image to include in the message.
Note
This field is only supported by Anthropic Claude 3 models.
Attributes¶
ContentBlockAudio
dataclass
¶
An audio content block containing audio data in the conversation.
Attributes¶
ContentBlockGuardContent
dataclass
¶
Contains the content to assess with the guardrail. If you don't specify
guardContent in a call to the Converse API, the guardrail (if passed
in the Converse API) assesses the entire message.
For more information, see Use a guardrail with the Converse API in the Amazon Bedrock User Guide.
Attributes¶
ContentBlockReasoningContent
dataclass
¶
Contains content regarding the reasoning that is carried out by the model. Reasoning refers to a Chain of Thought (CoT) that the model generates to enhance the accuracy of its final response.
Attributes¶
ContentBlockCitationsContent
dataclass
¶
A content block that contains both generated text and associated citation information, providing traceability between the response and source documents.
Attributes¶
ContentBlockToolAddition
dataclass
¶
A content block for adding a tool to the available tool set
mid-conversation. Each block references a single tool via its tool
field. Use within a system role message to make a tool available
without re-sending the full tool configuration.