Skip to content

Commit

Permalink
Remove config from command decorator (Significant-Gravitas#4736)
Browse files Browse the repository at this point in the history
  • Loading branch information
waynehamadi authored Jun 19, 2023
1 parent 8077d2a commit 0abfa3a
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions autogpt/command_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
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
Expand All @@ -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,
Expand Down

0 comments on commit 0abfa3a

Please sign in to comment.