Skip to content

Commit d19e2da

Browse files
committed
fix
1 parent a29ac57 commit d19e2da

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

examples/server/server.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3841,6 +3841,7 @@ int main(int argc, char ** argv) {
38413841
//SRV_DBG("Prompt: %s\n", prompt.is_string() ? prompt.get<std::string>().c_str() : prompt.dump(2).c_str());
38423842

38433843
if (prompt.contains("chat_history")) {
3844+
res_ok(res, {{ "success", true }});
38443845
return;
38453846
}
38463847

@@ -3932,7 +3933,7 @@ int main(int argc, char ** argv) {
39323933
}
39333934
};
39343935

3935-
const auto handle_completions = [&handle_completions_impl](const httplib::Request & req, httplib::Response & res) {
3936+
const auto handle_completions = [&handle_completions_impl, &res_ok](const httplib::Request & req, httplib::Response & res) {
39363937
if (req.body.find("chat_history") != std::string::npos) {
39373938
res_ok(res, {{ "success", true }});
39383939
return;
@@ -3947,7 +3948,7 @@ int main(int argc, char ** argv) {
39473948
OAICOMPAT_TYPE_NONE);
39483949
};
39493950

3950-
const auto handle_completions_oai = [&handle_completions_impl](const httplib::Request & req, httplib::Response & res) {
3951+
const auto handle_completions_oai = [&handle_completions_impl, &res_ok](const httplib::Request & req, httplib::Response & res) {
39513952
if (req.body.find("chat_history") != std::string::npos) {
39523953
res_ok(res, {{ "success", true }});
39533954
return;
@@ -4039,7 +4040,7 @@ int main(int argc, char ** argv) {
40394040
OAICOMPAT_TYPE_NONE); // infill is not OAI compatible
40404041
};
40414042

4042-
const auto handle_chat_completions = [&ctx_server, &params, &res_error, &handle_completions_impl](const httplib::Request & req, httplib::Response & res) {
4043+
const auto handle_chat_completions = [&ctx_server, &params, &res_error, &handle_completions_impl, &res_ok](const httplib::Request & req, httplib::Response & res) {
40434044
LOG_DBG("request: %s\n", req.body.c_str());
40444045
if (ctx_server.params_base.embedding) {
40454046
res_error(res, format_error_response("This server does not support completions. Start it without `--embeddings`", ERROR_TYPE_NOT_SUPPORTED));

0 commit comments

Comments
 (0)