@@ -26,8 +26,8 @@ static common_chat_msg msg_from_json(const json & message) {
2626 if (message.contains (" tool_plan" )) {
2727 ret.tool_plan = message.at (" tool_plan" );
2828 }
29- if (message.contains (" thoughts " )) {
30- ret.thoughts = message.at (" thoughts " );
29+ if (message.contains (" reasoning_content " )) {
30+ ret.reasoning_content = message.at (" reasoning_content " );
3131 }
3232 auto has_tool_calls = message.contains (" tool_calls" );
3333 if (has_tool_calls) {
@@ -108,7 +108,7 @@ static std::string dump(const json & j) {
108108static void assert_msg_equals (const common_chat_msg & expected, const common_chat_msg & actual) {
109109 assert_equals (expected.role , actual.role );
110110 assert_equals (expected.content , actual.content );
111- assert_equals (expected.thoughts , actual.thoughts );
111+ assert_equals (expected.reasoning_content , actual.reasoning_content );
112112 assert_equals (expected.tool_plan , actual.tool_plan );
113113 assert_equals (expected.tool_calls .size (), actual.tool_calls .size ());
114114 for (size_t i = 0 ; i < expected.tool_calls .size (); i++) {
@@ -293,10 +293,10 @@ static void test_template_output_parsers() {
293293 { " role" , " assistant" },
294294 { " content" , " Hello, world!" },
295295 };
296- json text_thoughts_message {
296+ json text_reasoning_message {
297297 { " role" , " assistant" },
298298 { " content" , " Hello, world!" },
299- { " thoughts " , " I'm thinking" },
299+ { " reasoning_content " , " I'm thinking" },
300300 };
301301 json tool_calls = json::array ({{
302302 { " type" , " function" },
@@ -316,10 +316,10 @@ static void test_template_output_parsers() {
316316 },
317317 }},
318318 };
319- json tool_call_thoughts_message = {
319+ json tool_call_reasoning_message = {
320320 { " role" , " assistant" },
321321 { " content" , nullptr },
322- { " thoughts " , " I'm\n thinking" },
322+ { " reasoning_content " , " I'm\n thinking" },
323323 { " tool_calls" , {
324324 {
325325 { " type" , " function" },
@@ -589,8 +589,8 @@ static void test_template_output_parsers() {
589589 assert_equals (COMMON_CHAT_FORMAT_DEEPSEEK_R1, common_chat_params_init (tmpl, inputs_tools).format );
590590
591591 test_template (tmpl, end_tokens, text_message, tools, " Hello, world!" , /* expect_grammar_triggered= */ false );
592- test_template (tmpl, end_tokens, text_thoughts_message , tools, " Hello, world!" , /* expect_grammar_triggered= */ false );
593- assert_msg_equals (msg_from_json (text_thoughts_message ), common_chat_parse (" <think>I'm thinking</think>Hello, world!" , COMMON_CHAT_FORMAT_DEEPSEEK_R1));
592+ test_template (tmpl, end_tokens, text_reasoning_message , tools, " Hello, world!" , /* expect_grammar_triggered= */ false );
593+ assert_msg_equals (msg_from_json (text_reasoning_message ), common_chat_parse (" <think>I'm thinking</think>Hello, world!" , COMMON_CHAT_FORMAT_DEEPSEEK_R1));
594594 // test_template(tmpl, end_tokens, tool_call_message, tools,
595595 // "<|tool▁calls▁begin|><|tool▁call▁begin|>function<|tool▁sep|>special_function\n"
596596 // "```json\n"
@@ -609,10 +609,10 @@ static void test_template_output_parsers() {
609609 assert_equals (COMMON_CHAT_FORMAT_DEEPSEEK_R1, common_chat_params_init (tmpl, inputs_tools).format );
610610
611611 test_template (tmpl, end_tokens, text_message, tools, " Hello, world!" , /* expect_grammar_triggered= */ false );
612- test_template (tmpl, end_tokens, text_thoughts_message , tools, " Hello, world!" , /* expect_grammar_triggered= */ false );
613- assert_msg_equals (msg_from_json (text_thoughts_message ), common_chat_parse (" <think>I'm thinking</think>Hello, world!" , COMMON_CHAT_FORMAT_DEEPSEEK_R1));
612+ test_template (tmpl, end_tokens, text_reasoning_message , tools, " Hello, world!" , /* expect_grammar_triggered= */ false );
613+ assert_msg_equals (msg_from_json (text_reasoning_message ), common_chat_parse (" <think>I'm thinking</think>Hello, world!" , COMMON_CHAT_FORMAT_DEEPSEEK_R1));
614614
615- assert_msg_equals (msg_from_json (tool_call_thoughts_message ),
615+ assert_msg_equals (msg_from_json (tool_call_reasoning_message ),
616616 common_chat_parse (
617617 " <think>I'm\n thinking</think>\n\n "
618618 " <|tool▁calls▁begin|><|tool▁call▁begin|>function<|tool▁sep|>special_function\n "
0 commit comments