server: add data: [DONE] to /chat/completions stream response (#9459)

This commit is contained in:
VoidIsVoid 2024-09-14 17:36:44 +08:00 committed by GitHub
parent 1f4111e540
commit dcdcee3a74
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View file

@ -2993,6 +2993,8 @@ int main(int argc, char ** argv) {
}, [&](json error_data) {
server_sent_event(sink, "error", error_data);
});
static const std::string ev_done = "data: [DONE]\n\n";
sink.write(ev_done.data(), ev_done.size());
sink.done();
return true;
};