mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-23 17:04:21 +01:00
Fix path processing (#5032)
* Fix and clean up path processing in logs module * Fix path processing throughout the project * Fix plugins test * Fix borky pytest vs mkdir(exist_ok=True) * Update docs and gitignore for new workspace location * Fix borky pytest vol.2 * ok james
This commit is contained in:
committed by
GitHub
parent
e0d8e6b75f
commit
2c53530e99
@@ -1,3 +1,5 @@
|
||||
from pathlib import Path
|
||||
|
||||
from autogpt.agents import Agent
|
||||
from autogpt.config import AIConfig, Config, ConfigBuilder
|
||||
from autogpt.main import COMMAND_CATEGORIES, run_interaction_loop
|
||||
@@ -6,6 +8,8 @@ from autogpt.models.command_registry import CommandRegistry
|
||||
from autogpt.prompts.prompt import DEFAULT_TRIGGERING_PROMPT
|
||||
from autogpt.workspace import Workspace
|
||||
|
||||
PROJECT_DIR = Path().resolve()
|
||||
|
||||
|
||||
def run_task(task) -> None:
|
||||
agent = bootstrap_agent(task)
|
||||
@@ -13,15 +17,14 @@ def run_task(task) -> None:
|
||||
|
||||
|
||||
def bootstrap_agent(task):
|
||||
config = ConfigBuilder.build_config_from_env()
|
||||
config = ConfigBuilder.build_config_from_env(workdir=PROJECT_DIR)
|
||||
config.continuous_mode = False
|
||||
config.temperature = 0
|
||||
config.plain_output = True
|
||||
command_registry = get_command_registry(config)
|
||||
config.memory_backend = "no_memory"
|
||||
workspace_directory = Workspace.get_workspace_directory(config)
|
||||
workspace_directory_path = Workspace.make_workspace(workspace_directory)
|
||||
Workspace.build_file_logger_path(config, workspace_directory_path)
|
||||
Workspace.set_workspace_directory(config)
|
||||
Workspace.build_file_logger_path(config, config.workspace_path)
|
||||
ai_config = AIConfig(
|
||||
ai_name="Auto-GPT",
|
||||
ai_role="a multi-purpose AI assistant.",
|
||||
@@ -34,7 +37,7 @@ def bootstrap_agent(task):
|
||||
ai_config=ai_config,
|
||||
config=config,
|
||||
triggering_prompt=DEFAULT_TRIGGERING_PROMPT,
|
||||
workspace_directory=str(workspace_directory_path),
|
||||
workspace_directory=str(config.workspace_path),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user