Interface TaskDecomposer

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 TaskDecomposer
Decomposes a complex task into smaller sub-tasks.
  • Method Summary

    Modifier and Type
    Method
    Description
    decompose(String task, int depth)
    Breaks a task into sub-tasks.
    llmBased(com.tnsai.agents.Agent agent)
    Creates an LLM-based decomposer that asks an agent to break down the task.
  • Method Details

    • decompose

      List<String> decompose(String task, int depth)
      Breaks a task into sub-tasks.
      Parameters:
      task - the task to decompose
      depth - current recursion depth
      Returns:
      list of sub-task descriptions
    • llmBased

      static TaskDecomposer llmBased(com.tnsai.agents.Agent agent)
      Creates an LLM-based decomposer that asks an agent to break down the task.
      Parameters:
      agent - the agent to use for decomposition
      Returns:
      an LLM-based decomposer