diff --git a/src/main.rs b/src/main.rs index 6d1fe79..c75e033 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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); },