2025-11-02 18:36:21 -03:00
|
|
|
use super::ModelHandler;
|
2025-11-05 10:35:54 -03:00
|
|
|
use regex;
|
2025-11-02 18:36:21 -03:00
|
|
|
|
|
|
|
|
pub struct DeepseekR3Handler;
|
|
|
|
|
|
|
|
|
|
impl ModelHandler for DeepseekR3Handler {
|
|
|
|
|
fn is_analysis_complete(&self, buffer: &str) -> bool {
|
|
|
|
|
buffer.contains("</think>")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn process_content(&self, content: &str) -> String {
|
2025-11-05 10:35:54 -03:00
|
|
|
let re = regex::Regex::new(r"<think>.*?</think>").unwrap();
|
|
|
|
|
re.replace_all(content, "").to_string()
|
2025-11-02 18:36:21 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn has_analysis_markers(&self, buffer: &str) -> bool {
|
|
|
|
|
buffer.contains("<think>")
|
|
|
|
|
}
|
|
|
|
|
}
|