idk
Some checks failed
CI / Check (push) Has been cancelled
CI / Clippy (push) Has been cancelled
CI / Formatting (push) Has been cancelled
CI / Test (push) Has been cancelled
CI / Release Build (push) Has been cancelled

This commit is contained in:
root
2026-03-03 17:30:17 +00:00
2 changed files with 4 additions and 9 deletions

Binary file not shown.

View File

@@ -283,20 +283,15 @@ async fn chat_completions(
// Many OpenAI-compatible clients expect a terminal [DONE] marker. // Many OpenAI-compatible clients expect a terminal [DONE] marker.
// Emit it when the upstream stream ends to avoid clients treating // Emit it when the upstream stream ends to avoid clients treating
// the response as incomplete. // the response as incomplete.
<<<<<<< HEAD
// Convert to a Vec first, then append [DONE], then stream it // Convert to a Vec first, then append [DONE], then stream it
=======
>>>>>>> refs/remotes/origin/main
let done_event = Ok::<Event, AppError>(Event::default().data("[DONE]")); let done_event = Ok::<Event, AppError>(Event::default().data("[DONE]"));
let done_stream = futures::stream::iter(vec![done_event]); let done_stream = futures::stream::iter(vec![done_event]);
let out = sse_stream.chain(done_stream); let out = sse_stream.chain(done_stream);
Ok( Ok(Sse::new(out).into_response())
Sse::new(out)
.keep_alive(
axum::response::sse::KeepAlive::new()
.interval(Duration::from_secs(15))
.text(": keep-alive"),
)
.into_response(),
)
} }
Err(e) => { Err(e) => {
// Record provider failure // Record provider failure