Skip to content

Commit b407a4e

Browse files
committed
return only "prompt" field in /apply-template
1 parent 453d204 commit b407a4e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/server/server.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4127,8 +4127,10 @@ int main(int argc, char ** argv) {
41274127
const auto handle_apply_template = [&ctx_server, &params, &res_ok](const httplib::Request & req, httplib::Response & res) {
41284128
auto body = json::parse(req.body);
41294129
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;
4130-
json data = oaicompat_completion_params_parse(body, chat_template, params.use_jinja);
41314130

4131+
// format and return only the "prompt" field
4132+
json data = json::object();
4133+
data["prompt"] = oaicompat_completion_params_parse(body, chat_template, params.use_jinja)["prompt"];
41324134
res_ok(res, data);
41334135
};
41344136

0 commit comments

Comments
 (0)