Package com.tnsai.llm.routing
Record Class TaskClassifier.ClassificationResult
java.lang.Object
java.lang.Record
com.tnsai.llm.routing.TaskClassifier.ClassificationResult
- Enclosing class:
TaskClassifier
public static record TaskClassifier.ClassificationResult(TaskType taskType, double confidence, String reason)
extends Record
Classification result with confidence score.
-
Constructor Summary
ConstructorsConstructorDescriptionClassificationResult(TaskType taskType, double confidence, String reason) Creates an instance of aClassificationResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of theconfidencerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisConfident(double threshold) Returns true if confidence is above the given threshold.reason()Returns the value of thereasonrecord component.taskType()Returns the value of thetaskTyperecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ClassificationResult
Creates an instance of aClassificationResultrecord class.- Parameters:
taskType- the value for thetaskTyperecord componentconfidence- the value for theconfidencerecord componentreason- the value for thereasonrecord component
-
-
Method Details
-
isConfident
public boolean isConfident(double threshold) Returns true if confidence is above the given threshold. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
taskType
Returns the value of thetaskTyperecord component.- Returns:
- the value of the
taskTyperecord component
-
confidence
public double confidence()Returns the value of theconfidencerecord component.- Returns:
- the value of the
confidencerecord component
-
reason
Returns the value of thereasonrecord component.- Returns:
- the value of the
reasonrecord component
-