chat : enable tool call in thinking for DS4 (#26269)

This commit is contained in:
Piotr Wilkin (ilintar) authored and GitHub committed 2026-08-01 00:13:07 -05:00
1 parent 876a432116
commit ddd4ec1428
3 files changed
+124 -101

No files matched your search

+14
View File
@@ -4227,6 +4227,20 @@ static void test_template_output_peg_parsers(bool detailed_debug) {
.expect_reasoning("I'm thinking")
.expect_content("Hello, world!\nWhat's up?")
.run();
tst.test(
"Let me check the time\n\n"
"<|DSML|tool_calls>\n"
"<|DSML|invoke name=\"get_time\">\n"
"<|DSML|parameter name=\"city\" string=\"true\">Tokyo</|DSML|parameter>\n"
"</|DSML|invoke>\n"
"</|DSML|tool_calls>") // no </think> after the TC close because the grammar will immediately constrain it to end
.enable_thinking(true)
.reasoning_format(COMMON_REASONING_FORMAT_DEEPSEEK)
.tools({ get_time_tool })
.expect_reasoning("Let me check the time")
.expect_tool_calls({ { "get_time", R"({"city": "Tokyo"})", {} } })
.run();
}
// GLM-4.6 tests - format: <tool_call>function_name\n<arg_key>...</arg_key>\n<arg_value>...</arg_value>\n</tool_call>