Class ToolResultContentBlock
- java.lang.Object
-
- software.amazon.awssdk.services.bedrockruntime.model.ToolResultContentBlock
-
- All Implemented Interfaces:
Serializable,SdkPojo,ToCopyableBuilder<ToolResultContentBlock.Builder,ToolResultContentBlock>
@Generated("software.amazon.awssdk:codegen") public final class ToolResultContentBlock extends Object implements SdkPojo, Serializable, ToCopyableBuilder<ToolResultContentBlock.Builder,ToolResultContentBlock>
The tool result content block.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceToolResultContentBlock.Builderstatic classToolResultContentBlock.Type
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ToolResultContentBlock.Builderbuilder()DocumentBlockdocument()A tool result that is a document.booleanequals(Object obj)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 ToolResultContentBlockfromJson(Document json)Create an instance of this class withjson()initialized to the given value.static ToolResultContentBlockfromText(String text)Create an instance of this class withtext()initialized to the given value.<T> Optional<T>getValueForField(String fieldName, Class<T> clazz)inthashCode()ImageBlockimage()A tool result that is an image.Documentjson()A tool result that is JSON format data.List<SdkField<?>>sdkFields()static Class<? extends ToolResultContentBlock.Builder>serializableBuilderClass()Stringtext()A tool result that is text.ToolResultContentBlock.BuildertoBuilder()StringtoString()Returns a string representation of this object.ToolResultContentBlock.Typetype()Retrieve an enum value representing which member of this object is populated.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
Method Detail
-
json
public final Document json()
A tool result that is JSON format data.
- Returns:
- A tool result that is JSON format data.
-
text
public final String text()
A tool result that is text.
- Returns:
- A tool result that is text.
-
image
public final ImageBlock image()
A tool result that is an image.
This field is only supported by Anthropic Claude 3 models.
- Returns:
- A tool result that is an image.
This field is only supported by Anthropic Claude 3 models.
-
document
public final DocumentBlock document()
A tool result that is a document.
- Returns:
- A tool result that is a document.
-
toBuilder
public ToolResultContentBlock.Builder toBuilder()
- Specified by:
toBuilderin interfaceToCopyableBuilder<ToolResultContentBlock.Builder,ToolResultContentBlock>
-
builder
public static ToolResultContentBlock.Builder builder()
-
serializableBuilderClass
public static Class<? extends ToolResultContentBlock.Builder> serializableBuilderClass()
-
equalsBySdkFields
public final boolean equalsBySdkFields(Object obj)
- Specified by:
equalsBySdkFieldsin interfaceSdkPojo
-
toString
public final String 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.
-
fromJson
public static ToolResultContentBlock fromJson(Document json)
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
public static ToolResultContentBlock fromText(String text)
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
public static ToolResultContentBlock fromImage(ImageBlock image)
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 Anthropic Claude 3 models.
- Parameters:
image- A tool result that is an image.This field is only supported by Anthropic Claude 3 models.
-
fromImage
public static ToolResultContentBlock fromImage(Consumer<ImageBlock.Builder> image)
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 Anthropic Claude 3 models.
- Parameters:
image- A tool result that is an image.This field is only supported by Anthropic Claude 3 models.
-
fromDocument
public static ToolResultContentBlock fromDocument(DocumentBlock document)
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
public static ToolResultContentBlock fromDocument(Consumer<DocumentBlock.Builder> document)
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.
-
type
public ToolResultContentBlock.Type 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.
-
-