Chat Folders (🧪Beta)
albert.collections.chat_folders.ChatFolderCollection
Manage folders that organize "Ask Albert" chat sessions (🧪 Beta).
A chat folder (ChatFolder) groups related
conversations with Albert's AI assistant. Sessions
(ChatSession, managed by
ChatSessionCollection) are filed
under a folder via the session's parent_id, and folders can be nested
inside one another.
This is an async collection accessed as client.chat_folders on an
AsyncAlbert client.
Beta Feature!
Please do not use in production or without explicit guidance from Albert. You might otherwise have a bad experience. This feature currently falls outside of the Albert support contract, but we'd love your feedback!
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AsyncAlbertSession
|
The authenticated Albert async session used for API calls. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
base_path |
str
|
The base API route for chat folder requests. |
Methods:
| Name | Description |
|---|---|
create |
Create a new chat folder. |
get_by_id |
Get a single folder by its ID. |
get_all |
Iterate over folders, with optional filters. |
update |
Rename a folder or reorder its contents. |
delete |
Delete a folder by its ID. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AsyncAlbertSession
|
The authenticated Albert async session used for API calls. |
required |
Source code in src/albert/collections/chat_folders.py
create
create(*, folder: ChatFolder) -> ChatFolder
Create a new chat folder.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
folder
|
ChatFolder
|
The folder to create. |
required |
Returns:
| Type | Description |
|---|---|
ChatFolder
|
The created folder, populated with its server-assigned |
Source code in src/albert/collections/chat_folders.py
get_by_id
get_by_id(*, id: str) -> ChatFolder
Get a chat folder by its ID.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The identifier of the folder to retrieve. |
required |
Returns:
| Type | Description |
|---|---|
ChatFolder
|
The fully populated folder. |
Source code in src/albert/collections/chat_folders.py
get_all
get_all(
*,
name: list[str] | None = None,
exact_match: bool = False,
max_items: int | None = None,
) -> AsyncIterator[ChatFolder]
Iterate over chat folders, with optional filters.
Transparently pages through results, yielding one folder at a time.
Returns the paginator directly so has_more remains available.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
list[str] | None
|
Filter to folders whose name matches any of the given values. |
None
|
exact_match
|
bool
|
When |
False
|
max_items
|
int | None
|
Maximum number of folders to yield in total. If |
None
|
Returns:
| Type | Description |
|---|---|
AsyncIterator[ChatFolder]
|
Folders matching the given filters. |
Source code in src/albert/collections/chat_folders.py
update
update(
*,
id: str,
name: str | None = None,
sequence: list[str] | None = None,
) -> ChatFolder
Update a chat folder.
Rename a folder and/or reorder its contents. Only the arguments you pass are changed; omitted arguments are left untouched.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The identifier of the folder to update. |
required |
name
|
str | None
|
A new display name for the folder. |
None
|
sequence
|
list[str] | None
|
A new ordering of the folder's child sessions and folders, given as their IDs in the desired order. |
None
|
Returns:
| Type | Description |
|---|---|
ChatFolder
|
The updated folder. |
Notes
The following fields can be updated: name, sequence.
Source code in src/albert/collections/chat_folders.py
delete
delete(*, id: str) -> None
Delete a chat folder by its ID.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The identifier of the folder to delete. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|