Package com.tnsai.prompt.aot
Class AtomSolver
java.lang.Object
com.tnsai.prompt.aot.AtomSolver
Solves atoms in parallel with dependency resolution.
AtomSolver processes atoms respecting their dependencies, executing independent atoms in parallel while ensuring dependent atoms wait for their prerequisites.
Usage
AtomSolver solver = new AtomSolver(llmClient);
// Solve atoms (parallel where possible)
List<Atom> solvedAtoms = solver.solve(atoms);
// Check results
for (Atom atom : solvedAtoms) {
System.out.println(atom.getDescription() + ": " + atom.getSolution());
System.out.println("Confidence: " + atom.getConfidence());
}
-
Constructor Summary
ConstructorsConstructorDescriptionAtomSolver(com.tnsai.llm.LLMClient llmClient) Creates an AtomSolver with default settings.AtomSolver(com.tnsai.llm.LLMClient llmClient, ExecutorService executor, int timeoutSeconds, boolean includeContext) Creates an AtomSolver with custom settings. -
Method Summary
-
Constructor Details
-
AtomSolver
public AtomSolver(com.tnsai.llm.LLMClient llmClient) Creates an AtomSolver with default settings. -
AtomSolver
public AtomSolver(com.tnsai.llm.LLMClient llmClient, ExecutorService executor, int timeoutSeconds, boolean includeContext) Creates an AtomSolver with custom settings.- Parameters:
llmClient- LLM client for solvingexecutor- executor for parallel processingtimeoutSeconds- timeout per atomincludeContext- include dependency solutions as context
-
-
Method Details
-
solve
Solves all atoms respecting dependencies.- Parameters:
atoms- list of atoms to solve- Returns:
- solved atoms
-
solveSingle
Solves a single atom without dependencies. -
shutdown
public void shutdown()Shuts down the executor.
-