llm 1.3.8

A Rust library unifying multiple LLM backends.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::fs;

use super::error::ConfigError;
use super::load::{ensure_dirs, secure_file_permissions};
use super::paths::ConfigPaths;
use super::types::AppConfig;

pub fn save_config(config: &AppConfig, paths: &ConfigPaths) -> Result<(), ConfigError> {
    ensure_dirs(paths)?;
    let contents = toml::to_string_pretty(config)?;
    fs::write(&paths.config_file, contents)?;
    secure_file_permissions(&paths.config_file)?;
    Ok(())
}