From 79973a2d7d4cb296438fcc62c56871fe933d7789 Mon Sep 17 00:00:00 2001 From: sigoden Date: Tue, 5 Nov 2024 06:41:18 +0800 Subject: feat: change agent config/variables (#967) - abandon `.save agent-config` - add variables to agent config.yaml - don't save agent variables after initializing the agent and using `.variable ` --- src/config/mod.rs | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'src/config/mod.rs') diff --git a/src/config/mod.rs b/src/config/mod.rs index b38dcd9..6f99fd6 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -51,7 +51,6 @@ const FUNCTIONS_DIR_NAME: &str = "functions"; const FUNCTIONS_FILE_NAME: &str = "functions.json"; const FUNCTIONS_BIN_DIR_NAME: &str = "bin"; const AGENTS_DIR_NAME: &str = "agents"; -const AGENT_VARIABLES_FILE_NAME: &str = "variables.yaml"; pub const TEMP_ROLE_NAME: &str = "%%"; pub const TEMP_RAG_NAME: &str = "temp"; @@ -367,10 +366,6 @@ impl Config { Ok(Self::agent_data_dir(agent_name)?.join(format!("{rag_name}.yaml"))) } - pub fn agent_variables_file(name: &str) -> Result { - Ok(Self::agent_data_dir(name)?.join(AGENT_VARIABLES_FILE_NAME)) - } - pub fn agents_functions_dir() -> Result { Ok(Self::functions_dir()?.join(AGENTS_DIR_NAME)) } @@ -1419,14 +1414,6 @@ impl Config { Ok(()) } - pub fn save_agent_config(&mut self) -> Result<()> { - let agent = match &self.agent { - Some(v) => v, - None => bail!("No agent"), - }; - agent.save_config() - } - pub fn exit_agent(&mut self) -> Result<()> { self.exit_session()?; if self.agent.take().is_some() { -- cgit v1.2.3