pub fn parse_text(response: &str) -> Result<String, ParseError>Expand description
Clean an LLM response for use as plain text.
Processing:
- Strip
<think>blocks - Trim whitespace
- Strip common LLM boilerplate prefixes: “Sure!”, “Here’s…”, “Of course!”, “Certainly!”, etc.
Returns the cleaned text or EmptyResponse if nothing remains.
§Examples
use llm_output_parser::parse_text;
let result = parse_text("Sure! Paris is the capital.").unwrap();
assert_eq!(result, "Paris is the capital.");