From 495b9ed126e66ceff44b04e3c1b487cca5ea1c93 Mon Sep 17 00:00:00 2001 From: Asep Haryana Date: Sun, 26 Jul 2026 16:03:18 +0700 Subject: [PATCH] fix: remove /think trigger, add back in clean_text - Removed /think trigger from prompt (model generates better without it) - Added and back to clean_text (model uses plain text thinking tags, not special tokens) --- src/application/chat/use_cases.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/application/chat/use_cases.rs b/src/application/chat/use_cases.rs index 4604966..b9b6c6d 100644 --- a/src/application/chat/use_cases.rs +++ b/src/application/chat/use_cases.rs @@ -89,8 +89,8 @@ pub fn build_prompt(messages: &[ChatMessage], tools: &Option>) -> S } } - // Generation prompt: thinking mode (MiniCPM5 native) - prompt.push_str("<|im_start|>assistant\n/think\n\n"); + // Generation prompt + prompt.push_str("<|im_start|>assistant\n"); prompt } @@ -187,6 +187,8 @@ pub fn clean_text(text: &str) -> String { .replace("<|tool_call|>", "") .replace("<|execute_start|>", "") .replace("<|execute_end|>", "") + .replace("", "") + .replace("", "") .replace("/think", "") .replace("/no_think", "") .trim()