mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-05-25 09:03:59 +02:00
Stream errors
This commit is contained in:
parent
42c95cf3c4
commit
bae6c98aa3
@ -400,13 +400,21 @@ async fn streamed_chat(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
// writeln!(lock, "error: {err}").unwrap();
|
|
||||||
tracing::error!("{err:?}");
|
tracing::error!("{err:?}");
|
||||||
|
if let Err(SendError(_)) = tx.send(Event::Data(sse::Data::new_json(&json!({
|
||||||
|
"object": "chat.completion.error",
|
||||||
|
"tool": err.to_string(),
|
||||||
|
})).unwrap())).await {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
break 'main;
|
break 'main;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let _ = tx.send(Event::Data(sse::Data::new("[DONE]")));
|
||||||
});
|
});
|
||||||
|
|
||||||
Sse::from_infallible_receiver(rx).with_retry_duration(Duration::from_secs(10))
|
Sse::from_infallible_receiver(rx).with_retry_duration(Duration::from_secs(10))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user