Add api for list agents and agent seesions (#3835)

### What problem does this PR solve?

Add api for list agents and agent seesions

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

Co-authored-by: liuhua <10215101452@stu.ecun.edu.cn>
This commit is contained in:
liuhua
2024-12-03 19:03:16 +08:00
committed by GitHub
parent 821fdf02b4
commit 87455d79e4
6 changed files with 141 additions and 8 deletions

View File

@ -65,7 +65,7 @@ def save():
req["dsl"] = json.loads(req["dsl"])
if "id" not in req:
if UserCanvasService.query(user_id=current_user.id, title=req["title"].strip()):
return server_error_response(ValueError("Duplicated title."))
return get_data_error_result(f"{req['title'].strip()} already exists.")
req["id"] = get_uuid()
if not UserCanvasService.save(**req):
return get_data_error_result(message="Fail to save canvas.")