init backend, fix frontend module (#307)

This commit is contained in:
Silen Naihin
2023-08-15 14:14:35 +01:00
committed by GitHub
parent c59e5fb7d8
commit 8bc3710e23
8 changed files with 37 additions and 6 deletions

View File

@@ -278,10 +278,10 @@ jobs:
poetry run python send_to_googledrive.py || echo "Failed to upload to Google Drive"
echo "Adding skill_tree submodule to update website"
poetry run agbenchmark start --mock
cd agbenchmark/challenges/frontend
cd frontend
git add .
git commit -m "Update website with new skill tree"
cd ../../..
cd ..
exit 0
else
echo "Attempt $(($attempts + 1)) failed. Retrying..."

3
.gitmodules vendored
View File

@@ -33,3 +33,6 @@
[submodule "agbenchmark/challenges"]
path = agbenchmark/challenges
url = https://github.com/agbenchmark/agent-evals.git
[submodule "frontend"]
path = frontend
url = https://github.com/agbenchmark/agbenchmark-frontend.git

View File

@@ -277,9 +277,7 @@ def graph_interactive_network(
json_graph = json.dumps(graph_data)
# Optionally, save to a file
with open(
Path("agbenchmark/challenges/frontend/public/graph.json").resolve(), "w"
) as f:
with open(Path("frontend/public/graph.json").resolve(), "w") as f:
f.write(json_graph)
if html_graph_path:

17
backend/main.py Normal file
View File

@@ -0,0 +1,17 @@
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
@app.get("/data")
async def read_data() -> dict[str, str]:
return {"data": "Hello, World!"}

1
backend/requirements.txt Normal file
View File

@@ -0,0 +1 @@
fastapi

1
frontend Submodule

Submodule frontend added at 7e468e488a

11
run.sh Normal file
View File

@@ -0,0 +1,11 @@
# poetry install
# cd backend
# pip install -r requirement.txt
# uvicorn your_module:app --reload
# cd frontend
# npm install
# npm run dev
# localhost:3000