@@ -411,6 +411,7 @@ const common_chat_msg message_assist_thoughts_unparsed_md = simple_assis
411411const common_chat_msg message_assist_thoughts_unparsed_md_partial = simple_assist_msg(" <think>I'm\n thinking</think>Hello, world!\n What's up?\n ```json\n {}" );
412412
413413const common_chat_msg message_assist_thoughts_unparsed_r7b = simple_assist_msg(" <|START_THINKING|>I'm\n thinking<|END_THINKING|>Hello, world!\n What's up?" );
414+ const common_chat_msg message_assist_thoughts_unparsed_magistral = simple_assist_msg(" [THINK]raisonnement[/THINK]Réponse" );
414415const common_chat_msg message_assist_thoughts = simple_assist_msg(" Hello, world!\n What's up?" , " I'm\n thinking" );
415416const common_chat_msg message_assist_thoughts_unopened_unparsed = simple_assist_msg(" I'm\n thinking</think>Hello, world!\n What's up?" );
416417const common_chat_msg message_assist_thoughts_no_content = simple_assist_msg(" " , " I'm\n thinking" );
@@ -745,6 +746,17 @@ static void test_template_output_parsers() {
745746 tmpls.get (), end_tokens, message_assist_call_id, tools,
746747 " [TOOL_CALLS][{\" name\" : \" special_function\" , \" arguments\" : {\" arg1\" : 1}, \" id\" : \" 123456789\" }]" );
747748 }
749+ {
750+ assert_msg_equals (
751+ simple_assist_msg (" Réponse" , " raisonnement" ),
752+ common_chat_parse (
753+ message_assist_thoughts_unparsed_magistral.content ,
754+ /* is_partial= */ false ,
755+ {
756+ /* .format = */ COMMON_CHAT_FORMAT_MAGISTRAL,
757+ /* .reasoning_format = */ COMMON_REASONING_FORMAT_AUTO,
758+ }));
759+ }
748760 {
749761 auto tmpls = read_templates (" models/templates/Qwen-QwQ-32B.jinja" );
750762 std::vector<std::string> end_tokens{ " <|im_end|>" };
0 commit comments