aboutsummaryrefslogtreecommitdiff
path: root/src/app/modules/chat.rs
blob: ee00c98e0b0d219f87cacd9826d1cca0a7c0b51f (plain)
1
2
3
4
5
6
7
8
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)
}
ArKa projects. All rights to me, and your next child right arm.