File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ json common_chat_msg::to_json_oaicompat(bool concat_typed_text) const {
129129 {" type" , " function" },
130130 {" function" , {
131131 {" name" , tool_call.name },
132- {" arguments" , json::parse (tool_call.arguments )},
132+ {" arguments" , json (tool_call.arguments )},
133133 }},
134134 };
135135 if (!tool_call.id .empty ()) {
@@ -1353,6 +1353,8 @@ static common_chat_params common_chat_templates_apply_jinja(const struct common_
13531353 params.add_bos = tmpls->add_bos ;
13541354 params.add_eos = tmpls->add_eos ;
13551355
1356+ workaround::func_args_not_string (params.messages );
1357+
13561358 if (!tmpl.original_caps ().supports_system_role ) {
13571359 workaround::system_message_not_supported (params.messages );
13581360 }
Original file line number Diff line number Diff line change @@ -1434,9 +1434,7 @@ static void test_msgs_oaicompat_json_conversion() {
14341434 " \" type\" : \" function\" ,\n "
14351435 " \" function\" : {\n "
14361436 " \" name\" : \" python\" ,\n "
1437- " \" arguments\" : {\n "
1438- " \" code\" : \" print('hey')\"\n "
1439- " }\n "
1437+ " \" arguments\" : \" {\\\" code\\\" :\\\" print('hey')\\\" }\"\n "
14401438 " }\n "
14411439 " }\n "
14421440 " ]\n "
You can’t perform that action at this time.
0 commit comments