@@ -3841,6 +3841,7 @@ int main(int argc, char ** argv) {
3841
3841
// SRV_DBG("Prompt: %s\n", prompt.is_string() ? prompt.get<std::string>().c_str() : prompt.dump(2).c_str());
3842
3842
3843
3843
if (prompt.contains (" chat_history" )) {
3844
+ res_ok (res, {{ " success" , true }});
3844
3845
return ;
3845
3846
}
3846
3847
@@ -3932,7 +3933,7 @@ int main(int argc, char ** argv) {
3932
3933
}
3933
3934
};
3934
3935
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) {
3936
3937
if (req.body .find (" chat_history" ) != std::string::npos) {
3937
3938
res_ok (res, {{ " success" , true }});
3938
3939
return ;
@@ -3947,7 +3948,7 @@ int main(int argc, char ** argv) {
3947
3948
OAICOMPAT_TYPE_NONE);
3948
3949
};
3949
3950
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) {
3951
3952
if (req.body .find (" chat_history" ) != std::string::npos) {
3952
3953
res_ok (res, {{ " success" , true }});
3953
3954
return ;
@@ -4039,7 +4040,7 @@ int main(int argc, char ** argv) {
4039
4040
OAICOMPAT_TYPE_NONE); // infill is not OAI compatible
4040
4041
};
4041
4042
4042
- const auto handle_chat_completions = [&ctx_server, ¶ms, &res_error, &handle_completions_impl](const httplib::Request & req, httplib::Response & res) {
4043
+ const auto handle_chat_completions = [&ctx_server, ¶ms, &res_error, &handle_completions_impl, &res_ok ](const httplib::Request & req, httplib::Response & res) {
4043
4044
LOG_DBG (" request: %s\n " , req.body .c_str ());
4044
4045
if (ctx_server.params_base .embedding ) {
4045
4046
res_error (res, format_error_response (" This server does not support completions. Start it without `--embeddings`" , ERROR_TYPE_NOT_SUPPORTED));
0 commit comments