Interface Atomizer

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Atomizer
Determines whether a task is atomic (solvable directly) or needs decomposition. Implementations can use LLM-based analysis or heuristics.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Atomizer
    depthBased(int maxDepth)
    Creates a depth-based atomizer that treats tasks as atomic beyond a certain depth.
    boolean
    isAtomic(String task, int depth)
    Checks if a task is atomic.
    static Atomizer
    llmBased(com.tnsai.agents.Agent agent)
    Creates an LLM-based atomizer that asks an agent to decide.
  • Method Details

    • isAtomic

      boolean isAtomic(String task, int depth)
      Checks if a task is atomic.
      Parameters:
      task - the task description
      depth - current recursion depth
      Returns:
      true if the task can be solved directly without decomposition
    • llmBased

      static Atomizer llmBased(com.tnsai.agents.Agent agent)
      Creates an LLM-based atomizer that asks an agent to decide.
      Parameters:
      agent - the agent to use for atomicity analysis
      Returns:
      an atomizer that uses LLM judgment
    • depthBased

      static Atomizer depthBased(int maxDepth)
      Creates a depth-based atomizer that treats tasks as atomic beyond a certain depth.
      Parameters:
      maxDepth - maximum decomposition depth before forcing atomic treatment
      Returns:
      an atomizer that uses depth as the criteria