Skip to content

Commit 985c084

Browse files
authored
fix: make general optional again (#43)
1 parent 7ddea64 commit 985c084

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/config/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ pub fn load_config(path: &str) -> Result<Config, Box<dyn std::error::Error>> {
88
let contents = std::fs::read_to_string(path)?;
99
let config: Config = serde_yaml::from_str(&contents)?;
1010
TRACE_CONTENT_ENABLED
11-
.set(config.general.trace_content_enabled)
11+
.set(
12+
config
13+
.general
14+
.as_ref()
15+
.is_none_or(|g| g.trace_content_enabled),
16+
)
1217
.expect("Failed to set trace content enabled flag");
1318
Ok(config)
1419
}

src/config/models.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
44

55
#[derive(Debug, Deserialize, Serialize, Clone)]
66
pub struct Config {
7-
pub general: General,
7+
pub general: Option<General>,
88
pub providers: Vec<Provider>,
99
pub models: Vec<ModelConfig>,
1010
pub pipelines: Vec<Pipeline>,

0 commit comments

Comments
 (0)