-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create an admin return all agents route (#1620)
- Loading branch information
Showing
5 changed files
with
50 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from fastapi import APIRouter | ||
|
||
from memgpt.server.rest_api.agents.index import ListAgentsResponse | ||
from memgpt.server.rest_api.interface import QueuingInterface | ||
from memgpt.server.server import SyncServer | ||
|
||
router = APIRouter() | ||
|
||
|
||
def setup_agents_admin_router(server: SyncServer, interface: QueuingInterface): | ||
@router.get("/agents", tags=["agents"], response_model=ListAgentsResponse) | ||
def get_all_agents(): | ||
""" | ||
Get a list of all agents in the database | ||
""" | ||
interface.clear() | ||
agents_data = server.list_agents_legacy() | ||
|
||
return ListAgentsResponse(**agents_data) | ||
|
||
return router |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters