Class CodeFence

java.lang.Object
com.agentforge4j.util.text.CodeFence

public final class CodeFence extends Object
Strips markdown code-fence markers from LLM output text.
  • Method Details

    • strip

      public static String strip(String input)
      Removes markdown code fence markers from the input if present.

      Strips leading ``` followed by an optional language identifier, and trailing ```. Returns the input unchanged if it does not start with backticks.

      Parameters:
      input - the potentially fence-marked string
      Returns:
      the input with fences removed, or the input unchanged