Record Class AbstractBedrockApi.AmazonBedrockInvocationMetrics

java.lang.Object
java.lang.Record
org.springframework.ai.bedrock.api.AbstractBedrockApi.AmazonBedrockInvocationMetrics
Record Components:
inputTokenCount - The number of tokens in the input prompt.
firstByteLatency - The time in milliseconds between the request being sent and the first byte of the response being received.
outputTokenCount - The number of tokens in the generated text.
invocationLatency - The time in milliseconds between the request being sent and the response being received.
Enclosing class:
AbstractBedrockApi<I,O,SO>

public static record AbstractBedrockApi.AmazonBedrockInvocationMetrics(Long inputTokenCount, Long firstByteLatency, Long outputTokenCount, Long invocationLatency) extends Record
Encapsulates the metrics about the model invocation. https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-claude.html
  • Constructor Details

    • AmazonBedrockInvocationMetrics

      public AmazonBedrockInvocationMetrics(Long inputTokenCount, Long firstByteLatency, Long outputTokenCount, Long invocationLatency)
      Creates an instance of a AmazonBedrockInvocationMetrics record class.
      Parameters:
      inputTokenCount - the value for the inputTokenCount record component
      firstByteLatency - the value for the firstByteLatency record component
      outputTokenCount - the value for the outputTokenCount record component
      invocationLatency - the value for the invocationLatency record component
  • 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.
    • inputTokenCount

      public Long inputTokenCount()
      Returns the value of the inputTokenCount record component.
      Returns:
      the value of the inputTokenCount record component
    • firstByteLatency

      public Long firstByteLatency()
      Returns the value of the firstByteLatency record component.
      Returns:
      the value of the firstByteLatency record component
    • outputTokenCount

      public Long outputTokenCount()
      Returns the value of the outputTokenCount record component.
      Returns:
      the value of the outputTokenCount record component
    • invocationLatency

      public Long invocationLatency()
      Returns the value of the invocationLatency record component.
      Returns:
      the value of the invocationLatency record component