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 Details

  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • model

      public String model()
      Returns the value of the model record component.
      Returns:
      the value of the model record component
    • type

      public String type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • role

      public String role()
      Returns the value of the role record component.
      Returns:
      the value of the role record component
    • content

      Returns the value of the content record component.
      Returns:
      the value of the content record component
    • stopReason

      public String stopReason()
      Returns the value of the stopReason record component.
      Returns:
      the value of the stopReason record component
    • stopSequence

      public String stopSequence()
      Returns the value of the stopSequence record component.
      Returns:
      the value of the stopSequence record component
    • usage

      Returns the value of the usage record component.
      Returns:
      the value of the usage record component
    • amazonBedrockInvocationMetrics

      public AbstractBedrockApi.AmazonBedrockInvocationMetrics amazonBedrockInvocationMetrics()
      Returns the value of the amazonBedrockInvocationMetrics record component.
      Returns:
      the value of the amazonBedrockInvocationMetrics record component