Record Class AnthropicChatBedrockApi.AnthropicChatResponse
java.lang.Object
java.lang.Record
org.springframework.ai.bedrock.anthropic.api.AnthropicChatBedrockApi.AnthropicChatResponse
- Record Components:
type
- The type of the response.completion
- The generated text.stopReason
- The reason the model stopped generating text.stop
- The stop sequence that caused the model to stop generating text.amazonBedrockInvocationMetrics
- Metrics about the model invocation.
- Enclosing class:
- AnthropicChatBedrockApi
public static record AnthropicChatBedrockApi.AnthropicChatResponse(String type, String completion, String stopReason, String stop, AbstractBedrockApi.AmazonBedrockInvocationMetrics amazonBedrockInvocationMetrics)
extends Record
AnthropicChatResponse encapsulates the response parameters for the Anthropic chat model.
-
Constructor Summary
ConstructorDescriptionAnthropicChatResponse
(String type, String completion, String stopReason, String stop, AbstractBedrockApi.AmazonBedrockInvocationMetrics amazonBedrockInvocationMetrics) Creates an instance of aAnthropicChatResponse
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theamazonBedrockInvocationMetrics
record component.Returns the value of thecompletion
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.stop()
Returns the value of thestop
record component.Returns the value of thestopReason
record component.final String
toString()
Returns a string representation of this record class.type()
Returns the value of thetype
record component.
-
Constructor Details
-
AnthropicChatResponse
public AnthropicChatResponse(String type, String completion, String stopReason, String stop, AbstractBedrockApi.AmazonBedrockInvocationMetrics amazonBedrockInvocationMetrics) Creates an instance of aAnthropicChatResponse
record class.- Parameters:
type
- the value for thetype
record componentcompletion
- the value for thecompletion
record componentstopReason
- the value for thestopReason
record componentstop
- the value for thestop
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)
. -
type
Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
completion
Returns the value of thecompletion
record component.- Returns:
- the value of the
completion
record component
-
stopReason
Returns the value of thestopReason
record component.- Returns:
- the value of the
stopReason
record component
-
stop
Returns the value of thestop
record component.- Returns:
- the value of the
stop
record component
-
amazonBedrockInvocationMetrics
Returns the value of theamazonBedrockInvocationMetrics
record component.- Returns:
- the value of the
amazonBedrockInvocationMetrics
record component
-