- Renamed `execute_compact_prompt` to `compact_prompt_for_bots` and simplified logic - Removed redundant comments and empty lines in test files - Consolidated prompt compaction threshold handling - Cleaned up UI logging implementation by removing unnecessary whitespace - Improved code organization in ui_tree module The changes focus on code quality improvements, removing clutter, and making the prompt compaction logic more straightforward. Test files were cleaned up to be more concise.
15 lines
494 B
Rust
15 lines
494 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>")
|
|
}
|
|
}
|