Package com.tnsai.prompt.aot
Class AtomSynthesizer
java.lang.Object
com.tnsai.prompt.aot.AtomSynthesizer
Synthesizes atom solutions into a final coherent answer.
AtomSynthesizer combines the solutions from multiple atoms, weighing them by confidence and resolving any conflicts.
Usage
AtomSynthesizer synthesizer = new AtomSynthesizer(llmClient);
AotResult result = synthesizer.synthesize(
"What is the total cost including tax?",
solvedAtoms
);
System.out.println("Answer: " + result.getAnswer());
System.out.println("Confidence: " + result.getConfidence());
System.out.println("Reasoning: " + result.getReasoning());
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSynthesis strategies. -
Constructor Summary
ConstructorsConstructorDescriptionAtomSynthesizer(com.tnsai.llm.LLMClient llmClient) Creates an AtomSynthesizer with default settings.AtomSynthesizer(com.tnsai.llm.LLMClient llmClient, AtomSynthesizer.SynthesisStrategy strategy, float minConfidenceThreshold) Creates an AtomSynthesizer with custom settings. -
Method Summary
Modifier and TypeMethodDescriptionsynthesize(String originalQuestion, List<Atom> atoms) Synthesizes atom solutions into a final result.
-
Constructor Details
-
AtomSynthesizer
public AtomSynthesizer(com.tnsai.llm.LLMClient llmClient) Creates an AtomSynthesizer with default settings. -
AtomSynthesizer
public AtomSynthesizer(com.tnsai.llm.LLMClient llmClient, AtomSynthesizer.SynthesisStrategy strategy, float minConfidenceThreshold) Creates an AtomSynthesizer with custom settings.- Parameters:
llmClient- LLM client for synthesisstrategy- synthesis strategyminConfidenceThreshold- minimum confidence to include atom
-
-
Method Details
-
synthesize
Synthesizes atom solutions into a final result.- Parameters:
originalQuestion- the original questionatoms- solved atoms- Returns:
- synthesized result
-