return only "prompt" field in /apply-template
This commit is contained in:
parent
453d204d8a
commit
b407a4e9a7
1 changed files with 3 additions and 1 deletions
|
@ -4127,8 +4127,10 @@ int main(int argc, char ** argv) {
|
|||
const auto handle_apply_template = [&ctx_server, ¶ms, &res_ok](const httplib::Request & req, httplib::Response & res) {
|
||||
auto body = json::parse(req.body);
|
||||
const auto & chat_template = body.contains("tools") && ctx_server.chat_templates.template_tool_use ? *ctx_server.chat_templates.template_tool_use : *ctx_server.chat_templates.template_default;
|
||||
json data = oaicompat_completion_params_parse(body, chat_template, params.use_jinja);
|
||||
|
||||
// format and return only the "prompt" field
|
||||
json data = json::object();
|
||||
data["prompt"] = oaicompat_completion_params_parse(body, chat_template, params.use_jinja)["prompt"];
|
||||
res_ok(res, data);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue