Package com.tnsai.planning.tasklist
Class TaskListExecutor
java.lang.Object
com.tnsai.planning.tasklist.TaskListExecutor
Executes a task list using iterative refinement for each task.
TaskListExecutor is the orchestrator of the Ralph Pattern, combining:
- Task List Driven - Processes tasks sequentially from a
TaskList - Clean Context - Creates a fresh
RefinementLoopper task - Progress Memory - Injects prior learnings via
ProgressMemory
Usage
TaskList tasks = PRDParser.parse(Path.of("prd.json"));
TaskListResult result = TaskListExecutor.builder()
.taskList(tasks)
.progressMemory(ProgressMemory.inMemory())
.maxIterationsPerTask(5)
.timeoutPerTask(Duration.ofMinutes(10))
.onTaskComplete(tr -> log.info("Done: {}", tr.taskItem().name()))
.build()
.execute(agent);
System.out.printf("Completed %d/%d tasks (%.0f%%)%n",
result.completedCount(), result.totalCount(),
result.completionRate() * 100);
- Author:
- TnsAI Team
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder for TaskListExecutor. -
Method Summary
Modifier and TypeMethodDescriptionstatic TaskListExecutor.Builderbuilder()Creates a new builder.execute(com.tnsai.agents.Agent agent) Executes the task list with an agent.execute(com.tnsai.llm.LLMClient llm) Executes the task list with an LLM client.
-
Method Details
-
builder
Creates a new builder. -
execute
Executes the task list with an agent.- Parameters:
agent- the agent to use for refinement- Returns:
- the execution result
-
execute
Executes the task list with an LLM client.- Parameters:
llm- the LLM client to use- Returns:
- the execution result
-