fix: creation of invalid tool in tool builder (#1402)

This commit is contained in:
Ville H
2024-05-22 02:25:49 +03:00
committed by GitHub
parent 9de42c3ee9
commit 021cfcd8be

View File

@@ -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)