From 2c70059c2d63421aa9d08877bd5abe01a333e6dd Mon Sep 17 00:00:00 2001 From: Reinier van der Leer Date: Sat, 2 Dec 2023 13:46:49 +0100 Subject: [PATCH] fix(agent): Fix `setup` and `run` scripts - Updated the `run` script to also check if `$OPENAI_API_KEY` is empty before copying `.env.example` and prompting the user to set API keys. - Modified the `setup` script to install `--extras benchmark` separately from the initial `poetry install` command. - Added `POETRY_INSTALLER_PARALLEL=false` flag to prevent conflicts between `forge` and `agbenchmark` during installation. --- autogpts/autogpt/run | 2 +- autogpts/autogpt/setup | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/autogpts/autogpt/run b/autogpts/autogpt/run index b37c053fa..eebf7fe0f 100755 --- a/autogpts/autogpt/run +++ b/autogpts/autogpt/run @@ -2,7 +2,7 @@ kill $(lsof -t -i :8000) -if [ ! -f .env ]; then +if [ ! -f .env ] && [ -z "$OPENAI_API_KEY" ]; then cp .env.example .env echo "Please add your api keys to the .env file." >&2 # exit 1 diff --git a/autogpts/autogpt/setup b/autogpts/autogpt/setup index 511ef7277..c22f7da1a 100755 --- a/autogpts/autogpt/setup +++ b/autogpts/autogpt/setup @@ -1,4 +1,9 @@ #!/bin/sh -poetry install --no-interaction --extras benchmark +poetry install --no-interaction + +# Necessary to prevent forge and agbenchmark from breaking each others' install: +# https://github.com/python-poetry/poetry/issues/6958 +POETRY_INSTALLER_PARALLEL=false poetry install --no-interaction --extras benchmark + echo "Setup completed successfully."