fix(streaming): ensure [DONE] SSE marker uses correct error type
This commit is contained in:
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user