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 Summary
ConstructorDescriptionAmazonBedrockInvocationMetrics
(Long inputTokenCount, Long firstByteLatency, Long outputTokenCount, Long invocationLatency) Creates an instance of aAmazonBedrockInvocationMetrics
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.Returns the value of thefirstByteLatency
record component.final int
hashCode()
Returns a hash code value for this object.Returns the value of theinputTokenCount
record component.Returns the value of theinvocationLatency
record component.Returns the value of theoutputTokenCount
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
AmazonBedrockInvocationMetrics
public AmazonBedrockInvocationMetrics(Long inputTokenCount, Long firstByteLatency, Long outputTokenCount, Long invocationLatency) Creates an instance of aAmazonBedrockInvocationMetrics
record class.- Parameters:
inputTokenCount
- the value for theinputTokenCount
record componentfirstByteLatency
- the value for thefirstByteLatency
record componentoutputTokenCount
- the value for theoutputTokenCount
record componentinvocationLatency
- the value for theinvocationLatency
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)
. -
inputTokenCount
Returns the value of theinputTokenCount
record component.- Returns:
- the value of the
inputTokenCount
record component
-
firstByteLatency
Returns the value of thefirstByteLatency
record component.- Returns:
- the value of the
firstByteLatency
record component
-
outputTokenCount
Returns the value of theoutputTokenCount
record component.- Returns:
- the value of the
outputTokenCount
record component
-
invocationLatency
Returns the value of theinvocationLatency
record component.- Returns:
- the value of the
invocationLatency
record component
-