Expand description
Shared extraction strategies for LLM output parsing.
This is the load-bearing module — every parser calls into these functions for preprocessing, code block extraction, and bracket matching.
Functions§
- extract_
code_ block - Extract content from the first matching markdown code block.
- extract_
code_ block_ for - Extract content from a code block matching a specific language.
- find_
bracketed - Find a bracketed substring by matching open/close delimiters.
- preprocess
- Full preprocessing pipeline applied to every LLM response.
- strip_
think_ tags - Strip all
<think>...</think>and<thinking>...</thinking>blocks from text.