Interface BranchEvaluator


public interface BranchEvaluator
Evaluates branches in Tree of Thoughts exploration.

The evaluator assigns a score (0.0 - 1.0) to each thought node based on how promising it appears for reaching the goal.

  • Method Summary

    Modifier and Type
    Method
    Description
    combined(BranchEvaluator... evaluators)
    Creates a combined evaluator that averages multiple evaluators.
    double
    evaluate(Evaluable node, String goal)
    Evaluates a thought node and returns a score (0.0 - 1.0).
    Creates a simple heuristic evaluator based on thought length and keywords.
    llm(com.tnsai.llm.LLMClient client)
    Creates an LLM-based evaluator.
  • Method Details

    • evaluate

      double evaluate(Evaluable node, String goal)
      Evaluates a thought node and returns a score (0.0 - 1.0).
      Parameters:
      node - The node to evaluate (ThoughtNode or GoTNode)
      goal - The original goal/problem being solved
      Returns:
      Score between 0.0 (poor) and 1.0 (excellent)
    • llm

      static BranchEvaluator llm(com.tnsai.llm.LLMClient client)
      Creates an LLM-based evaluator.
    • heuristic

      static BranchEvaluator heuristic()
      Creates a simple heuristic evaluator based on thought length and keywords.
    • combined

      static BranchEvaluator combined(BranchEvaluator... evaluators)
      Creates a combined evaluator that averages multiple evaluators.