server: in SSE mode, send HTTP headers when slot starts (#23884)

* server: in SSE mode, send HTTP headers when slot starts

* ref to pr

* stream should be false by default
This commit is contained in:
Xuan-Son Nguyen
2026-05-30 00:06:29 +02:00
committed by GitHub
parent 151f3a98e9
commit 0821c5fcfd
3 changed files with 21 additions and 6 deletions

View File

@@ -1422,6 +1422,9 @@ void server_task_result_cmpl_partial::update(task_result_state & state) {
json server_task_result_cmpl_partial::to_json() {
GGML_ASSERT(is_updated && "update() must be called before to_json()");
if (is_begin) {
return nullptr; // simply signal to HTTP handler to send the headers and status code
}
switch (res_type) {
case TASK_RESPONSE_TYPE_NONE:
return to_json_non_oaicompat();