Fix home_path, local mini-agi run works (#64)

Co-authored-by: merwanehamadi <merwanehamadi@gmail.com>
This commit is contained in:
Silen Naihin
2023-07-06 21:00:45 -04:00
committed by GitHub
parent 0b4ae5ea78
commit bfd0d5c826
4 changed files with 5 additions and 9 deletions

View File

@@ -33,11 +33,10 @@ def run_agent(
)
# Get the current working directory
cwd = os.getcwd()
cwd = os.path.join(os.getcwd(), config["home_path"])
# Add current directory to Python's import path
sys.path.append(cwd)
sys.path.append(os.path.join(cwd, config["home_path"]))
command = [sys.executable, config["entry_path"], str(task)]
process = subprocess.Popen(
@@ -67,6 +66,7 @@ def run_agent(
print(
"The Python function has exceeded the time limit and was terminated."
)
# Terminate the process group
process.terminate()
break

View File

@@ -57,11 +57,6 @@ def start(category: str, maintain: bool, mock: bool) -> int:
set_key(".env", "MOCK_TEST", "True" if mock else "False")
# create workspace directory if it doesn't exist
workspace_path = os.path.abspath(config["workspace"])
if not os.path.exists(workspace_path):
os.makedirs(workspace_path, exist_ok=True)
if not os.path.exists(REGRESSION_TESTS_PATH):
with open(REGRESSION_TESTS_PATH, "a"):
pass

View File

@@ -1,6 +1,6 @@
{
"workspace": "projects/my-new-project/workspace",
"workspace": "${os.path.join(Path.home(), 'miniagi')}",
"entry_path": "benchmarks.py",
"home_path": "",
"home_path": "agent/mini-agi/",
"cutoff": 60
}

View File

@@ -38,6 +38,7 @@ markers = [
"retrieval",
"regression",
"basic",
"memory"
]
[tool.poetry.scripts]