Skip to content

Commit f24aed8

Browse files
committed
fix
1 parent 97677f7 commit f24aed8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

examples/server/server.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3933,6 +3933,11 @@ int main(int argc, char ** argv) {
39333933
};
39343934

39353935
const auto handle_completions = [&handle_completions_impl](const httplib::Request & req, httplib::Response & res) {
3936+
if (req.body.find("chat_history") != std::string::npos) {
3937+
res_ok(res, "");
3938+
return;
3939+
}
3940+
39363941
json data = json::parse(req.body);
39373942
return handle_completions_impl(
39383943
SERVER_TASK_TYPE_COMPLETION,
@@ -3943,6 +3948,11 @@ int main(int argc, char ** argv) {
39433948
};
39443949

39453950
const auto handle_completions_oai = [&handle_completions_impl](const httplib::Request & req, httplib::Response & res) {
3951+
if (req.body.find("chat_history") != std::string::npos) {
3952+
res_ok(res, "");
3953+
return;
3954+
}
3955+
39463956
json data = oaicompat_completion_params_parse(json::parse(req.body));
39473957
return handle_completions_impl(
39483958
SERVER_TASK_TYPE_COMPLETION,
@@ -4036,6 +4046,11 @@ int main(int argc, char ** argv) {
40364046
return;
40374047
}
40384048

4049+
if (req.body.find("chat_history") != std::string::npos) {
4050+
res_ok(res, "");
4051+
return;
4052+
}
4053+
40394054
auto body = json::parse(req.body);
40404055
json data = oaicompat_completion_params_parse(body, params.use_jinja, params.reasoning_format, ctx_server.chat_templates.get());
40414056

0 commit comments

Comments
 (0)