Added README, and LICENSE.
This commit is contained in:
14
src/main.rs
14
src/main.rs
@@ -39,16 +39,26 @@ async fn main() -> Result<()> {
|
||||
|
||||
// chroot if applicable.
|
||||
if let Ok(chroot_path) = config.get_string("chroot-dir") {
|
||||
info!("Attempting to chroot to {}", chroot_path);
|
||||
fs::chroot(&chroot_path)
|
||||
.wrap_err_with(|| format!("Failed setting chroot '{}'", chroot_path.to_string()))?;
|
||||
.wrap_err_with(|| format!("Failed setting chroot '{}'", chroot_path))?;
|
||||
std::env::set_current_dir("/").wrap_err("Couldn't change directory after chroot.")?;
|
||||
|
||||
}
|
||||
|
||||
let handle = qna::new(
|
||||
// Setup root path for commands.
|
||||
let cmd_root = if let Ok(command_path) = config.get_string("command-path") {
|
||||
Some(commands::Root::new(command_path))
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
let handle = qna::LLMHandle::new(
|
||||
config.get_string("api-key").wrap_err("API missing.")?,
|
||||
config
|
||||
.get_string("base-url")
|
||||
.wrap_err("base-url missing.")?,
|
||||
cmd_root,
|
||||
config
|
||||
.get_string("model")
|
||||
.wrap_err("model string missing.")?,
|
||||
|
||||
Reference in New Issue
Block a user