mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-25 18:04:28 +01:00
Remove config from command decorator (#4736)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user