Record Class Anthropic3ChatBedrockApi.AnthropicChatResponse
java.lang.Object
java.lang.Record
org.springframework.ai.bedrock.anthropic3.api.Anthropic3ChatBedrockApi.AnthropicChatResponse
- Record Components:
id
- The unique response identifier.model
- The ID for the Anthropic Claude model that made the request.type
- The type of the response.role
- The role of the response.content
- The list of generated text.stopReason
- The reason the model stopped generating text: end_turn – The model reached a natural stopping point. max_tokens – The generated text exceeded the value of the max_tokens input field or exceeded the maximum number of tokens that the model supports. stop_sequence – The model generated one of the stop sequences that you specified in the stop_sequences input field.stopSequence
- The stop sequence that caused the model to stop generating text.usage
- Metrics about the model invocation.amazonBedrockInvocationMetrics
- The metrics about the model invocation.
- Enclosing class:
- Anthropic3ChatBedrockApi
public static record Anthropic3ChatBedrockApi.AnthropicChatResponse(String id, String model, String type, String role, List<Anthropic3ChatBedrockApi.MediaContent> content, String stopReason, String stopSequence, Anthropic3ChatBedrockApi.AnthropicUsage usage, AbstractBedrockApi.AmazonBedrockInvocationMetrics amazonBedrockInvocationMetrics)
extends Record
AnthropicChatResponse encapsulates the response parameters for the Anthropic
messages model.
-
Constructor Summary
ConstructorDescriptionAnthropicChatResponse
(String id, String model, String type, String role, List<Anthropic3ChatBedrockApi.MediaContent> content, String stopReason, String stopSequence, Anthropic3ChatBedrockApi.AnthropicUsage usage, AbstractBedrockApi.AmazonBedrockInvocationMetrics amazonBedrockInvocationMetrics) Creates an instance of aAnthropicChatResponse
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theamazonBedrockInvocationMetrics
record component.content()
Returns the value of thecontent
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.id()
Returns the value of theid
record component.model()
Returns the value of themodel
record component.role()
Returns the value of therole
record component.Returns the value of thestopReason
record component.Returns the value of thestopSequence
record component.final String
toString()
Returns a string representation of this record class.type()
Returns the value of thetype
record component.usage()
Returns the value of theusage
record component.
-
Constructor Details
-
AnthropicChatResponse
public AnthropicChatResponse(String id, String model, String type, String role, List<Anthropic3ChatBedrockApi.MediaContent> content, String stopReason, String stopSequence, Anthropic3ChatBedrockApi.AnthropicUsage usage, AbstractBedrockApi.AmazonBedrockInvocationMetrics amazonBedrockInvocationMetrics) Creates an instance of aAnthropicChatResponse
record class.- Parameters:
id
- the value for theid
record componentmodel
- the value for themodel
record componenttype
- the value for thetype
record componentrole
- the value for therole
record componentcontent
- the value for thecontent
record componentstopReason
- the value for thestopReason
record componentstopSequence
- the value for thestopSequence
record componentusage
- the value for theusage
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)
. -
id
Returns the value of theid
record component.- Returns:
- the value of the
id
record component
-
model
Returns the value of themodel
record component.- Returns:
- the value of the
model
record component
-
type
Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
role
Returns the value of therole
record component.- Returns:
- the value of the
role
record component
-
content
Returns the value of thecontent
record component.- Returns:
- the value of the
content
record component
-
stopReason
Returns the value of thestopReason
record component.- Returns:
- the value of the
stopReason
record component
-
stopSequence
Returns the value of thestopSequence
record component.- Returns:
- the value of the
stopSequence
record component
-
usage
Returns the value of theusage
record component.- Returns:
- the value of the
usage
record component
-
amazonBedrockInvocationMetrics
Returns the value of theamazonBedrockInvocationMetrics
record component.- Returns:
- the value of the
amazonBedrockInvocationMetrics
record component
-