Package com.tnsai.intelligence.rag
Record Class TreeNavigator.Decision
java.lang.Object
java.lang.Record
com.tnsai.intelligence.rag.TreeNavigator.Decision
- Record Components:
descend- whether to opennextNodeId()nextNodeId- the chosen child's id, empty when stopping
- Enclosing interface:
TreeNavigator
What the navigator decided to do at one node.
Stopping is a first-class answer, not a failure. A navigator that has reached the material the query asks about should say so rather than descend until it runs out of budget — the traversal's cost is one model call per level, so an early stop is the difference between a cheap answer and an expensive one.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleandescend()Returns the value of thedescendrecord component.static TreeNavigator.DecisionDescends into the named child.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thenextNodeIdrecord component.static TreeNavigator.Decisionstop()Ends the descent at the current node.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Decision
Creates a validated decision.
-
-
Method Details
-
descend
Descends into the named child.- Parameters:
nodeId- id of a node offered inTreeNavigator.Request.candidates()- Returns:
- the decision
-
stop
Ends the descent at the current node.- Returns:
- the decision
-
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 '=='. -
descend
public boolean descend()Returns the value of thedescendrecord component.- Returns:
- the value of the
descendrecord component
-
nextNodeId
Returns the value of thenextNodeIdrecord component.- Returns:
- the value of the
nextNodeIdrecord component
-