File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -1352,15 +1352,16 @@ static void common_chat_parse_deepseek_v3_1(common_chat_msg_parser & builder) {
13521352 // There's no opening "<think>" tag, so we need to handle this differently
13531353
13541354 // First, try to find the "</think>" tag that separates thinking from regular content
1355- if (auto res = builder.try_find_literal (" </think>" )) {
1355+ static const common_regex thinking_end_regex (" </think>" );
1356+ if (auto res = builder.try_find_regex (thinking_end_regex, std::string::npos, false )) {
13561357 // The prelude contains everything before the "</think>" tag
13571358 auto stripped_reasoning = string_strip (res->prelude );
13581359
13591360 if (!stripped_reasoning.empty ()) {
13601361 builder.add_reasoning_content (stripped_reasoning);
13611362 }
13621363
1363- // The parser position is already advanced past the "</think>" tag by try_find_literal
1364+ // The parser position is already advanced past the "</think>" tag by try_find_regex
13641365 // The rest is regular content
13651366 builder.add_content (builder.consume_rest ());
13661367 } else {
You can’t perform that action at this time.
0 commit comments