Package com.tnsai.prompt.aot
Class AtomGenerator
java.lang.Object
com.tnsai.prompt.aot.AtomGenerator
Generates atomic reasoning units from complex problems.
AtomGenerator decomposes a complex problem into independent atoms that can be solved in parallel, avoiding error propagation typical in linear Chain-of-Thought reasoning.
Usage
AtomGenerator generator = new AtomGenerator(llmClient);
List<Atom> atoms = generator.decompose(
"Calculate the total cost including tax and shipping for 3 items"
);
// atoms might include:
// - Atom 1: Calculate item subtotal
// - Atom 2: Calculate tax amount
// - Atom 3: Calculate shipping cost
// - Atom 4: Sum all components (depends on 1, 2, 3)
-
Constructor Summary
ConstructorsConstructorDescriptionAtomGenerator(com.tnsai.llm.LLMClient llmClient) Creates an AtomGenerator with LLM-based decomposition.AtomGenerator(com.tnsai.llm.LLMClient llmClient, int maxAtoms, boolean useHeuristics) Creates an AtomGenerator with custom settings. -
Method Summary
-
Constructor Details
-
AtomGenerator
public AtomGenerator(com.tnsai.llm.LLMClient llmClient) Creates an AtomGenerator with LLM-based decomposition. -
AtomGenerator
public AtomGenerator(com.tnsai.llm.LLMClient llmClient, int maxAtoms, boolean useHeuristics) Creates an AtomGenerator with custom settings.- Parameters:
llmClient- LLM client for decompositionmaxAtoms- maximum number of atoms to generateuseHeuristics- use pattern-based heuristics before LLM
-
-
Method Details
-
decompose
Decomposes a problem into atoms.- Parameters:
problem- the problem to decompose- Returns:
- list of atoms
-
singleAtom
Creates a simple single-atom decomposition for trivial problems.
-