From 50c60e8097f5148c30295a296063d0fc8391a5f4 Mon Sep 17 00:00:00 2001 From: sigoden Date: Wed, 15 Jan 2025 12:26:34 +0800 Subject: [PATCH] feat: no longer support `.set agent_prelude ` (#1086) --- src/config/agent.rs | 4 ---- src/config/mod.rs | 17 ----------------- 2 files changed, 21 deletions(-) diff --git a/src/config/agent.rs b/src/config/agent.rs index a666bdfe..731dd91c 100644 --- a/src/config/agent.rs +++ b/src/config/agent.rs @@ -237,10 +237,6 @@ impl Agent { self.config.agent_prelude.as_deref() } - pub fn set_agent_prelude(&mut self, value: Option) { - self.config.agent_prelude = value; - } - pub fn variables(&self) -> &AgentVariables { match &self.session_variables { Some(variables) => variables, diff --git a/src/config/mod.rs b/src/config/mod.rs index fd23eb14..975c8eab 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -534,10 +534,6 @@ impl Config { Some(rag) => rag.get_config(), None => (self.rag_reranker_model.clone(), self.rag_top_k), }; - let agent_prelude = match &self.agent { - Some(agent) => agent.agent_prelude(), - None => self.agent_prelude.as_deref(), - }; let role = self.extract_role(); let mut items = vec![ ("model", role.model().id()), @@ -558,7 +554,6 @@ impl Config { ("wrap_code", self.wrap_code.to_string()), ("function_calling", self.function_calling.to_string()), ("use_tools", format_option_value(&role.use_tools())), - ("agent_prelude", format_option_value(&agent_prelude)), ("save_session", format_option_value(&self.save_session)), ("compress_threshold", self.compress_threshold.to_string()), ( @@ -630,10 +625,6 @@ impl Config { let value = parse_value(value)?; config.write().set_use_tools(value); } - "agent_prelude" => { - let value = parse_value(value)?; - config.write().set_agent_prelude(value); - } "save_session" => { let value = parse_value(value)?; config.write().set_save_session(value); @@ -748,13 +739,6 @@ impl Config { } } - pub fn set_agent_prelude(&mut self, value: Option) { - match self.agent.as_mut() { - Some(agent) => agent.set_agent_prelude(value), - None => self.agent_prelude = value, - } - } - pub fn set_save_session(&mut self, value: Option) { if let Some(session) = self.session.as_mut() { session.set_save_session(value); @@ -1710,7 +1694,6 @@ impl Config { "save", "function_calling", "use_tools", - "agent_prelude", "save_session", "compress_threshold", "rag_reranker_model",