From c50d887ec2780dd9e6b8b397e92347d3db8d5575 Mon Sep 17 00:00:00 2001 From: Jesse CreateThis Date: Sat, 23 Aug 2025 10:42:26 -0400 Subject: [PATCH] Try using try_find_literal instead of regex --- common/chat.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common/chat.cpp b/common/chat.cpp index 2150894459..fbf7cb7c44 100644 --- a/common/chat.cpp +++ b/common/chat.cpp @@ -1352,8 +1352,7 @@ static void common_chat_parse_deepseek_v3_1(common_chat_msg_parser & builder) { // There's no opening "" tag, so we need to handle this differently // First, try to find the "" tag that separates thinking from regular content - static const common_regex thinking_end_regex(""); - if (auto res = builder.try_find_regex(thinking_end_regex, std::string::npos, false)) { + if (auto res = builder.try_find_literal("")) { // The prelude contains everything before the "" tag auto stripped_reasoning = string_strip(res->prelude); @@ -1361,7 +1360,7 @@ static void common_chat_parse_deepseek_v3_1(common_chat_msg_parser & builder) { builder.add_reasoning_content(stripped_reasoning); } - // The parser position is already advanced past the "" tag by try_find_regex + // The parser position is already advanced past the "" tag by try_find_literal // The rest is regular content builder.add_content(builder.consume_rest()); } else {