Properly handle assistant messages
This commit is contained in:
parent
c16db22728
commit
271fbaf57e
@ -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);
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user