feat: remove ^$ anchor in recipe regex for json responses (#2140)

This commit is contained in:
Kalvin C
2025-04-10 13:44:57 -07:00
committed by GitHub
parent 62c8d0049b
commit c039df28a8
+1 -1
View File
@@ -822,7 +822,7 @@ impl Agent {
let content = result.as_concat_text();
// the response may be contained in ```json ```, strip that before parsing json
let re = Regex::new(r"(?s)^```[^\n]*\n(.*?)\n```$").unwrap();
let re = Regex::new(r"(?s)```[^\n]*\n(.*?)\n```").unwrap();
let clean_content = re
.captures(&content)
.and_then(|caps| caps.get(1).map(|m| m.as_str()))