Breakthrough Insights
albert.collections.btinsight.BTInsightCollection
Bases: BaseCollection
Manage Breakthrough insights in the Albert platform.
Albert Breakthrough is Albert's inverse-design / ML optimization capability. An insight
(BTInsight) is an output produced by
Breakthrough, such as an optimizer result, impact chart, or generated
candidate. An insight is categorized by its
BTInsightCategory and can trace back to the
dataset, model session, and model it came from (dataset_id,
model_session_id, model_id), which link to
BTDatasetCollection and
BTModelCollection.
Insights are identified by an insight ID (format INS..., e.g. "INS7").
This collection is accessed as client.btinsights.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AlbertSession
|
The authenticated Albert session used for API calls. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
base_path |
str
|
The base API route for insight requests. |
Methods:
| Name | Description |
|---|---|
create |
Create a new insight. |
get_by_id |
Get a single insight by its ID. |
search |
Search for insights by text, name, state, or category. |
update |
Update an existing insight. |
delete |
Delete an insight by its ID. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AlbertSession
|
The authenticated Albert session used for API calls. |
required |
Source code in src/albert/collections/btinsight.py
create
Create a new insight.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
insight
|
BTInsight
|
The insight to create. |
required |
Returns:
| Type | Description |
|---|---|
BTInsight
|
The newly created insight, populated with its assigned ID. |
Source code in src/albert/collections/btinsight.py
get_by_id
get_by_id(*, id: BTInsightId) -> BTInsight
Get a single insight by its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
BTInsightId
|
The insight ID (format |
required |
Returns:
| Type | Description |
|---|---|
BTInsight
|
The fully populated insight. |
Source code in src/albert/collections/btinsight.py
search
search(
*,
order_by: OrderBy | None = None,
sort_by: str | None = None,
text: str | None = None,
name: str | list[str] | None = None,
state: BTInsightState
| list[BTInsightState]
| None = None,
category: BTInsightCategory
| list[BTInsightCategory]
| None = None,
created_by: str | list[str] | None = None,
updated_by: str | list[str] | None = None,
from_created_at: str | None = None,
to_created_at: str | None = None,
from_updated_at: str | None = None,
to_updated_at: str | None = None,
model_session: str | list[str] | None = None,
tag: str | list[str] | None = None,
offset: int | None = None,
max_items: int | None = None,
) -> Iterator[BTInsight]
Search for insights matching the given filters.
Results are returned as a lazily paginated iterator, so iterating fetches additional pages on demand.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order_by
|
OrderBy
|
Sort direction (ascending or descending). Default None (server order). |
None
|
sort_by
|
str
|
Field to sort by. Default None. |
None
|
text
|
str
|
Free-text query matched against insight name and related fields. |
None
|
name
|
str or list[str]
|
Filter by exact insight name(s). |
None
|
state
|
BTInsightState or list[BTInsightState]
|
Filter by progress state (e.g. |
None
|
category
|
BTInsightCategory or list[BTInsightCategory]
|
Filter by category (e.g. |
None
|
created_by
|
str or list[str]
|
Filter by creator. Accepts user display name(s) or UserId(s) (e.g.
|
None
|
updated_by
|
str or list[str]
|
Filter by user(s) who last updated the insight. Accepts UserId(s)
only (e.g. |
None
|
from_created_at
|
str
|
Only include insights created on or after this date (ISO 8601). |
None
|
to_created_at
|
str
|
Only include insights created on or before this date (ISO 8601). |
None
|
from_updated_at
|
str
|
Only include insights updated on or after this date (ISO 8601). |
None
|
to_updated_at
|
str
|
Only include insights updated on or before this date (ISO 8601). |
None
|
model_session
|
str or list[str]
|
Filter by model session ID(s) (format |
None
|
tag
|
str or list[str]
|
Filter by tag name(s). |
None
|
max_items
|
int
|
Maximum number of items to return in total. If None, iterates over all matches. |
None
|
Returns:
| Type | Description |
|---|---|
Iterator[BTInsight]
|
A lazily paginated iterator of matching insights. |
Source code in src/albert/collections/btinsight.py
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | |
update
Update an existing insight.
Fetch the insight (e.g. with get_by_id), modify the updatable
fields on the returned object, then pass it here. Only the fields listed in
Notes are applied; changes to other fields are ignored.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
insight
|
BTInsight
|
The insight to update. Must have a valid |
required |
Returns:
| Type | Description |
|---|---|
BTInsight
|
The updated insight. |
Notes
The following fields can be updated: content_edited, end_time,
metadata, name, output_key, payload_type, raw_payload,
registry, start_time, state, total_time.
Source code in src/albert/collections/btinsight.py
delete
delete(*, id: BTInsightId) -> None
Delete an insight by its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
BTInsightId
|
The insight ID to delete (format |
required |
Returns:
| Type | Description |
|---|---|
None
|
|