Class ToolResultContentBlock
- All Implemented Interfaces:
Serializable,SdkPojo,ToCopyableBuilder<ToolResultContentBlock.Builder,ToolResultContentBlock>
The tool result content block. For more information, see Call a tool with the Converse API in the Amazon Bedrock User Guide.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic enum -
Method Summary
Modifier and TypeMethodDescriptionbuilder()final DocumentBlockdocument()A tool result that is a document.final booleanfinal booleanequalsBySdkFields(Object obj) static ToolResultContentBlockfromDocument(Consumer<DocumentBlock.Builder> document) Create an instance of this class withdocument()initialized to the given value.static ToolResultContentBlockfromDocument(DocumentBlock document) Create an instance of this class withdocument()initialized to the given value.static ToolResultContentBlockfromImage(Consumer<ImageBlock.Builder> image) Create an instance of this class withimage()initialized to the given value.static ToolResultContentBlockfromImage(ImageBlock image) Create an instance of this class withimage()initialized to the given value.static ToolResultContentBlockCreate an instance of this class withjson()initialized to the given value.static ToolResultContentBlockfromSearchResult(Consumer<SearchResultBlock.Builder> searchResult) Create an instance of this class withsearchResult()initialized to the given value.static ToolResultContentBlockfromSearchResult(SearchResultBlock searchResult) Create an instance of this class withsearchResult()initialized to the given value.static ToolResultContentBlockCreate an instance of this class withtext()initialized to the given value.static ToolResultContentBlockfromVideo(Consumer<VideoBlock.Builder> video) Create an instance of this class withvideo()initialized to the given value.static ToolResultContentBlockfromVideo(VideoBlock video) Create an instance of this class withvideo()initialized to the given value.final <T> Optional<T>getValueForField(String fieldName, Class<T> clazz) final inthashCode()final ImageBlockimage()A tool result that is an image.final Documentjson()A tool result that is JSON format data.final SearchResultBlockA tool result that is a search result.static Class<? extends ToolResultContentBlock.Builder>final Stringtext()A tool result that is text.final StringtoString()Returns a string representation of this object.type()Retrieve an enum value representing which member of this object is populated.final VideoBlockvideo()A tool result that is video.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
json
A tool result that is JSON format data.
- Returns:
- A tool result that is JSON format data.
-
text
A tool result that is text.
- Returns:
- A tool result that is text.
-
image
A tool result that is an image.
This field is only supported by Amazon Nova and Anthropic Claude 3 and 4 models.
- Returns:
- A tool result that is an image.
This field is only supported by Amazon Nova and Anthropic Claude 3 and 4 models.
-
document
A tool result that is a document.
- Returns:
- A tool result that is a document.
-
video
A tool result that is video.
- Returns:
- A tool result that is video.
-
searchResult
A tool result that is a search result.
- Returns:
- A tool result that is a search result.
-
toBuilder
- Specified by:
toBuilderin interfaceToCopyableBuilder<ToolResultContentBlock.Builder,ToolResultContentBlock>
-
builder
-
serializableBuilderClass
-
hashCode
public final int hashCode() -
equals
-
equalsBySdkFields
- Specified by:
equalsBySdkFieldsin interfaceSdkPojo
-
toString
Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value. -
getValueForField
-
fromJson
Create an instance of this class withjson()initialized to the given value.A tool result that is JSON format data.
- Parameters:
json- A tool result that is JSON format data.
-
fromText
Create an instance of this class withtext()initialized to the given value.A tool result that is text.
- Parameters:
text- A tool result that is text.
-
fromImage
Create an instance of this class withimage()initialized to the given value.A tool result that is an image.
This field is only supported by Amazon Nova and Anthropic Claude 3 and 4 models.
- Parameters:
image- A tool result that is an image.This field is only supported by Amazon Nova and Anthropic Claude 3 and 4 models.
-
fromImage
Create an instance of this class withimage()initialized to the given value.A tool result that is an image.
This field is only supported by Amazon Nova and Anthropic Claude 3 and 4 models.
- Parameters:
image- A tool result that is an image.This field is only supported by Amazon Nova and Anthropic Claude 3 and 4 models.
-
fromDocument
Create an instance of this class withdocument()initialized to the given value.A tool result that is a document.
- Parameters:
document- A tool result that is a document.
-
fromDocument
Create an instance of this class withdocument()initialized to the given value.A tool result that is a document.
- Parameters:
document- A tool result that is a document.
-
fromVideo
Create an instance of this class withvideo()initialized to the given value.A tool result that is video.
- Parameters:
video- A tool result that is video.
-
fromVideo
Create an instance of this class withvideo()initialized to the given value.A tool result that is video.
- Parameters:
video- A tool result that is video.
-
fromSearchResult
Create an instance of this class withsearchResult()initialized to the given value.A tool result that is a search result.
- Parameters:
searchResult- A tool result that is a search result.
-
fromSearchResult
public static ToolResultContentBlock fromSearchResult(Consumer<SearchResultBlock.Builder> searchResult) Create an instance of this class withsearchResult()initialized to the given value.A tool result that is a search result.
- Parameters:
searchResult- A tool result that is a search result.
-
type
Retrieve an enum value representing which member of this object is populated. When this class is returned in a service response, this will beToolResultContentBlock.Type.UNKNOWN_TO_SDK_VERSIONif the service returned a member that is only known to a newer SDK version. When this class is created directly in your code, this will beToolResultContentBlock.Type.UNKNOWN_TO_SDK_VERSIONif zero members are set, andnullif more than one member is set. -
sdkFields
-
sdkFieldNameToField
- Specified by:
sdkFieldNameToFieldin interfaceSdkPojo
-