diff --git a/common/chat.cpp b/common/chat.cpp index 6e087625a5..154b2a352d 100644 --- a/common/chat.cpp +++ b/common/chat.cpp @@ -1829,7 +1829,7 @@ static common_chat_params common_chat_params_init_hermes_2_pro(const common_chat auto tool_call = builder.add_rule("tool_call", string_join(tool_call_alts, " | ")); builder.add_rule("thinking-start", "\"\""); - builder.add_rule("thinking-content", "[^\\x00]*"); + builder.add_rule("thinking-content", "( [^<] | \"<\" [^/] | \"] )*"); builder.add_rule("thinking-end", "\"\" space"); //thinking grammar logic depending on if thinking_forced_open was to true (so already opened (and maybe closed)) and if thinking is even allowed