File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -1362,8 +1362,7 @@ static void common_chat_parse_gpt_oss(common_chat_msg_parser & builder) {
1362
1362
static const common_regex user_tool_call_regex (
1363
1363
" functions\\ .([a-zA-Z_][a-zA-Z0-9_]*)\\ s?(?:<\\ |constrain\\ |>([a-zA-Z]+))?<\\ |message\\ |>"
1364
1364
);
1365
- static const common_regex browser_tool_call_regex (" browser\\ .(search|open|find)[\\ s\\ S]*<\\ |message\\ |>" );
1366
- static const common_regex python_tool_call_regex (" python\\ s?(?:code)?<\\ |message\\ |>" );
1365
+ static const common_regex builtin_tool_call_regex (" (?:browser|python)[\\ s\\ S]*<\\ |message\\ |>" );
1367
1366
1368
1367
auto consume_until_start = [&]() {
1369
1368
if (auto res = builder.try_find_regex (start_regex, std::string::npos, false )) {
@@ -1379,7 +1378,7 @@ static void common_chat_parse_gpt_oss(common_chat_msg_parser & builder) {
1379
1378
auto name = builder.str (res->groups [1 ]);
1380
1379
auto args = builder.consume_rest ();
1381
1380
builder.add_tool_call (name, " " , args);
1382
- } else if (builder.try_consume_regex (browser_tool_call_regex) || builder. try_consume_regex (python_tool_call_regex )) {
1381
+ } else if (builder.try_consume_regex (builtin_tool_call_regex )) {
1383
1382
builder.consume_rest ();
1384
1383
LOG_ERR (" builtin tool calls not implemented" );
1385
1384
} else {
You can’t perform that action at this time.
0 commit comments