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

This commit is contained in:
Piotr Wilkin (ilintar) 2026-08-01 07:13:07 +02:00 committed by GitHub
parent 876a432116
commit ddd4ec1428
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 124 additions and 101 deletions

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"
"<DSMLtool_calls>\n"
"<DSMLinvoke name=\"get_time\">\n"
"<DSMLparameter name=\"city\" string=\"true\">Tokyo</DSMLparameter>\n"
"</DSMLinvoke>\n"
"</DSMLtool_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>