Skip to content

Commit 45fac2a

Browse files
added fix for arg_value (it can read multiple lines with ASCIIs)
1 parent 6f74eeb commit 45fac2a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

common/chat.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1347,7 +1347,7 @@ static void common_chat_parse_glm_4_5(common_chat_msg_parser & builder) {
13471347
// GLM 4.5 uses format: <tool_call>function_name\n<arg_key>key</arg_key>\n<arg_value>value</arg_value>\n</tool_call>
13481348
static const common_regex tool_call_start("<tool_call>([^\n<]+)");
13491349
static const common_regex arg_key_regex("<arg_key>([^<]+)</arg_key>");
1350-
static const common_regex arg_value_regex("<arg_value>(.*?)</arg_value>");
1350+
static const common_regex arg_value_regex("<arg_value>([\\s\\S]*?)</arg_value>");
13511351
static const common_regex tool_call_end("</tool_call>");
13521352

13531353
while (auto res = builder.try_find_regex(tool_call_start)) {

0 commit comments

Comments
 (0)