Revert to OAI-compatible args (#20213)
* Revert to OAI-compatible args * Apply workaround::func_args_not_string
This commit is contained in:
parent
ff52ee964d
commit
b283f6d5b3
|
|
@ -129,7 +129,7 @@ json common_chat_msg::to_json_oaicompat(bool concat_typed_text) const {
|
|||
{"type", "function"},
|
||||
{"function", {
|
||||
{"name", tool_call.name},
|
||||
{"arguments", json::parse(tool_call.arguments)},
|
||||
{"arguments", json(tool_call.arguments)},
|
||||
}},
|
||||
};
|
||||
if (!tool_call.id.empty()) {
|
||||
|
|
@ -1353,6 +1353,8 @@ static common_chat_params common_chat_templates_apply_jinja(const struct common_
|
|||
params.add_bos = tmpls->add_bos;
|
||||
params.add_eos = tmpls->add_eos;
|
||||
|
||||
workaround::func_args_not_string(params.messages);
|
||||
|
||||
if (!tmpl.original_caps().supports_system_role) {
|
||||
workaround::system_message_not_supported(params.messages);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1434,9 +1434,7 @@ static void test_msgs_oaicompat_json_conversion() {
|
|||
" \"type\": \"function\",\n"
|
||||
" \"function\": {\n"
|
||||
" \"name\": \"python\",\n"
|
||||
" \"arguments\": {\n"
|
||||
" \"code\": \"print('hey')\"\n"
|
||||
" }\n"
|
||||
" \"arguments\": \"{\\\"code\\\":\\\"print('hey')\\\"}\"\n"
|
||||
" }\n"
|
||||
" }\n"
|
||||
" ]\n"
|
||||
|
|
|
|||
Loading…
Reference in New Issue