``` ... ```) if present, or simply trimming whitespace.
Rules:
``` fences → return the string stripped of
leading/trailing whitespace.
``` fences exist → find the last complete block,
strip the optional language label on the opening fence (e.g. ```json
or ```markdown), and return the inner content trimmed.
```) → treat
everything after the opening fence line as the content.
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static String | |
| private static int |
| FENCE | back to summary |
|---|---|
| private static final String FENCE | |
| LlmResponseCleaner | back to summary |
|---|---|
| private LlmResponseCleaner() | |
| clean | back to summary |
|---|---|
| public static String clean(@Nullable String response) Cleans the given LLM response string according to the rules above. | |
| findLastOpener | back to summary |
|---|---|
| private static int findLastOpener(String s) Returns the start index of the last "opening" ``` in the string. We treat every | |