diff options
Diffstat (limited to 'autogpts/autogpt/tests/integration/agent_factory.py')
-rw-r--r-- | autogpts/autogpt/tests/integration/agent_factory.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/autogpts/autogpt/tests/integration/agent_factory.py b/autogpts/autogpt/tests/integration/agent_factory.py index dfff73b93..59b3164aa 100644 --- a/autogpts/autogpt/tests/integration/agent_factory.py +++ b/autogpts/autogpt/tests/integration/agent_factory.py @@ -1,9 +1,10 @@ import pytest from autogpt.agents.agent import Agent, AgentConfiguration, AgentSettings +from autogpt.agents.prompt_strategies.one_shot import OneShotAgentPromptStrategy from autogpt.config import AIProfile, Config +from autogpt.file_storage import FileStorageBackendName, get_storage from autogpt.memory.vector import get_memory -from autogpt.models.command_registry import CommandRegistry @pytest.fixture @@ -20,8 +21,6 @@ def memory_json_file(config: Config): @pytest.fixture def dummy_agent(config: Config, llm_provider, memory_json_file): - command_registry = CommandRegistry() - ai_profile = AIProfile( ai_name="Dummy Agent", ai_role="Dummy Role", @@ -30,7 +29,9 @@ def dummy_agent(config: Config, llm_provider, memory_json_file): ], ) - agent_prompt_config = Agent.default_settings.prompt_config.copy(deep=True) + agent_prompt_config = OneShotAgentPromptStrategy.default_configuration.copy( + deep=True + ) agent_prompt_config.use_functions_api = config.openai_functions agent_settings = AgentSettings( name=Agent.default_settings.name, @@ -46,10 +47,17 @@ def dummy_agent(config: Config, llm_provider, memory_json_file): history=Agent.default_settings.history.copy(deep=True), ) + local = config.file_storage_backend == FileStorageBackendName.LOCAL + restrict_to_root = not local or config.restrict_to_workspace + file_storage = get_storage( + config.file_storage_backend, root_path="data", restrict_to_root=restrict_to_root + ) + file_storage.initialize() + agent = Agent( settings=agent_settings, llm_provider=llm_provider, - command_registry=command_registry, + file_storage=file_storage, legacy_config=config, ) |