mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 05:15:00 +00:00
Fuse LLM completion stream to avoid a panic (#21914)
`LanguageModel::stream_completion_text` can poll the `stream_completion` stream (ultimately a `futures::Unfold`) after it's returned `Ready(None)`, which leads to a panic; avoid this by fusing the stream. Release Notes: - Fixed a panic when streaming language model completions
This commit is contained in:
parent
b4c8e04544
commit
ee6f834028
1 changed files with 1 additions and 1 deletions
|
@ -147,7 +147,7 @@ pub trait LanguageModel: Send + Sync {
|
|||
let events = self.stream_completion(request, cx);
|
||||
|
||||
async move {
|
||||
let mut events = events.await?;
|
||||
let mut events = events.await?.fuse();
|
||||
let mut message_id = None;
|
||||
let mut first_item_text = None;
|
||||
|
||||
|
|
Loading…
Reference in a new issue