Record Class TitanChatBedrockApi.TitanChatResponseChunk
java.lang.Object
java.lang.Record
org.springframework.ai.bedrock.titan.api.TitanChatBedrockApi.TitanChatResponseChunk
- Record Components:
outputText
- The generated text in this chunk.index
- The index of the chunk in the streaming response.inputTextTokenCount
- The number of tokens in the prompt.totalOutputTextTokenCount
- The number of tokens in the response.completionReason
- The reason the response finished being generated.amazonBedrockInvocationMetrics
- The metrics for the invocation.
- Enclosing class:
- TitanChatBedrockApi
public static record TitanChatBedrockApi.TitanChatResponseChunk(String outputText, Integer index, Integer inputTextTokenCount, Integer totalOutputTextTokenCount, TitanChatBedrockApi.TitanChatResponse.CompletionReason completionReason, AbstractBedrockApi.AmazonBedrockInvocationMetrics amazonBedrockInvocationMetrics)
extends Record
Titan chat model streaming response.
-
Constructor Summary
ConstructorDescriptionTitanChatResponseChunk
(String outputText, Integer index, Integer inputTextTokenCount, Integer totalOutputTextTokenCount, TitanChatBedrockApi.TitanChatResponse.CompletionReason completionReason, AbstractBedrockApi.AmazonBedrockInvocationMetrics amazonBedrockInvocationMetrics) Creates an instance of aTitanChatResponseChunk
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theamazonBedrockInvocationMetrics
record component.Returns the value of thecompletionReason
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.index()
Returns the value of theindex
record component.Returns the value of theinputTextTokenCount
record component.Returns the value of theoutputText
record component.final String
toString()
Returns a string representation of this record class.Returns the value of thetotalOutputTextTokenCount
record component.
-
Constructor Details
-
TitanChatResponseChunk
public TitanChatResponseChunk(String outputText, Integer index, Integer inputTextTokenCount, Integer totalOutputTextTokenCount, TitanChatBedrockApi.TitanChatResponse.CompletionReason completionReason, AbstractBedrockApi.AmazonBedrockInvocationMetrics amazonBedrockInvocationMetrics) Creates an instance of aTitanChatResponseChunk
record class.- Parameters:
outputText
- the value for theoutputText
record componentindex
- the value for theindex
record componentinputTextTokenCount
- the value for theinputTextTokenCount
record componenttotalOutputTextTokenCount
- the value for thetotalOutputTextTokenCount
record componentcompletionReason
- the value for thecompletionReason
record componentamazonBedrockInvocationMetrics
- the value for theamazonBedrockInvocationMetrics
record component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
outputText
Returns the value of theoutputText
record component.- Returns:
- the value of the
outputText
record component
-
index
Returns the value of theindex
record component.- Returns:
- the value of the
index
record component
-
inputTextTokenCount
Returns the value of theinputTextTokenCount
record component.- Returns:
- the value of the
inputTextTokenCount
record component
-
totalOutputTextTokenCount
Returns the value of thetotalOutputTextTokenCount
record component.- Returns:
- the value of the
totalOutputTextTokenCount
record component
-
completionReason
Returns the value of thecompletionReason
record component.- Returns:
- the value of the
completionReason
record component
-
amazonBedrockInvocationMetrics
Returns the value of theamazonBedrockInvocationMetrics
record component.- Returns:
- the value of the
amazonBedrockInvocationMetrics
record component
-