Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

Fixed CORS and proxy timeout issues

SwiftyOS536031327177
diff --git a/autogpts/forge/forge/sdk/agent.py b/autogpts/forge/forge/sdk/agent.py
index ec246135a5..a508e26d53 100644
--- a/autogpts/forge/forge/sdk/agent.py
+++ b/autogpts/forge/forge/sdk/agent.py
@@ -47,9 +47,11 @@ class Agent:
"http://127.0.0.1:5000",
"http://localhost:8000",
"http://127.0.0.1:8000",
+ "http://localhost:8080",
+ "http://127.0.0.1:8080",
# Add any other origins you want to whitelist
]
-
+
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
diff --git a/benchmark/agbenchmark/app.py b/benchmark/agbenchmark/app.py
index 1bd874201c..d78c19ff88 100644
--- a/benchmark/agbenchmark/app.py
+++ b/benchmark/agbenchmark/app.py
@@ -119,6 +119,7 @@ updates_list = []
import json
origins = [
+ "http://localhost:8000",
"http://localhost:8080",
"http://127.0.0.1:5000",
"http://localhost:5000",
@@ -312,7 +313,8 @@ async def create_agent_task(task_eval_request: TaskEvalRequestBody) -> Task:
@router.post("/agent/tasks/{task_id}/steps")
async def proxy(request: Request, task_id: str):
- async with httpx.AsyncClient() as client:
+ timeout = httpx.Timeout(300.0, read=300.0) # 5 minutes
+ async with httpx.AsyncClient(timeout=timeout) as client:
# Construct the new URL
new_url = f"http://localhost:8000/ap/v1/agent/tasks/{task_id}/steps"