Skip to content

Commit e5cfbc8

Browse files
committed
feat: get folder tree
Signed-off-by: Jana Peper <[email protected]>
1 parent 1eaa36f commit e5cfbc8

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

ex_app/lib/all_tools/files.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ def get_file_content(file_path: str):
2525

2626
return response.text
2727

28+
@tool
29+
@safe_tool
30+
def get_folder_tree(depth: int):
31+
"""
32+
Get the folder tree of the user
33+
:param depth: the depth of the returned folder tree
34+
:return:
35+
"""
36+
37+
return nc.ocs('GET', '/ocs/v2.php/apps/files/api/v1/folder-tree', json={'depth': depth}, response_type='json')
2838

2939
@tool
3040
@dangerous_tool
@@ -44,5 +54,6 @@ def create_public_sharing_link(path: str):
4454

4555
return [
4656
get_file_content,
57+
get_folder_tree,
4758
create_public_sharing_link,
4859
]

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
22
# SPDX-License-Identifier: AGPL-3.0-or-later
3-
nc_py_api[app]>=0.17.1
4-
nc_py_api[calendar]>=0.17.1
3+
nc_py_api[app]>=0.19.2
4+
nc_py_api[calendar]>=0.19.2
55
langgraph
66
langchain
77
ics

0 commit comments

Comments
 (0)