From 71c6600abf1525364db949622c7dc3f9b0e00eae Mon Sep 17 00:00:00 2001 From: lengweiping Date: Mon, 17 Apr 2023 12:44:46 +0800 Subject: [PATCH] memory object move to memory_add block --- autogpt/app.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autogpt/app.py b/autogpt/app.py index 19c075f0..979f57d3 100644 --- a/autogpt/app.py +++ b/autogpt/app.py @@ -112,11 +112,10 @@ def execute_command(command_name: str, arguments): arguments (dict): The arguments for the command Returns: - str: The result of the command""" - memory = get_memory(CFG) - + str: The result of the command + """ try: - command_name = map_command_synonyms(command_name) + command_name = map_command_synonyms(command_name.lower()) if command_name == "google": # Check if the Google API key is set and use the official search method # If the API key is not set or has only whitespaces, use the unofficial @@ -136,6 +135,7 @@ def execute_command(command_name: str, arguments): return str(safe_message) elif command_name == "memory_add": + memory = get_memory(CFG) return memory.add(arguments["string"]) elif command_name == "start_agent": return start_agent(