mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2026-01-24 08:24:27 +01:00
Fix workspace crash
This commit is contained in:
@@ -52,6 +52,8 @@ def config(
|
||||
if not os.environ.get("OPENAI_API_KEY"):
|
||||
os.environ["OPENAI_API_KEY"] = "sk-dummy"
|
||||
|
||||
Workspace.set_workspace_directory(config, workspace.root)
|
||||
|
||||
# HACK: this is necessary to ensure PLAIN_OUTPUT takes effect
|
||||
logger.config = config
|
||||
|
||||
@@ -84,7 +86,7 @@ def api_manager() -> ApiManager:
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def agent(config: Config, workspace: Workspace) -> Agent:
|
||||
def agent(config: Config) -> Agent:
|
||||
ai_config = AIConfig(
|
||||
ai_name="Base",
|
||||
ai_role="A base AI",
|
||||
@@ -103,5 +105,4 @@ def agent(config: Config, workspace: Workspace) -> Agent:
|
||||
ai_config=ai_config,
|
||||
config=config,
|
||||
triggering_prompt=DEFAULT_TRIGGERING_PROMPT,
|
||||
workspace_directory=workspace.root,
|
||||
)
|
||||
|
||||
@@ -4,7 +4,6 @@ from autogpt.agents import Agent
|
||||
from autogpt.config import AIConfig, Config
|
||||
from autogpt.memory.vector import get_memory
|
||||
from autogpt.models.command_registry import CommandRegistry
|
||||
from autogpt.workspace import Workspace
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -20,7 +19,7 @@ def memory_json_file(config: Config):
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def dummy_agent(config: Config, memory_json_file, workspace: Workspace):
|
||||
def dummy_agent(config: Config, memory_json_file):
|
||||
command_registry = CommandRegistry()
|
||||
|
||||
ai_config = AIConfig(
|
||||
@@ -38,7 +37,6 @@ def dummy_agent(config: Config, memory_json_file, workspace: Workspace):
|
||||
ai_config=ai_config,
|
||||
config=config,
|
||||
triggering_prompt="dummy triggering prompt",
|
||||
workspace_directory=workspace.root,
|
||||
)
|
||||
|
||||
return agent
|
||||
|
||||
@@ -19,7 +19,6 @@ def agent(config: Config):
|
||||
command_registry = MagicMock()
|
||||
ai_config = AIConfig(ai_name="Test AI")
|
||||
triggering_prompt = "Triggering prompt"
|
||||
workspace_directory = "workspace_directory"
|
||||
|
||||
agent = Agent(
|
||||
memory=memory,
|
||||
@@ -27,7 +26,6 @@ def agent(config: Config):
|
||||
ai_config=ai_config,
|
||||
config=config,
|
||||
triggering_prompt=triggering_prompt,
|
||||
workspace_directory=workspace_directory,
|
||||
)
|
||||
return agent
|
||||
|
||||
|
||||
Reference in New Issue
Block a user