From 55b8ce855cffb6738bf3d384aeaac56e191058e4 Mon Sep 17 00:00:00 2001 From: luciferlinx <129729795+luciferlinx101@users.noreply.github.com> Date: Sat, 8 Jul 2023 20:33:10 +0530 Subject: [PATCH] Remove rolling window (#696) * removing rolling window * removed comments * removed key from template model --- gui/pages/Content/Agents/AgentCreate.js | 27 ------------------- superagi/controllers/agent.py | 1 - .../controllers/types/agent_with_config.py | 1 - superagi/models/agent.py | 1 - superagi/models/agent_template.py | 2 +- 5 files changed, 1 insertion(+), 31 deletions(-) diff --git a/gui/pages/Content/Agents/AgentCreate.js b/gui/pages/Content/Agents/AgentCreate.js index aa95bb66e..7af3e9a7f 100644 --- a/gui/pages/Content/Agents/AgentCreate.js +++ b/gui/pages/Content/Agents/AgentCreate.js @@ -61,8 +61,6 @@ export default function AgentCreate({sendAgentData, selectedProjectId, fetchAgen const [stepTime, setStepTime] = useState(500); - const rollingWindows = ["5", "10", "15", "20"] - const [rollingWindow, setRollingWindow] = useState(rollingWindows[1]); const rollingRef = useRef(null); const [rollingDropdown, setRollingDropdown] = useState(false); @@ -128,7 +126,6 @@ export default function AgentCreate({sendAgentData, selectedProjectId, fetchAgen setLocalStorageArray("agent_constraints_" + String(internalId), data.constraints, setConstraints); setLocalStorageValue("agent_iterations_" + String(internalId), data.max_iterations, setIterations); setLocalStorageValue("agent_step_time_" + String(internalId), data.iteration_interval, setStepTime); - setLocalStorageValue("agent_rolling_window_" + String(internalId), data.memory_window, setRollingWindow); setLocalStorageValue("agent_permission_" + String(internalId), data.permission_type, setPermission); setLocalStorageArray("agent_instructions_" + String(internalId), data.instruction, setInstructions); setLocalStorageValue("agent_database_" + String(internalId), data.LTM_DB, setDatabase); @@ -225,10 +222,6 @@ export default function AgentCreate({sendAgentData, selectedProjectId, fetchAgen setDatabaseDropdown(false); }; - const handleWindowSelect = (index) => { - setLocalStorageValue("agent_rolling_window_" + String(internalId), rollingWindows[index], setRollingWindow); - setRollingDropdown(false); - }; const handleStepChange = (event) => { setLocalStorageValue("agent_step_time_" + String(internalId), event.target.value, setStepTime); @@ -385,7 +378,6 @@ export default function AgentCreate({sendAgentData, selectedProjectId, fetchAgen "max_iterations": maxIterations, "permission_type": permission_type, "LTM_DB": longTermMemory ? database : null, - "memory_window": rollingWindow }; createAgent(agentData) @@ -571,10 +563,6 @@ export default function AgentCreate({sendAgentData, selectedProjectId, fetchAgen setAgentType(agent_type); } - const agent_rolling_window = localStorage.getItem("agent_rolling_window_" + String(internalId)); - if(agent_rolling_window) { - setRollingWindow(agent_rolling_window); - } const agent_database = localStorage.getItem("agent_database_" + String(internalId)); if(agent_database) { @@ -801,21 +789,6 @@ export default function AgentCreate({sendAgentData, selectedProjectId, fetchAgen -
- -
-
setRollingDropdown(!rollingDropdown)} style={{width:'100%'}}> - {rollingWindow} messagesexpand-icon -
-
- {rollingDropdown &&
- {rollingWindows.map((window, index) => (
handleWindowSelect(index)} style={{padding:'12px 14px',maxWidth:'100%'}}> - {window} -
))} -
} -
-
-
{/*
*/} {/*
*/} {/* setLocalStorageValue("has_LTM_" + String(internalId), !longTermMemory, setLongTermMemory)} />*/} diff --git a/superagi/controllers/agent.py b/superagi/controllers/agent.py index 44317df1a..967459091 100644 --- a/superagi/controllers/agent.py +++ b/superagi/controllers/agent.py @@ -172,7 +172,6 @@ def create_agent_with_config(agent_with_config: AgentConfigInput, - model (str): Model information for the agent. - permission_type (str): Permission type for the agent. - LTM_DB (str): LTM database for the agent. - - memory_window (int): Memory window size for the agent. - max_iterations (int): Maximum number of iterations for the agent. - user_timezone (string): Timezone of the user diff --git a/superagi/controllers/types/agent_with_config.py b/superagi/controllers/types/agent_with_config.py index 625cc986c..59f234b00 100644 --- a/superagi/controllers/types/agent_with_config.py +++ b/superagi/controllers/types/agent_with_config.py @@ -17,6 +17,5 @@ class AgentConfigInput(BaseModel): model: str permission_type: str LTM_DB: str - memory_window: int max_iterations: int user_timezone: Optional[str] diff --git a/superagi/models/agent.py b/superagi/models/agent.py index 085338b29..04fc26c5c 100644 --- a/superagi/models/agent.py +++ b/superagi/models/agent.py @@ -158,7 +158,6 @@ def create_agent_with_config(cls, db, agent_with_config): "model": agent_with_config.model, "permission_type": agent_with_config.permission_type, "LTM_DB": agent_with_config.LTM_DB, - "memory_window": agent_with_config.memory_window, "max_iterations": agent_with_config.max_iterations, "user_timezone": agent_with_config.user_timezone } diff --git a/superagi/models/agent_template.py b/superagi/models/agent_template.py index 55adc9170..da332a408 100644 --- a/superagi/models/agent_template.py +++ b/superagi/models/agent_template.py @@ -97,7 +97,7 @@ def main_keys(cls): """ keys_to_fetch = ["goal", "instruction", "agent_type", "constraints", "tools", "exit", "iteration_interval", "model", - "permission_type", "LTM_DB", "memory_window", "max_iterations"] + "permission_type", "LTM_DB", "max_iterations"] return keys_to_fetch @classmethod