Package ai.vespa.llm.completion
Record Class Completion
java.lang.Object
java.lang.Record
ai.vespa.llm.completion.Completion
A completion from a language model.
- Author:
- bratseth
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionCompletion(String text, Completion.FinishReason finishReason) Creates an instance of aCompletionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the reason this completion ended.static Completionstatic Completionfrom(String text, Completion.FinishReason reason) final inthashCode()Returns a hash code value for this object.text()Returns the generated text completion.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Completion
Creates an instance of aCompletionrecord class.- Parameters:
text- the value for thetextrecord componentfinishReason- the value for thefinishReasonrecord component
-
-
Method Details
-
text
Returns the generated text completion. -
finishReason
Returns the reason this completion ended. -
from
-
from
-
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).
-