Skip to main content

Module extract

Module extract 

Source
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.