folders
Classes
FoldersClient
FoldersClient(client: OWUIClientBase)
Bases: ResourceBase
Client for the Folders endpoints.
- Code Reference client Classes OpenWebUI Attributes folders
Source code in src/owui_client/client_base.py
Functions
get_folders
get_folders() -> List[FolderNameIdResponse]
Get all folders for the current user.
Returns:
| Type | Description |
|---|---|
List[FolderNameIdResponse]
|
List[FolderNameIdResponse]: A list of folders with basic information. |
Source code in src/owui_client/routers/folders.py
create_folder
create_folder(form_data: FolderForm) -> FolderModel
Create a new root folder.
To create a nested folder, create a root folder and then move it using update_folder_parent_id_by_id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
form_data
|
FolderForm
|
The form data for creating the folder. |
required |
Returns:
| Type | Description |
|---|---|
FolderModel
|
|
Source code in src/owui_client/routers/folders.py
get_folder_by_id
get_folder_by_id(id: str) -> Optional[FolderModel]
Get a folder by ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The folder ID. |
required |
Returns:
| Type | Description |
|---|---|
Optional[FolderModel]
|
Optional[FolderModel]: The folder model, or None if not found. |
Source code in src/owui_client/routers/folders.py
update_folder_name_by_id
update_folder_name_by_id(
id: str, form_data: FolderUpdateForm
) -> FolderModel
Update a folder's details (name, data, meta) by ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The folder ID. |
required |
form_data
|
FolderUpdateForm
|
The update form data. |
required |
Returns:
| Type | Description |
|---|---|
FolderModel
|
|
Source code in src/owui_client/routers/folders.py
update_folder_parent_id_by_id
update_folder_parent_id_by_id(
id: str, form_data: FolderParentIdForm
) -> FolderModel
Move a folder to a new parent folder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The folder ID. |
required |
form_data
|
FolderParentIdForm
|
The parent ID form data. |
required |
Returns:
| Type | Description |
|---|---|
FolderModel
|
|
Source code in src/owui_client/routers/folders.py
update_folder_is_expanded_by_id
update_folder_is_expanded_by_id(
id: str, form_data: FolderIsExpandedForm
) -> FolderModel
Update a folder's expansion status (is_expanded) by ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The folder ID. |
required |
form_data
|
FolderIsExpandedForm
|
The is_expanded form data. |
required |
Returns:
| Type | Description |
|---|---|
FolderModel
|
|
Source code in src/owui_client/routers/folders.py
delete_folder_by_id
Delete a folder by ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The folder ID. |
required |
delete_contents
|
Optional[bool]
|
Whether to delete the contents of the folder (chats, etc). Defaults to True. If False, contents might be moved or handled differently depending on the backend logic (usually chats are moved to root or detached). |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if successful. |