Skip to content

Commit 5432887

Browse files
fixed reasoning_content
This fixes the problem of thinking message not coming in reasoning_content variable.
1 parent e0ee297 commit 5432887

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

common/chat.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1337,6 +1337,7 @@ static common_chat_params common_chat_params_init_glm_4_5(const common_chat_temp
13371337
}
13381338

13391339
static void common_chat_parse_glm_4_5(common_chat_msg_parser & builder) {
1340+
builder.consume_spaces();
13401341
builder.try_parse_reasoning("<think>", "</think>");
13411342
if (!builder.syntax().parse_tool_calls) {
13421343
builder.add_content(builder.consume_rest());
@@ -1867,7 +1868,7 @@ static common_chat_params common_chat_templates_apply_jinja(
18671868
}
18681869

18691870
// GLM 4.5: detect by <arg_key> and <arg_value> tags (check before Hermes since both use <tool_call>)
1870-
if (src.find("<arg_key>") != std::string::npos && src.find("<arg_value>") != std::string::npos && params.json_schema.is_null()) {
1871+
if (src.find("[gMASK]<sop>") != std::string::npos && src.find("<arg_key>") != std::string::npos && src.find("<arg_value>") != std::string::npos && params.json_schema.is_null()) {
18711872
return common_chat_params_init_glm_4_5(tmpl, params);
18721873
}
18731874

0 commit comments

Comments
 (0)