mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-14 08:45:12 -05:00
Backend for the Blocks Menu Redesign. ### Changes 🏗️ - Add optional `agent_name` to the `AgentExecutorBlock` - displayed as the block name in the Builder - Include `output_schema` in the `LibraryAgent` model - Make `v2.store.db.py:get_store_agents` accept multiple creators filter - Add `api/builder` router with endpoints (and accompanying logic in `v2/builder/db` and models in `v2/builder/models`) - `/suggestions`: elements for the suggestions tab - `/categories`: categories with a number of blocks per each - `/blocks`: blocks based on category, type or provider - `/providers`: integration providers with their block counts - `/serach`: search blocks (including integrations), marketplace agents and user library agents - `/counts`: element counts for each category in the Blocks Menu. ### Checklist 📋 #### For code changes: - [x] I have clearly listed my changes in the PR description - [x] I have made a test plan - [x] I have tested my changes according to the test plan: - [x] Modified function `get_store_agents` works in existing code paths - [x] Agent executor block works - [x] New endpoints work - [x] Existing Builder menu is unaffected --------- Co-authored-by: Abhimanyu Yadav <abhimanyu1992002@gmail.com> Co-authored-by: Abhimanyu Yadav <122007096+Abhi1992002@users.noreply.github.com>
30 lines
759 B
Python
30 lines
759 B
Python
"""
|
|
Shared models and types used across the backend to avoid circular imports.
|
|
"""
|
|
|
|
import pydantic
|
|
|
|
|
|
class Pagination(pydantic.BaseModel):
|
|
total_items: int = pydantic.Field(
|
|
description="Total number of items.", examples=[42]
|
|
)
|
|
total_pages: int = pydantic.Field(
|
|
description="Total number of pages.", examples=[2]
|
|
)
|
|
current_page: int = pydantic.Field(
|
|
description="Current_page page number.", examples=[1]
|
|
)
|
|
page_size: int = pydantic.Field(
|
|
description="Number of items per page.", examples=[25]
|
|
)
|
|
|
|
@staticmethod
|
|
def empty() -> "Pagination":
|
|
return Pagination(
|
|
total_items=0,
|
|
total_pages=0,
|
|
current_page=0,
|
|
page_size=0,
|
|
)
|