Properly handle assistant messages

This commit is contained in:
MrLetsplay 2024-02-09 18:27:40 +01:00
parent c16db22728
commit 271fbaf57e
Signed by: mr
SSH Key Fingerprint: SHA256:92jBH80vpXyaZHjaIl47pjRq+Yt7XGTArqQg1V7hSqg

View File

@ -3,6 +3,7 @@ mod api;
use std::{
cell::RefCell,
io::{self, Write},
ops::Deref,
sync::{
mpsc::{Receiver, Sender},
Arc,
@ -173,6 +174,14 @@ impl Application for UI {
let _ = send.send(UIMessage::Nop);
}
let mut chat = chat.write().await;
let msg = chat.current_message.clone();
if let Some(msg) = msg {
let msg = msg.write().await;
chat.send_assistant(msg.deref());
chat.current_message = None;
}
}
//state.ollama_api.complete(&x);
},