Skip to content

Commit

Permalink
Remove rolling window (#696)
Browse files Browse the repository at this point in the history
* removing rolling window

* removed comments

* removed key from template model
  • Loading branch information
luciferlinx101 authored Jul 8, 2023
1 parent 874c0cb commit 55b8ce8
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 31 deletions.
27 changes: 0 additions & 27 deletions gui/pages/Content/Agents/AgentCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -801,21 +789,6 @@ export default function AgentCreate({sendAgentData, selectedProjectId, fetchAgen
<label className={styles.form_label}>Time between steps (in milliseconds)</label>
<input className="input_medium" type="number" value={stepTime} onChange={handleStepChange}/>
</div>
<div style={{marginTop: '15px'}}>
<label className={styles.form_label}>Short term memory - Rolling window</label>
<div className="dropdown_container_search" style={{width:'100%'}}>
<div className="custom_select_container" onClick={() => setRollingDropdown(!rollingDropdown)} style={{width:'100%'}}>
{rollingWindow} messages<Image width={20} height={21} src={!rollingDropdown ? '/images/dropdown_down.svg' : '/images/dropdown_up.svg'} alt="expand-icon"/>
</div>
<div>
{rollingDropdown && <div className="custom_select_options" ref={rollingRef} style={{width:'100%'}}>
{rollingWindows.map((window, index) => (<div key={index} className="custom_select_option" onClick={() => handleWindowSelect(index)} style={{padding:'12px 14px',maxWidth:'100%'}}>
{window}
</div>))}
</div>}
</div>
</div>
</div>
{/*<div style={{marginTop: '15px'}}>*/}
{/* <div style={{display:'flex'}}>*/}
{/* <input className="checkbox" type="checkbox" checked={longTermMemory} onChange={() => setLocalStorageValue("has_LTM_" + String(internalId), !longTermMemory, setLongTermMemory)} />*/}
Expand Down
1 change: 0 additions & 1 deletion superagi/controllers/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion superagi/controllers/types/agent_with_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
1 change: 0 additions & 1 deletion superagi/models/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion superagi/models/agent_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 55b8ce8

Please sign in to comment.