Skip to content

Commit 178dced

Browse files
committed
gpt-oss : fix ungrouped tool calls in grammar
1 parent cfb2f23 commit 178dced

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

common/chat.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,13 +1369,13 @@ static common_chat_params common_chat_params_init_gpt_oss(const common_chat_temp
13691369
});
13701370

13711371
auto recipient_in_role = builder.add_rule("recipient_in_role",
1372-
"\"<|start|>assistant\"? \" to=functions.\" " +
1373-
string_join(tool_rules_recipient_in_role, " | ")
1372+
"\"<|start|>assistant\"? \" to=functions.\" ( " +
1373+
string_join(tool_rules_recipient_in_role, " | ") + " )"
13741374
);
13751375

13761376
auto recipient_in_channel = builder.add_rule("recipient_in_channel",
1377-
channel + " \" to=functions.\" " +
1378-
string_join(tool_rules_recipient_in_channel, " | ")
1377+
channel + " \" to=functions.\" ( " +
1378+
string_join(tool_rules_recipient_in_channel, " | ") + " )"
13791379
);
13801380

13811381
builder.add_rule("root", recipient_in_role + " | " + recipient_in_channel);

0 commit comments

Comments
 (0)