Record Class Ai21Jurassic2ChatBedrockApi.Ai21Jurassic2ChatResponse.Token
java.lang.Object
java.lang.Record
org.springframework.ai.bedrock.jurassic2.api.Ai21Jurassic2ChatBedrockApi.Ai21Jurassic2ChatResponse.Token
- Record Components:
generatedToken
- The generatedToken fields.topTokens
- The topTokens field is a list of the top K alternative tokens for this position, sorted by probability, according to the topKReturn request parameter. If topKReturn is set to 0, this field will be null.textRange
- The textRange field indicates the start and end offsets of the token in the decoded text string.
- Enclosing class:
- Ai21Jurassic2ChatBedrockApi.Ai21Jurassic2ChatResponse
public static record Ai21Jurassic2ChatBedrockApi.Ai21Jurassic2ChatResponse.Token(Ai21Jurassic2ChatBedrockApi.Ai21Jurassic2ChatResponse.GeneratedToken generatedToken, List<Ai21Jurassic2ChatBedrockApi.Ai21Jurassic2ChatResponse.TopToken> topTokens, Ai21Jurassic2ChatBedrockApi.Ai21Jurassic2ChatResponse.TextRange textRange)
extends Record
Provides detailed information about each token in both the prompt and the completions.
-
Constructor Summary
ConstructorDescriptionToken
(Ai21Jurassic2ChatBedrockApi.Ai21Jurassic2ChatResponse.GeneratedToken generatedToken, List<Ai21Jurassic2ChatBedrockApi.Ai21Jurassic2ChatResponse.TopToken> topTokens, Ai21Jurassic2ChatBedrockApi.Ai21Jurassic2ChatResponse.TextRange textRange) Creates an instance of aToken
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.Returns the value of thegeneratedToken
record component.final int
hashCode()
Returns a hash code value for this object.Returns the value of thetextRange
record component.Returns the value of thetopTokens
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Token
public Token(Ai21Jurassic2ChatBedrockApi.Ai21Jurassic2ChatResponse.GeneratedToken generatedToken, List<Ai21Jurassic2ChatBedrockApi.Ai21Jurassic2ChatResponse.TopToken> topTokens, Ai21Jurassic2ChatBedrockApi.Ai21Jurassic2ChatResponse.TextRange textRange) Creates an instance of aToken
record class.- Parameters:
generatedToken
- the value for thegeneratedToken
record componenttopTokens
- the value for thetopTokens
record componenttextRange
- the value for thetextRange
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)
. -
generatedToken
Returns the value of thegeneratedToken
record component.- Returns:
- the value of the
generatedToken
record component
-
topTokens
Returns the value of thetopTokens
record component.- Returns:
- the value of the
topTokens
record component
-
textRange
Returns the value of thetextRange
record component.- Returns:
- the value of the
textRange
record component
-