Package smile.llm
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.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
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). -
model
Returns the value of themodelrecord component.- Returns:
- the value of the
modelrecord component
-
content
Returns the value of thecontentrecord component.- Returns:
- the value of the
contentrecord component
-
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
Returns the value of thereasonrecord component.- Returns:
- the value of the
reasonrecord component
-
logprobs
public float[] logprobs()Returns the value of thelogprobsrecord component.- Returns:
- the value of the
logprobsrecord component
-