From 021cfcd8be43f39dbedb9ba44b6a6bbad4f3ba01 Mon Sep 17 00:00:00 2001 From: Ville H <42549848+VigroX@users.noreply.github.com> Date: Wed, 22 May 2024 02:25:49 +0300 Subject: [PATCH] fix: creation of invalid tool in tool builder (#1402) --- memgpt/functions/functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)