Skip to content

Commit

Permalink
feat: support env <AGENT_NAME>_CONFIG_FILE (#990)
Browse files Browse the repository at this point in the history
  • Loading branch information
sigoden authored Nov 13, 2024
1 parent 0aa93fa commit 163ab62
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,10 @@ impl Config {
}

pub fn agent_config_file(name: &str) -> PathBuf {
Self::agent_data_dir(name).join(CONFIG_FILE_NAME)
match env::var(format!("{}_CONFIG_FILE", normalize_env_name(name))) {
Ok(value) => PathBuf::from(value),
Err(_) => Self::agent_data_dir(name).join(CONFIG_FILE_NAME),
}
}

pub fn agent_rag_file(agent_name: &str, rag_name: &str) -> PathBuf {
Expand Down

0 comments on commit 163ab62

Please sign in to comment.