idk
This commit is contained in:
Binary file not shown.
@@ -283,20 +283,15 @@ async fn chat_completions(
|
||||
// Many OpenAI-compatible clients expect a terminal [DONE] marker.
|
||||
// Emit it when the upstream stream ends to avoid clients treating
|
||||
// the response as incomplete.
|
||||
<<<<<<< HEAD
|
||||
// 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_stream = futures::stream::iter(vec![done_event]);
|
||||
let out = sse_stream.chain(done_stream);
|
||||
|
||||
Ok(
|
||||
Sse::new(out)
|
||||
.keep_alive(
|
||||
axum::response::sse::KeepAlive::new()
|
||||
.interval(Duration::from_secs(15))
|
||||
.text(": keep-alive"),
|
||||
)
|
||||
.into_response(),
|
||||
)
|
||||
Ok(Sse::new(out).into_response())
|
||||
}
|
||||
Err(e) => {
|
||||
// Record provider failure
|
||||
|
||||
Reference in New Issue
Block a user