botserver/src/llm_models/deepseek_r3.rs
Rodrigo Rodriguez (Pragmatismo) 26f995b8d0 feat: update deepseek_r3 regex and add test case
Updated the regex pattern in DeepseekR3Handler to use (?s) flag for dot-matches-newline behavior when removing <think> tags. Added comprehensive test case that verifies the handler correctly processes content with multiline think tags. Also made styling changes to the web interface, though the full diff was truncated.
2025-11-05 14:28:14 -03:00

19 lines
498 B
Rust

use super::ModelHandler;
use regex;
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 {
let re = regex::Regex::new(r"(?s)<think>.*?</think>").unwrap();
re.replace_all(content, "").to_string()
}
fn has_analysis_markers(&self, buffer: &str) -> bool {
buffer.contains("<think>")
}
}