Class LLMOutputParser

java.lang.Object
com.tnsai.reasoning.LLMOutputParser

public final class LLMOutputParser extends Object
Utility for parsing structured content from LLM responses.
  • Method Details

    • parseNumberedList

      public static List<String> parseNumberedList(String text)
      Parses a numbered list from LLM output.

      Recognizes lines starting with "1.", "1)", or "1:" patterns.

      Parameters:
      text - the LLM output text
      Returns:
      list of extracted items (never empty — returns the original text if no items found)
    • parseNumberedList

      public static List<String> parseNumberedList(String text, int limit)
      Parses a numbered list, limiting results to the given count.
      Parameters:
      text - the LLM output text
      limit - maximum number of items to return
      Returns:
      list of extracted items, limited to the given count