Interface ContentBlock.Builder
- All Superinterfaces:
Buildable
,CopyableBuilder<ContentBlock.Builder,
,ContentBlock> SdkBuilder<ContentBlock.Builder,
,ContentBlock> SdkPojo
- Enclosing class:
ContentBlock
-
Method Summary
Modifier and TypeMethodDescriptiondefault ContentBlock.Builder
document
(Consumer<DocumentBlock.Builder> document) A document to include in the message.document
(DocumentBlock document) A document to include in the message.default ContentBlock.Builder
guardContent
(Consumer<GuardrailConverseContentBlock.Builder> guardContent) Contains the content to assess with the guardrail.guardContent
(GuardrailConverseContentBlock guardContent) Contains the content to assess with the guardrail.default ContentBlock.Builder
image
(Consumer<ImageBlock.Builder> image) Image to include in the message.image
(ImageBlock image) Image to include in the message.Text to include in the message.default ContentBlock.Builder
toolResult
(Consumer<ToolResultBlock.Builder> toolResult) The result for a tool request that a model makes.toolResult
(ToolResultBlock toolResult) The result for a tool request that a model makes.default ContentBlock.Builder
toolUse
(Consumer<ToolUseBlock.Builder> toolUse) Information about a tool use request from a model.toolUse
(ToolUseBlock toolUse) Information about a tool use request from a model.Methods inherited from interface software.amazon.awssdk.utils.builder.CopyableBuilder
copy
Methods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation, build
Methods inherited from interface software.amazon.awssdk.core.SdkPojo
equalsBySdkFields, sdkFields
-
Method Details
-
text
Text to include in the message.
- Parameters:
text
- Text to include in the message.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
image
Image to include in the message.
This field is only supported by Anthropic Claude 3 models.
- Parameters:
image
- Image to include in the message.This field is only supported by Anthropic Claude 3 models.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
image
Image to include in the message.
This field is only supported by Anthropic Claude 3 models.
ImageBlock.Builder
avoiding the need to create one manually viaImageBlock.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed toimage(ImageBlock)
.- Parameters:
image
- a consumer that will call methods onImageBlock.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
document
A document to include in the message.
- Parameters:
document
- A document to include in the message.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
document
A document to include in the message.
This is a convenience method that creates an instance of theDocumentBlock.Builder
avoiding the need to create one manually viaDocumentBlock.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed todocument(DocumentBlock)
.- Parameters:
document
- a consumer that will call methods onDocumentBlock.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
toolUse
Information about a tool use request from a model.
- Parameters:
toolUse
- Information about a tool use request from a model.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
toolUse
Information about a tool use request from a model.
This is a convenience method that creates an instance of theToolUseBlock.Builder
avoiding the need to create one manually viaToolUseBlock.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed totoolUse(ToolUseBlock)
.- Parameters:
toolUse
- a consumer that will call methods onToolUseBlock.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
toolResult
The result for a tool request that a model makes.
- Parameters:
toolResult
- The result for a tool request that a model makes.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
toolResult
The result for a tool request that a model makes.
This is a convenience method that creates an instance of theToolResultBlock.Builder
avoiding the need to create one manually viaToolResultBlock.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed totoolResult(ToolResultBlock)
.- Parameters:
toolResult
- a consumer that will call methods onToolResultBlock.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
guardContent
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.
</p>
- Parameters:
guardContent
- Contains the content to assess with the guardrail. If you don't specifyguardContent
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.
</p>
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
guardContent
default ContentBlock.Builder guardContent(Consumer<GuardrailConverseContentBlock.Builder> guardContent) 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.
</p>
GuardrailConverseContentBlock.Builder
avoiding the need to create one manually viaGuardrailConverseContentBlock.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed toguardContent(GuardrailConverseContentBlock)
.- Parameters:
guardContent
- a consumer that will call methods onGuardrailConverseContentBlock.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-