diff options
Diffstat (limited to 'src/app/modules/chat.rs')
-rw-r--r-- | src/app/modules/chat.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/app/modules/chat.rs b/src/app/modules/chat.rs new file mode 100644 index 0000000..ee00c98 --- /dev/null +++ b/src/app/modules/chat.rs @@ -0,0 +1,9 @@ +use crate::app::llm::{LLM, Message, MessageType}; + +pub async fn ask_chat(mut messages: Vec<Message>) -> Result<String, Box<dyn std::error::Error>> { + let chat_llm = LLM::new("config/chat-LLM.json"); + messages.push(Message::new(MessageType::USER, chat_llm.system_prompt.to_string())); + + let result: String = chat_llm.ask(&messages).await?; + Ok(result) +} |