@@ -152,32 +152,6 @@ static void test_regex() {
152152 }
153153}
154154
155- static void test_deepseek_v3_1 () {
156- // Test DeepSeek V3.1 parsing - reasoning content followed by "</think>" and then regular content
157- {
158- common_chat_syntax syntax = {
159- /* .format = */ COMMON_CHAT_FORMAT_DEEPSEEK_V3_1,
160- /* .reasoning_format = */ COMMON_REASONING_FORMAT_DEEPSEEK,
161- /* .reasoning_in_content = */ false ,
162- /* .thinking_forced_open = */ false ,
163- /* .parse_tool_calls = */ true ,
164- };
165- common_chat_msg_parser builder (" REASONING</think><function=finish>\n <parameter=message>ok
166- static void test_deepseek_v3_1() {
167- // Test DeepSeek V3.1 parsing - reasoning content followed by " </think>" and then regular content
168- {
169- common_chat_syntax syntax = {
170- /* .format = */ COMMON_CHAT_FORMAT_DEEPSEEK_V3_1,
171- /* .reasoning_format = */ COMMON_REASONING_FORMAT_DEEPSEEK,
172- /* .reasoning_in_content = */ false,
173- /* .thinking_forced_open = */ false,
174- /* .parse_tool_calls = */ true,
175- };
176- common_chat_msg_parser builder(" REASONING</think><function=finish>\n<parameter=message>ok
177- static void test_deepseek_v3_1 () {
178- // Test DeepSeek V3.1 parsing - reasoning content followed by "</think>" and then regular content
179- {
180- common_chat_msg_parser builder (" REASONING</think><function=finish>\n <parameter=message>ok
181155const std::vector<std::string> barely_healable_jsons = {
182156 " {" ,
183157 " {\" " ,
@@ -212,6 +186,21 @@ static void test(const std::string & input, bool is_partial, const std::vector<s
212186 assert_equals (is_partial, js->is_partial );
213187 assert_equals (expected, args_paths.size () == 1 && args_paths[0 ].empty () ? js->value .get <std::string>() : js->value .dump ());
214188}
189+
190+ static void test_deepseek_v3_1 () {
191+ // Test DeepSeek V3.1 parsing - reasoning content followed by "</think>" and then regular content
192+ {
193+ common_chat_syntax syntax = {
194+ /* .format = */ COMMON_CHAT_FORMAT_DEEPSEEK_V3_1,
195+ /* .reasoning_format = */ COMMON_REASONING_FORMAT_DEEPSEEK,
196+ /* .reasoning_in_content = */ false ,
197+ /* .thinking_forced_open = */ false ,
198+ /* .parse_tool_calls = */ true ,
199+ };
200+ common_chat_msg_parser builder (" REASONING</think>ok" , /* is_partial= */ false , {});
201+ }
202+ }
203+
215204static void test_with_args (const std::string & input, const std::string & expected, bool parse_as_partial = true , bool is_partial = true ) {
216205 common_chat_msg_parser builder (input, parse_as_partial, {});
217206 auto js = builder.try_consume_json_with_dumped_args ({{" args" }}, {});
0 commit comments