diff --git a/examples/server/server.cpp b/examples/server/server.cpp index 270ec9075..6e79d4240 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -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); };