Record Class Ai21Jurassic2ChatBedrockApi.Ai21Jurassic2ChatResponse
java.lang.Object
java.lang.Record
org.springframework.ai.bedrock.jurassic2.api.Ai21Jurassic2ChatBedrockApi.Ai21Jurassic2ChatResponse
- Record Components:
id
- The unique identifier of the response.prompt
- The prompt used for the chat.amazonBedrockInvocationMetrics
- The metrics about the model invocation.
- Enclosing class:
Ai21Jurassic2ChatBedrockApi
public static record Ai21Jurassic2ChatBedrockApi.Ai21Jurassic2ChatResponse(String id, Ai21Jurassic2ChatBedrockApi.Ai21Jurassic2ChatResponse.Prompt prompt, List<Ai21Jurassic2ChatBedrockApi.Ai21Jurassic2ChatResponse.Completion> completions, AbstractBedrockApi.AmazonBedrockInvocationMetrics amazonBedrockInvocationMetrics)
extends Record
Ai21 Jurassic2 chat response.
https://docs.ai21.com/reference/j2-complete-api-ref#response
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
static final record
Explains why the generation process was halted for a specific completion.static final record
The generatedToken fields.static final record
The prompt includes the raw text, the tokens with their log probabilities, and the top-K alternative tokens at each position, if requested.static final record
The textRange field indicates the start and end offsets of the token in the decoded text string.static final record
Provides detailed information about each token in both the prompt and the completions.static final record
The topTokens field is a list of the top K alternative tokens for this position, sorted by probability, according to the topKReturn request parameter. -
Constructor Summary
ConstructorDescriptionAi21Jurassic2ChatResponse
(String id, Ai21Jurassic2ChatBedrockApi.Ai21Jurassic2ChatResponse.Prompt prompt, List<Ai21Jurassic2ChatBedrockApi.Ai21Jurassic2ChatResponse.Completion> completions, AbstractBedrockApi.AmazonBedrockInvocationMetrics amazonBedrockInvocationMetrics) Creates an instance of aAi21Jurassic2ChatResponse
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theamazonBedrockInvocationMetrics
record component.Returns the value of thecompletions
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.id()
Returns the value of theid
record component.prompt()
Returns the value of theprompt
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Ai21Jurassic2ChatResponse
public Ai21Jurassic2ChatResponse(String id, Ai21Jurassic2ChatBedrockApi.Ai21Jurassic2ChatResponse.Prompt prompt, List<Ai21Jurassic2ChatBedrockApi.Ai21Jurassic2ChatResponse.Completion> completions, AbstractBedrockApi.AmazonBedrockInvocationMetrics amazonBedrockInvocationMetrics) Creates an instance of aAi21Jurassic2ChatResponse
record class.- Parameters:
id
- the value for theid
record componentprompt
- the value for theprompt
record componentcompletions
- the value for thecompletions
record componentamazonBedrockInvocationMetrics
- the value for theamazonBedrockInvocationMetrics
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)
. -
id
Returns the value of theid
record component.- Returns:
- the value of the
id
record component
-
prompt
Returns the value of theprompt
record component.- Returns:
- the value of the
prompt
record component
-
completions
Returns the value of thecompletions
record component.- Returns:
- the value of the
completions
record component
-
amazonBedrockInvocationMetrics
Returns the value of theamazonBedrockInvocationMetrics
record component.- Returns:
- the value of the
amazonBedrockInvocationMetrics
record component
-