now actually works

This commit is contained in:
2024-01-24 23:59:28 +01:00
parent 83264db09d
commit f5650475c7
2 changed files with 19 additions and 5 deletions

View File

@@ -121,7 +121,12 @@ std::string LlamaCppWeb::completeLine(const std::string_view prompt) {
{"stop", {"\n"}},
});
return ret.dump();
if (ret.empty() || ret.count("content") == 0) {
// error
return "";
}
return ret.at("content");
}
nlohmann::json LlamaCppWeb::complete(const nlohmann::json& request_j) {