From 4245a6c4f0e87a2ebeeebe4fe7fa020d525b95ea Mon Sep 17 00:00:00 2001 From: SwiftyOS Date: Sat, 16 Sep 2023 19:37:52 +0200 Subject: [PATCH 1/4] switch check to see if the submission branch exists --- cli.py | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/cli.py b/cli.py index b840a5179..a51d8abd3 100644 --- a/cli.py +++ b/cli.py @@ -582,7 +582,19 @@ def enter(agent_name, branch): return else: # Check if the agent has already entered the arena - if os.path.exists(f"arena/{agent_name}.json"): + try: + subprocess.check_output( + [ + "git", + "rev-parse", + "--verify", + "--quiet", + f"arena_submission_{agent_name}", + ] + ) + except subprocess.CalledProcessError: + pass + else: click.echo( click.style( f"⚠️ The agent '{agent_name}' has already entered the arena. To update your submission, follow these steps:", @@ -644,6 +656,13 @@ def enter(agent_name, branch): .strip() ) + if github_repo_url.startswith("git@"): + github_repo_url = ( + github_repo_url.replace("git@", "https://") + .replace(".git", "") + .replace(":", "/") + ) + # If --branch is passed, use it instead of master if branch: branch_to_use = branch @@ -659,7 +678,7 @@ def enter(agent_name, branch): arena_submission_branch = f"arena_submission_{agent_name}" # Create a new branch called arena_submission_{agent_name} - subprocess.check_call(['git', 'checkout', '-b', arena_submission_branch]) + subprocess.check_call(["git", "checkout", "-b", arena_submission_branch]) # Create a dictionary with the necessary fields data = { "github_repo_url": github_repo_url, @@ -703,7 +722,7 @@ Hey there amazing builders! We're thrilled to have you join this exciting journe - **Agent Name:** {agent_name} - **Team Members:** (Who are the amazing minds behind this team? Do list everyone along with their roles!) -- **Repository Link:** (Do share the link where all the magic is happening) +- **Repository Link:** [{github_repo_url.replace('https://github.com/', '')}]({github_repo_url}) #### 🌟 Project Vision @@ -730,7 +749,7 @@ Hey there amazing builders! We're thrilled to have you join this exciting journe - [ ] We confirm that our project will be open-source and adhere to the MIT License. - [ ] Our lablab.ai registration email matches our OpenAI account to claim the bonus credits (if applicable). """, - head=f'{repo.owner.login}:{arena_submission_branch}', + head=f"{repo.owner.login}:{arena_submission_branch}", base=branch_to_use, ) click.echo( @@ -756,6 +775,7 @@ Hey there amazing builders! We're thrilled to have you join this exciting journe # Switch back to the master branch subprocess.check_call(["git", "checkout", branch_to_use]) + @arena.command() @click.argument("agent_name") @click.argument("hash") @@ -783,7 +803,7 @@ def update(agent_name, hash, branch): ) ) return - + if not os.path.exists(agent_json_file): click.echo( click.style( From b155508b12f3f1e0f0699ab253ab497780033550 Mon Sep 17 00:00:00 2001 From: SwiftyOS Date: Sat, 16 Sep 2023 19:40:21 +0200 Subject: [PATCH 2/4] removed swifty arena entry --- arena/swifty.json | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 arena/swifty.json diff --git a/arena/swifty.json b/arena/swifty.json deleted file mode 100644 index f9e6106f7..000000000 --- a/arena/swifty.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "github_repo_url": "git@github.com:Swiftyos/Auto-GPT.git", - "timestamp": "2023-09-15T19:03:00.371772", - "commit_hash_to_benchmark": "7bc7cd46712708486f09e422c28620753effaf4e", - "branch_to_benchmark": "master" -} \ No newline at end of file From cbcdcad43c0d070341b85fa3bb3ec77f80d22c72 Mon Sep 17 00:00:00 2001 From: SwiftyOS Date: Sat, 16 Sep 2023 19:53:28 +0200 Subject: [PATCH 3/4] Added ascii art to cli --- cli.py | 25 ++++++++++++++++++++++++- setup.sh | 2 -- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/cli.py b/cli.py index a51d8abd3..9c67f10f3 100644 --- a/cli.py +++ b/cli.py @@ -1,3 +1,9 @@ +""" +This is a minimal file intended to be run by users to help them manage the autogpt projects. + +If you want to contribute, please use only libraries that come as part of Python. +To ensure efficiency, add the imports to the functions so only what is needed is imported. +""" try: import click import github @@ -20,11 +26,28 @@ def setup(): import os import subprocess + click.echo( + click.style( + """ + d8888 888 .d8888b. 8888888b. 88888888888 + d88888 888 d88P Y88b 888 Y88b 888 + d88P888 888 888 888 888 888 888 + d88P 888 888 888 888888 .d88b. 888 888 d88P 888 + d88P 888 888 888 888 d88""88b 888 88888 8888888P" 888 + d88P 888 888 888 888 888 888 888 888 888 888 + d8888888888 Y88b 888 Y88b. Y88..88P Y88b d88P 888 888 +d88P 888 "Y88888 "Y888 "Y88P" "Y8888P88 888 888 + +""", + fg="green", + ) + ) + script_dir = os.path.dirname(os.path.realpath(__file__)) setup_script = os.path.join(script_dir, "setup.sh") if os.path.exists(setup_script): + click.echo(click.style("🚀 Setup initiated...\n", fg="green")) subprocess.Popen([setup_script], cwd=script_dir) - click.echo(click.style("🚀 Setup initiated", fg="green")) else: click.echo( click.style( diff --git a/setup.sh b/setup.sh index e5cde976e..20716650c 100755 --- a/setup.sh +++ b/setup.sh @@ -51,5 +51,3 @@ elif [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == else echo "Unsupported OS. Please install Google Chrome manually from https://www.google.com/chrome/" fi - -echo "Installation has been completed." From 991e816ea2119cbaf6630ee80190910f66e2479a Mon Sep 17 00:00:00 2001 From: merwanehamadi Date: Sat, 16 Sep 2023 10:56:21 -0700 Subject: [PATCH 4/4] Fix CORS issue (#5232) * Allow Cors * Update app.py --- benchmark/agbenchmark/app.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/benchmark/agbenchmark/app.py b/benchmark/agbenchmark/app.py index 0a4b839e0..8bc526133 100644 --- a/benchmark/agbenchmark/app.py +++ b/benchmark/agbenchmark/app.py @@ -35,7 +35,11 @@ updates_list = [] import json -origins = ["http://localhost:8080"] +origins = [ + "http://localhost:8080", + "http://127.0.0.1:5000", + "http://localhost:5000", +] app = FastAPI() app.add_middleware( CORSMiddleware,