Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

Remove config from command decorator (#4736)

merwanehamadi0abfa3a68f76
diff --git a/autogpt/command_decorator.py b/autogpt/command_decorator.py
index 7ac4b7cdfe..1edd766ec4 100644
--- a/autogpt/command_decorator.py
+++ b/autogpt/command_decorator.py
@@ -2,7 +2,6 @@ import functools
from typing import Any, Callable, Dict, Optional
from autogpt.config import Config
-from autogpt.logs import logger
from autogpt.models.command import Command
# Unique identifier for auto-gpt commands
@@ -18,16 +17,6 @@ def command(
) -> Callable[..., Any]:
"""The command decorator is used to create Command objects from ordinary functions."""
- # TODO: Remove this in favor of better command management
- config = Config()
-
- if callable(enabled):
- enabled = enabled(config)
- if not enabled:
- if disabled_reason is not None:
- logger.debug(f"Command '{name}' is disabled: {disabled_reason}")
- return lambda func: func
-
def decorator(func: Callable[..., Any]) -> Command:
cmd = Command(
name=name,