Record Class CompletionPrediction
java.lang.Object
java.lang.Record
smile.llm.CompletionPrediction
- Record Components:
model- the model used for the chat completion.content- the generated text completion.promptTokens- the list of prompt tokens.completionTokens- the list of generated tokens.reason- the finish reason.logprobs- the optional list of log probabilities of generated tokens.
public record CompletionPrediction(String model, String content, int[] promptTokens, int[] completionTokens, FinishReason reason, float[] logprobs)
extends Record
Prompt completion prediction.
-
Constructor Summary
ConstructorsConstructorDescriptionCompletionPrediction(String model, String content, int[] promptTokens, int[] completionTokens, FinishReason reason, float[] logprobs) Creates an instance of aCompletionPredictionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionint[]Returns the value of thecompletionTokensrecord component.content()Returns the value of thecontentrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.float[]logprobs()Returns the value of thelogprobsrecord component.model()Returns the value of themodelrecord component.int[]Returns the value of thepromptTokensrecord component.reason()Returns the value of thereasonrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CompletionPrediction
public CompletionPrediction(String model, String content, int[] promptTokens, int[] completionTokens, FinishReason reason, float[] logprobs) Creates an instance of aCompletionPredictionrecord class.- Parameters:
model- the value for themodelrecord componentcontent- the value for thecontentrecord componentpromptTokens- the value for thepromptTokensrecord componentcompletionTokens- the value for thecompletionTokensrecord componentreason- the value for thereasonrecord componentlogprobs- the value for thelogprobsrecord component
-
-
Method Details
-
toString
-
hashCode
-
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). -
model
-
content
-
promptTokens
public int[] promptTokens()Returns the value of thepromptTokensrecord component.- Returns:
- the value of the
promptTokensrecord component
-
completionTokens
public int[] completionTokens()Returns the value of thecompletionTokensrecord component.- Returns:
- the value of the
completionTokensrecord component
-
reason
-
logprobs
-