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
ConstructorDescriptionCompletionPrediction
(String model, String content, int[] promptTokens, int[] completionTokens, FinishReason reason, float[] logprobs) Creates an instance of aCompletionPrediction
record class. -
Method Summary
Modifier and TypeMethodDescriptionint[]
Returns the value of thecompletionTokens
record component.content()
Returns the value of thecontent
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.float[]
logprobs()
Returns the value of thelogprobs
record component.model()
Returns the value of themodel
record component.int[]
Returns the value of thepromptTokens
record component.reason()
Returns the value of thereason
record component.final String
toString()
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 aCompletionPrediction
record class.- Parameters:
model
- the value for themodel
record componentcontent
- the value for thecontent
record componentpromptTokens
- the value for thepromptTokens
record componentcompletionTokens
- the value for thecompletionTokens
record componentreason
- the value for thereason
record componentlogprobs
- the value for thelogprobs
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)
. -
model
Returns the value of themodel
record component.- Returns:
- the value of the
model
record component
-
content
Returns the value of thecontent
record component.- Returns:
- the value of the
content
record component
-
promptTokens
public int[] promptTokens()Returns the value of thepromptTokens
record component.- Returns:
- the value of the
promptTokens
record component
-
completionTokens
public int[] completionTokens()Returns the value of thecompletionTokens
record component.- Returns:
- the value of the
completionTokens
record component
-
reason
Returns the value of thereason
record component.- Returns:
- the value of the
reason
record component
-
logprobs
public float[] logprobs()Returns the value of thelogprobs
record component.- Returns:
- the value of the
logprobs
record component
-