Skip to main content

extract_code_block

Function extract_code_block 

Source
pub fn extract_code_block(text: &str) -> String
Available on crate features agents and codeact only.
Expand description

Extract the body of the first fenced code block, skipping any language tag on the fence line. Falls back to the trimmed input when no fence is present.