Custom Templates
albert.collections.custom_templates.CustomTemplatesCollection
Bases: BaseCollection
CustomTemplatesCollection is a collection class for managing CustomTemplate entities in the Albert platform.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
AlbertSession
|
The Albert session instance. |
required |
Methods:
Name | Description |
---|---|
get_by_id |
Get a Custom Template by ID |
list |
Searches for custom templates matching the provided criteria. |
Attributes:
Name | Type | Description |
---|---|---|
base_path |
|
Source code in src/albert/collections/custom_templates.py
get_by_id
get_by_id(*, id) -> CustomTemplate
Get a Custom Template by ID
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
str
|
id of the custom template |
required |
Returns:
Type | Description |
---|---|
CustomTemplate
|
The CutomTemplate with the provided ID (or None if not found) |
Source code in src/albert/collections/custom_templates.py
list
list(
*,
text: str | None = None,
limit: int = 50,
offset: int = 0,
) -> Iterator[CustomTemplate]
Searches for custom templates matching the provided criteria.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text
|
str | None
|
The text to search for, by default None |
None
|
Yields:
Type | Description |
---|---|
Iterator[CustomTemplate]
|
An iterator of CustomTemplate items matching the search criteria. |