Class AtomSynthesizer

java.lang.Object
com.tnsai.prompt.aot.AtomSynthesizer

public class AtomSynthesizer extends Object
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());
 
  • 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 synthesis
      strategy - synthesis strategy
      minConfidenceThreshold - minimum confidence to include atom
  • Method Details

    • synthesize

      public AotResult synthesize(String originalQuestion, List<Atom> atoms)
      Synthesizes atom solutions into a final result.
      Parameters:
      originalQuestion - the original question
      atoms - solved atoms
      Returns:
      synthesized result