Class ContentBlockDelta
- java.lang.Object
-
- software.amazon.awssdk.services.bedrockruntime.model.ContentBlockDelta
-
- All Implemented Interfaces:
Serializable,SdkPojo,ToCopyableBuilder<ContentBlockDelta.Builder,ContentBlockDelta>
@Generated("software.amazon.awssdk:codegen") public final class ContentBlockDelta extends Object implements SdkPojo, Serializable, ToCopyableBuilder<ContentBlockDelta.Builder,ContentBlockDelta>
A block of content in a streaming response.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceContentBlockDelta.Builderstatic classContentBlockDelta.Type
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ContentBlockDelta.Builderbuilder()CitationsDeltacitation()Incremental citation information that is streamed as part of the response generation process.booleanequals(Object obj)booleanequalsBySdkFields(Object obj)static ContentBlockDeltafromCitation(Consumer<CitationsDelta.Builder> citation)Create an instance of this class withcitation()initialized to the given value.static ContentBlockDeltafromCitation(CitationsDelta citation)Create an instance of this class withcitation()initialized to the given value.static ContentBlockDeltafromImage(Consumer<ImageBlockDelta.Builder> image)Create an instance of this class withimage()initialized to the given value.static ContentBlockDeltafromImage(ImageBlockDelta image)Create an instance of this class withimage()initialized to the given value.static ContentBlockDeltafromReasoningContent(Consumer<ReasoningContentBlockDelta.Builder> reasoningContent)Create an instance of this class withreasoningContent()initialized to the given value.static ContentBlockDeltafromReasoningContent(ReasoningContentBlockDelta reasoningContent)Create an instance of this class withreasoningContent()initialized to the given value.static ContentBlockDeltafromText(String text)Create an instance of this class withtext()initialized to the given value.static ContentBlockDeltafromToolResult(List<ToolResultBlockDelta> toolResult)Create an instance of this class withtoolResult()initialized to the given value.static ContentBlockDeltafromToolUse(Consumer<ToolUseBlockDelta.Builder> toolUse)Create an instance of this class withtoolUse()initialized to the given value.static ContentBlockDeltafromToolUse(ToolUseBlockDelta toolUse)Create an instance of this class withtoolUse()initialized to the given value.<T> Optional<T>getValueForField(String fieldName, Class<T> clazz)inthashCode()booleanhasToolResult()For responses, this returns true if the service returned a value for the ToolResult property.ImageBlockDeltaimage()A streaming delta event containing incremental image data.ReasoningContentBlockDeltareasoningContent()Contains content regarding the reasoning that is carried out by the model.Map<String,SdkField<?>>sdkFieldNameToField()List<SdkField<?>>sdkFields()static Class<? extends ContentBlockDelta.Builder>serializableBuilderClass()Stringtext()The content text.ContentBlockDelta.BuildertoBuilder()List<ToolResultBlockDelta>toolResult()An incremental update that contains the results from a tool call.ToolUseBlockDeltatoolUse()Information about a tool that the model is requesting to use.StringtoString()Returns a string representation of this object.ContentBlockDelta.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
-
text
public final String text()
The content text.
- Returns:
- The content text.
-
toolUse
public final ToolUseBlockDelta toolUse()
Information about a tool that the model is requesting to use.
- Returns:
- Information about a tool that the model is requesting to use.
-
hasToolResult
public final boolean hasToolResult()
For responses, this returns true if the service returned a value for the ToolResult property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
toolResult
public final List<ToolResultBlockDelta> toolResult()
An incremental update that contains the results from a tool call.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasToolResult()method.- Returns:
- An incremental update that contains the results from a tool call.
-
reasoningContent
public final ReasoningContentBlockDelta reasoningContent()
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.
- Returns:
- 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.
-
citation
public final CitationsDelta citation()
Incremental citation information that is streamed as part of the response generation process.
- Returns:
- Incremental citation information that is streamed as part of the response generation process.
-
image
public final ImageBlockDelta image()
A streaming delta event containing incremental image data.
- Returns:
- A streaming delta event containing incremental image data.
-
toBuilder
public ContentBlockDelta.Builder toBuilder()
- Specified by:
toBuilderin interfaceToCopyableBuilder<ContentBlockDelta.Builder,ContentBlockDelta>
-
builder
public static ContentBlockDelta.Builder builder()
-
serializableBuilderClass
public static Class<? extends ContentBlockDelta.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.
-
fromText
public static ContentBlockDelta fromText(String text)
Create an instance of this class withtext()initialized to the given value.The content text.
- Parameters:
text- The content text.
-
fromToolUse
public static ContentBlockDelta fromToolUse(ToolUseBlockDelta toolUse)
Create an instance of this class withtoolUse()initialized to the given value.Information about a tool that the model is requesting to use.
- Parameters:
toolUse- Information about a tool that the model is requesting to use.
-
fromToolUse
public static ContentBlockDelta fromToolUse(Consumer<ToolUseBlockDelta.Builder> toolUse)
Create an instance of this class withtoolUse()initialized to the given value.Information about a tool that the model is requesting to use.
- Parameters:
toolUse- Information about a tool that the model is requesting to use.
-
fromToolResult
public static ContentBlockDelta fromToolResult(List<ToolResultBlockDelta> toolResult)
Create an instance of this class withtoolResult()initialized to the given value.An incremental update that contains the results from a tool call.
- Parameters:
toolResult- An incremental update that contains the results from a tool call.
-
fromReasoningContent
public static ContentBlockDelta fromReasoningContent(ReasoningContentBlockDelta reasoningContent)
Create an instance of this class withreasoningContent()initialized to the given value.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.
- Parameters:
reasoningContent- 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.
-
fromReasoningContent
public static ContentBlockDelta fromReasoningContent(Consumer<ReasoningContentBlockDelta.Builder> reasoningContent)
Create an instance of this class withreasoningContent()initialized to the given value.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.
- Parameters:
reasoningContent- 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.
-
fromCitation
public static ContentBlockDelta fromCitation(CitationsDelta citation)
Create an instance of this class withcitation()initialized to the given value.Incremental citation information that is streamed as part of the response generation process.
- Parameters:
citation- Incremental citation information that is streamed as part of the response generation process.
-
fromCitation
public static ContentBlockDelta fromCitation(Consumer<CitationsDelta.Builder> citation)
Create an instance of this class withcitation()initialized to the given value.Incremental citation information that is streamed as part of the response generation process.
- Parameters:
citation- Incremental citation information that is streamed as part of the response generation process.
-
fromImage
public static ContentBlockDelta fromImage(ImageBlockDelta image)
Create an instance of this class withimage()initialized to the given value.A streaming delta event containing incremental image data.
- Parameters:
image- A streaming delta event containing incremental image data.
-
fromImage
public static ContentBlockDelta fromImage(Consumer<ImageBlockDelta.Builder> image)
Create an instance of this class withimage()initialized to the given value.A streaming delta event containing incremental image data.
- Parameters:
image- A streaming delta event containing incremental image data.
-
type
public ContentBlockDelta.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 beContentBlockDelta.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 beContentBlockDelta.Type.UNKNOWN_TO_SDK_VERSIONif zero members are set, andnullif more than one member is set.
-
sdkFieldNameToField
public final Map<String,SdkField<?>> sdkFieldNameToField()
- Specified by:
sdkFieldNameToFieldin interfaceSdkPojo
-
-