Skip to content

Commit

Permalink
Merge pull request #135 from moxin-org/support-chat-without-streaming
Browse files Browse the repository at this point in the history
Support chat responses when stream option is off
  • Loading branch information
jmbejar authored Jul 4, 2024
2 parents 2d4d5ed + ccd7987 commit 39ffc3f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/data/chats/chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,14 @@ impl Chat {
break;
}
}
Ok(ChatResponse::ChatFinalResponseData(data)) => {
let _ = store_chat_tx.send(ChatTokenArrivalAction::AppendDelta(
data.choices[0].message.content.clone(),
));
let _ = store_chat_tx.send(ChatTokenArrivalAction::StreamingDone);
SignalToUI::set_ui_signal();
break;
}
Err(err) => eprintln!("Error receiving response chunk: {:?}", err),
_ => (),
}
Expand Down

0 comments on commit 39ffc3f

Please sign in to comment.