Chat Folders (🧪Beta)
albert.collections.chat_folders.ChatFolderCollection
Async collection for managing chat folders (🧪Beta).
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!
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AsyncAlbertSession
|
The Albert async session instance. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
base_path |
str
|
The base URL for chat folder API requests. |
Methods:
| Name | Description |
|---|---|
create |
Creates a new chat folder. |
get_by_id |
Retrieves a chat folder by its ID. |
get_all |
Iterates over chat folders with optional filters. |
update |
Updates a chat folder by ID. |
delete |
Deletes a chat folder by its ID. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AsyncAlbertSession
|
The async session used to make API requests. |
required |
Source code in src/albert/collections/chat_folders.py
create
create(*, folder: ChatFolder) -> ChatFolder
Create a new chat folder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
folder
|
ChatFolder
|
The folder to create. |
required |
Returns:
| Type | Description |
|---|---|
ChatFolder
|
The created folder. |
Source code in src/albert/collections/chat_folders.py
get_by_id
get_by_id(*, id: str) -> ChatFolder
Retrieve a chat folder by its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The folder ID. |
required |
Returns:
| Type | Description |
|---|---|
ChatFolder
|
The matching 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.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
list[str] | None
|
Filter by folder name(s). |
None
|
exact_match
|
bool
|
Whether name filtering uses exact matching (default False). |
False
|
max_items
|
int | None
|
Maximum number of items to return in total. If None, fetches all available items. |
None
|
Yields:
| Type | Description |
|---|---|
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.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The ID of the folder to update. |
required |
name
|
str | None
|
New display name for the folder. |
None
|
sequence
|
list | None
|
New ordering of child sessions or folders. |
None
|
Returns:
| Type | Description |
|---|---|
ChatFolder
|
The updated folder. |
Notes
The following fields can be updated: name, sequence.