fix(streaming): ensure [DONE] SSE marker uses correct error type
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:
2026-03-03 11:47:59 -05:00
parent 9b1e0ff669
commit 056e0c93d2

View File

@@ -283,7 +283,9 @@ 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.
let done = futures::stream::once(async { Ok(Event::default().data("[DONE]")) }); let done = futures::stream::once(async {
Ok::<Event, AppError>(Event::default().data("[DONE]"))
});
let out = sse_stream.chain(done); let out = sse_stream.chain(done);
Ok( Ok(