mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-06-15 12:31:35 +02:00
Better document the done streamed event
This commit is contained in:
parent
b037e416d3
commit
a0a4ac66ec
@ -197,7 +197,10 @@ impl SseEventSender {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn stop(self) -> Result<(), SendError<Event>> {
|
pub async fn stop(self) -> Result<(), SendError<Event>> {
|
||||||
self.0.send(Event::Data(sse::Data::new("[DONE]"))).await
|
// It is the way OpenAI sends a correct end of stream
|
||||||
|
// <https://platform.openai.com/docs/api-reference/assistants-streaming/events>
|
||||||
|
const DONE_DATA: &str = "[DONE]";
|
||||||
|
self.0.send(Event::Data(sse::Data::new(DONE_DATA))).await
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn send_json<S: Serialize>(&self, data: &S) -> Result<(), SendError<Event>> {
|
async fn send_json<S: Serialize>(&self, data: &S) -> Result<(), SendError<Event>> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user