refactor(config): unify config to ai.syui.log/config.json, remove gpt config dependency
This commit is contained in:
@@ -16,7 +16,7 @@ pub fn shared_config_path() -> String {
|
|||||||
format!("{}/ai.syui.log/config.json", config_dir())
|
format!("{}/ai.syui.log/config.json", config_dir())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Path to aigpt config: $cfg/ai.syui.gpt/config.json
|
/// Path to aigpt config (same content as shared, may be symlink)
|
||||||
pub fn gpt_config_path() -> String {
|
pub fn gpt_config_path() -> String {
|
||||||
format!("{}/ai.syui.gpt/config.json", config_dir())
|
format!("{}/ai.syui.gpt/config.json", config_dir())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -575,7 +575,7 @@ fn save_to_aigpt_memory(decision: &str, agents: &[serde_json::Value]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn aigpt_memory_dir() -> Option<String> {
|
fn aigpt_memory_dir() -> Option<String> {
|
||||||
let config_path = config::gpt_config_path();
|
let config_path = config::shared_config_path();
|
||||||
let content = std::fs::read_to_string(&config_path).ok()?;
|
let content = std::fs::read_to_string(&config_path).ok()?;
|
||||||
let config: serde_json::Value = serde_json::from_str(&content).ok()?;
|
let config: serde_json::Value = serde_json::from_str(&content).ok()?;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user