diff --git a/memgpt/functions/functions.py b/memgpt/functions/functions.py index 233ed26e..8cade770 100644 --- a/memgpt/functions/functions.py +++ b/memgpt/functions/functions.py @@ -69,7 +69,7 @@ def write_function(module_name: str, function_name: str, function_code: str): # Write the function to a file file_path = os.path.join(USER_FUNCTIONS_DIR, f"{module_name}.py") - with open(file_path, "a") as f: + with open(file_path, "w") as f: f.write(function_code) succ, error = validate_function(module_name, file_path)