Skip to content

Commit 2de5e3d

Browse files
SwiftyosBentlybroaarushik93
authored
feat(platform): Agent Store V2 (Significant-Gravitas#8874)
# 🌎 Overview AutoGPT Store Version 2 expands on the Pre-Store by enhancing agent discovery, providing richer content presentation, and introducing new user engagement features. The focus is on creating a visually appealing and interactive marketplace that allows users to explore and evaluate agents through images, videos, and detailed descriptions. ### Vision To create a visually compelling and interactive open-source marketplace for autonomous AI agents, where users can easily discover, evaluate, and interact with agents through media-rich listings, ratings, and version history. ### Objectives 📊 Incorporate visuals (icons, images, videos) into agent listings. ⭐ Introduce a rating system and agent run count. 🔄 Provide version history and update logs from creators. 🔍 Improve user experience with advanced search and filtering features. ### Changes 🏗️ <!-- Concisely describe all of the changes made in this pull request: --> ### Checklist 📋 #### For code changes: - [ ] I have clearly listed my changes in the PR description - [ ] I have made a test plan - [ ] I have tested my changes according to the test plan: <!-- Put your test plan here: --> - [ ] ... <details> <summary>Example test plan</summary> - [ ] Create from scratch and execute an agent with at least 3 blocks - [ ] Import an agent from file upload, and confirm it executes correctly - [ ] Upload agent to marketplace - [ ] Import an agent from marketplace and confirm it executes correctly - [ ] Edit an agent from monitor, and confirm it executes correctly </details> #### For configuration changes: - [ ] `.env.example` is updated or already compatible with my changes - [ ] `docker-compose.yml` is updated or already compatible with my changes - [ ] I have included a list of my configuration changes in the PR description (under **Changes**) <details> <summary>Examples of configuration changes</summary> - Changing ports - Adding new services that need to communicate with each other - Secrets or environment variable changes - New or infrastructure changes such as databases </details> --------- Co-authored-by: Bently <[email protected]> Co-authored-by: Aarushi <[email protected]>
1 parent 94a312a commit 2de5e3d

File tree

197 files changed

+20449
-7548
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+20449
-7548
lines changed

.github/workflows/platform-frontend-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
strategy:
4343
fail-fast: false
4444
matrix:
45-
browser: [chromium, firefox, webkit]
45+
browser: [chromium, webkit]
4646

4747
steps:
4848
- name: Checkout repository

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,6 @@ LICENSE.rtf
173173
autogpt_platform/backend/settings.py
174174
/.auth
175175
/autogpt_platform/frontend/.auth
176-
.test-contents
176+
177+
*.ign.*
178+
.test-contents

autogpt_platform/autogpt_libs/autogpt_libs/auth/depends.py

+9
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,12 @@ def verify_user(payload: dict | None, admin_only: bool) -> User:
3535
raise fastapi.HTTPException(status_code=403, detail="Admin access required")
3636

3737
return User.from_payload(payload)
38+
39+
40+
def get_user_id(payload: dict = fastapi.Depends(auth_middleware)) -> str:
41+
user_id = payload.get("sub")
42+
if not user_id:
43+
raise fastapi.HTTPException(
44+
status_code=401, detail="User ID not found in token"
45+
)
46+
return user_id

autogpt_platform/backend/Dockerfile

+20-15
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,23 @@ ENV PYTHONUNBUFFERED 1
66

77
WORKDIR /app
88

9-
# Install build dependencies
10-
RUN apt-get update \
11-
&& apt-get install -y build-essential curl ffmpeg wget libcurl4-gnutls-dev libexpat1-dev libpq5 gettext libz-dev libssl-dev postgresql-client git \
12-
&& apt-get clean \
13-
&& rm -rf /var/lib/apt/lists/*
9+
RUN echo 'Acquire::http::Pipeline-Depth 0;\nAcquire::http::No-Cache true;\nAcquire::BrokenProxy true;\n' > /etc/apt/apt.conf.d/99fixbadproxy
1410

15-
ENV POETRY_VERSION=1.8.3 \
16-
POETRY_HOME="/opt/poetry" \
17-
POETRY_NO_INTERACTION=1 \
18-
POETRY_VIRTUALENVS_CREATE=false \
19-
PATH="$POETRY_HOME/bin:$PATH"
11+
RUN apt-get update --allow-releaseinfo-change --fix-missing
2012

13+
# Install build dependencies
14+
RUN apt-get install -y build-essential
15+
RUN apt-get install -y libpq5
16+
RUN apt-get install -y libz-dev
17+
RUN apt-get install -y libssl-dev
18+
RUN apt-get install -y postgresql-client
19+
20+
ENV POETRY_VERSION=1.8.3
21+
ENV POETRY_HOME=/opt/poetry
22+
ENV POETRY_NO_INTERACTION=1
23+
ENV POETRY_VIRTUALENVS_CREATE=false
24+
ENV PATH=/opt/poetry/bin:$PATH
25+
2126
# Upgrade pip and setuptools to fix security vulnerabilities
2227
RUN pip3 install --upgrade pip setuptools
2328

@@ -39,11 +44,11 @@ FROM python:3.11.10-slim-bookworm AS server_dependencies
3944

4045
WORKDIR /app
4146

42-
ENV POETRY_VERSION=1.8.3 \
43-
POETRY_HOME="/opt/poetry" \
44-
POETRY_NO_INTERACTION=1 \
45-
POETRY_VIRTUALENVS_CREATE=false \
46-
PATH="$POETRY_HOME/bin:$PATH"
47+
ENV POETRY_VERSION=1.8.3
48+
ENV POETRY_HOME=/opt/poetry
49+
ENV POETRY_NO_INTERACTION=1
50+
ENV POETRY_VIRTUALENVS_CREATE=false
51+
ENV PATH=/opt/poetry/bin:$PATH
4752

4853

4954
# Upgrade pip and setuptools to fix security vulnerabilities

autogpt_platform/backend/backend/blocks/pinecone.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def run(
143143
top_k=input_data.top_k,
144144
include_values=input_data.include_values,
145145
include_metadata=input_data.include_metadata,
146-
).to_dict()
146+
).to_dict() # type: ignore
147147
combined_text = ""
148148
if results["matches"]:
149149
texts = [

autogpt_platform/backend/backend/data/model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def SchemaField(
160160
exclude=exclude,
161161
json_schema_extra=json_extra,
162162
**kwargs,
163-
)
163+
) # type: ignore
164164

165165

166166
class _BaseCredentials(BaseModel):

autogpt_platform/backend/backend/server/rest_api.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import backend.data.graph
1717
import backend.data.user
1818
import backend.server.routers.v1
19+
import backend.server.v2.store.routes
1920
import backend.util.service
2021
import backend.util.settings
2122

@@ -84,7 +85,10 @@ def handler(request: fastapi.Request, exc: Exception):
8485

8586
app.add_exception_handler(ValueError, handle_internal_http_error(400))
8687
app.add_exception_handler(Exception, handle_internal_http_error(500))
87-
app.include_router(backend.server.routers.v1.v1_router, tags=["v1"])
88+
app.include_router(backend.server.routers.v1.v1_router, tags=["v1"], prefix="/api")
89+
app.include_router(
90+
backend.server.v2.store.routes.router, tags=["v2"], prefix="/api/store"
91+
)
8892

8993

9094
@app.get(path="/health", tags=["health"], dependencies=[])

autogpt_platform/backend/backend/server/routers/v1.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ def execution_scheduler_client() -> ExecutionScheduler:
6969
_user_credit_model = get_user_credit_model()
7070

7171
# Define the API routes
72-
v1_router = APIRouter(prefix="/api")
73-
72+
v1_router = APIRouter()
7473

7574
v1_router.include_router(
7675
backend.server.integrations.router.router,
@@ -132,7 +131,7 @@ def execute_graph_block(block_id: str, data: BlockInput) -> CompletedBlockOutput
132131

133132
@v1_router.get(path="/credits", dependencies=[Depends(auth_middleware)])
134133
async def get_user_credits(
135-
user_id: Annotated[str, Depends(get_user_id)]
134+
user_id: Annotated[str, Depends(get_user_id)],
136135
) -> dict[str, int]:
137136
# Credits can go negative, so ensure it's at least 0 for user to see.
138137
return {"credits": max(await _user_credit_model.get_or_refill_credit(user_id), 0)}

autogpt_platform/backend/backend/server/v2/store/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)