-
Notifications
You must be signed in to change notification settings - Fork 44.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(backend): Library v2 Agents and Presets #9258
base: dev
Are you sure you want to change the base?
feat(backend): Library v2 Agents and Presets #9258
Conversation
✅ Deploy Preview for auto-gpt-docs-dev canceled.
|
✅ Deploy Preview for auto-gpt-docs canceled.
|
…nto pwuts/open-2314-fix-up-and-re-introduce-library-v2-back-end-work
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
a8ac410
to
85180e1
Compare
######################################################## | ||
##################### Templates ######################## | ||
######################################################## | ||
|
||
|
||
@v1_router.get( | ||
path="/templates", | ||
tags=["graphs", "templates"], | ||
dependencies=[Depends(auth_middleware)], | ||
) | ||
async def get_templates( | ||
user_id: Annotated[str, Depends(get_user_id)] | ||
) -> Sequence[graph_db.GraphModel]: | ||
return await graph_db.get_graphs(filter_by="template", user_id=user_id) | ||
|
||
|
||
@v1_router.get( | ||
path="/templates/{graph_id}", | ||
tags=["templates", "graphs"], | ||
dependencies=[Depends(auth_middleware)], | ||
) | ||
async def get_template( | ||
graph_id: str, version: int | None = None | ||
) -> graph_db.GraphModel: | ||
graph = await graph_db.get_graph(graph_id, version) | ||
if not graph: | ||
raise HTTPException(status_code=404, detail=f"Template #{graph_id} not found.") | ||
return graph | ||
|
||
|
||
@v1_router.post( | ||
path="/templates", | ||
tags=["templates", "graphs"], | ||
dependencies=[Depends(auth_middleware)], | ||
) | ||
async def create_new_template( | ||
create_graph: CreateGraph, user_id: Annotated[str, Depends(get_user_id)] | ||
) -> graph_db.GraphModel: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't used anywhere on the frontend and is removed from it's clients correct?
where_clause["OR"] = [ | ||
{ | ||
"Agent": { | ||
"is": {"name": {"contains": search_query, "mode": "insensitive"}} | ||
} | ||
}, | ||
{ | ||
"Agent": { | ||
"is": { | ||
"description": {"contains": search_query, "mode": "insensitive"} | ||
} | ||
} | ||
}, | ||
] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should probably do a full-text search or vector here
) from e | ||
|
||
|
||
async def create_or_update_preset( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
upsert plz i beg you
logger = logging.getLogger(__name__) | ||
|
||
router = fastapi.APIRouter() | ||
integration_creds_manager = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this used?
This re-introduces changes from the following PRs with fixes:
Changes 🏗️
Fixes:
v2.library.db
Checklist 📋
For code changes: