Expand description
Strips the formatting a model wraps around its whole reply. Whether what is
left is usable is the reply format’s question (reply), then the purpose’s own
check (validate).
Functions§
- sanitize_
ambient_ text - Removes, repeatedly, then trims: a code fence wrapping the whole text (optionally with a language tag), one matching pair of quotes wrapping it, and a conversational opener (“Yeah, let’s…”). A reply left with nothing but backticks (an empty fence) becomes “”, which callers already treat as no reply.