ContentBlockDict¶
Union Type¶
ContentBlockDict
module-attribute
¶
ContentBlockDict = Union[ContentBlockTextDict | ContentBlockImageDict | ContentBlockDocumentDict | ContentBlockVideoDict | ContentBlockAudioDict | ContentBlockToolUseDict | ContentBlockToolResultDict | ContentBlockGuardContentDict | ContentBlockCachePointDict | ContentBlockReasoningContentDict | ContentBlockCitationsContentDict | ContentBlockSearchResultDict | ContentBlockToolAdditionDict | ContentBlockToolRemovalDict]
Dictionary form of ContentBlock, setting exactly one variant.
Union Member Types¶
ContentBlockTextDict
¶
ContentBlockImageDict
¶
Bases: TypedDict
Attributes¶
image
instance-attribute
¶
image: ImageBlock | ImageBlockDict
Image to include in the message.
Note
This field is only supported by Anthropic Claude 3 models.
ContentBlockDocumentDict
¶
Bases: TypedDict
Attributes¶
document
instance-attribute
¶
document: DocumentBlock | DocumentBlockDict
A document to include in the message.
ContentBlockAudioDict
¶
Bases: TypedDict
Attributes¶
audio
instance-attribute
¶
audio: AudioBlock | AudioBlockDict
An audio content block containing audio data in the conversation.
ContentBlockToolUseDict
¶
Bases: TypedDict
Attributes¶
tool_use
instance-attribute
¶
tool_use: ToolUseBlock | ToolUseBlockDict
Information about a tool use request from a model.
ContentBlockToolResultDict
¶
Bases: TypedDict
Attributes¶
tool_result
instance-attribute
¶
tool_result: ToolResultBlock | ToolResultBlockDict
The result for a tool request that a model makes.
ContentBlockGuardContentDict
¶
Bases: TypedDict
Attributes¶
guard_content
instance-attribute
¶
guard_content: GuardrailConverseContentBlock | GuardrailConverseContentBlockDict
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.
ContentBlockCachePointDict
¶
Bases: TypedDict
Attributes¶
cache_point
instance-attribute
¶
cache_point: CachePointBlock | CachePointBlockDict
CachePoint to include in the message.
ContentBlockReasoningContentDict
¶
Bases: TypedDict
Attributes¶
reasoning_content
instance-attribute
¶
reasoning_content: ReasoningContentBlock | ReasoningContentBlockDict
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.
ContentBlockCitationsContentDict
¶
Bases: TypedDict
Attributes¶
citations_content
instance-attribute
¶
citations_content: CitationsContentBlock | CitationsContentBlockDict
A content block that contains both generated text and associated citation information, providing traceability between the response and source documents.
ContentBlockSearchResultDict
¶
Bases: TypedDict
Attributes¶
search_result
instance-attribute
¶
search_result: SearchResultBlock | SearchResultBlockDict
Search result to include in the message.
ContentBlockToolAdditionDict
¶
Bases: TypedDict
Attributes¶
tool_addition
instance-attribute
¶
tool_addition: ToolAdditionBlock | ToolAdditionBlockDict
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.
ContentBlockToolRemovalDict
¶
Bases: TypedDict
Attributes¶
tool_removal
instance-attribute
¶
tool_removal: ToolRemovalBlock | ToolRemovalBlockDict
A content block for removing a tool from the available tool set
mid-conversation. Each block references a single tool via its tool
field. Use within a system role message to remove a tool without
re-sending the full tool configuration.