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
ConstructorsConstructorDescriptionAmazonBedrockInvocationMetrics(Long inputTokenCount, Long firstByteLatency, Long outputTokenCount, Long invocationLatency) Creates an instance of aAmazonBedrockInvocationMetricsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of thefirstByteLatencyrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theinputTokenCountrecord component.Returns the value of theinvocationLatencyrecord component.Returns the value of theoutputTokenCountrecord component.final StringtoString()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 aAmazonBedrockInvocationMetricsrecord class.- Parameters:
inputTokenCount- the value for theinputTokenCountrecord componentfirstByteLatency- the value for thefirstByteLatencyrecord componentoutputTokenCount- the value for theoutputTokenCountrecord componentinvocationLatency- the value for theinvocationLatencyrecord 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 theinputTokenCountrecord component.- Returns:
- the value of the
inputTokenCountrecord component
-
firstByteLatency
Returns the value of thefirstByteLatencyrecord component.- Returns:
- the value of the
firstByteLatencyrecord component
-
outputTokenCount
Returns the value of theoutputTokenCountrecord component.- Returns:
- the value of the
outputTokenCountrecord component
-
invocationLatency
Returns the value of theinvocationLatencyrecord component.- Returns:
- the value of the
invocationLatencyrecord component
-