1 2 3 4 5 6 7 8 9 10 11 12 13
use std::path::PathBuf;
use chatgpt::chatbot::Chatbot;
use chatgpt::config::Config;
#[tokio::main]
async fn main() {
let config_file = PathBuf::from(std::env::var("HOME").unwrap()).join(".config/chatgpt/config.json");
let config = Config::from_file(&config_file);
let mut bot = Chatbot::new(config).await;
let response = bot.ask("Hello, world!").await;
println!("{response}");
}