Breakthrough Insights
albert.collections.btinsight
BaseCollection
BaseCollection(*, session: AlbertSession)
BaseCollection is the base class for all collection classes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AlbertSession
|
The Albert API Session instance. |
required |
Source code in src/albert/collections/base.py
BTInsight
Bases: BaseResource
model_session_id
model_session_id: BTModelSessionId | None = Field(
default=None, alias="modelSessionId"
)
BTInsightCategory
BTInsightState
AlbertSession
AlbertSession(
*,
base_url: str,
token: str | None = None,
client_credentials: ClientCredentials | None = None,
retries: int | None = None,
)
Bases: Session
A session that has a base URL, which is prefixed to all request URLs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_url
|
str
|
The base URL to prefix to all requests. (e.g., "https://sandbox.albertinvent.com") |
required |
retries
|
int
|
The number of retries for failed requests. Defaults to 3. |
None
|
client_credentials
|
ClientCredentials | None
|
The client credentials for programmatic authentication. Optional if token is provided. |
None
|
token
|
str | None
|
The JWT token for authentication. Optional if client credentials are provided. |
None
|
Source code in src/albert/session.py
request
Source code in src/albert/session.py
BTInsightCollection
BTInsightCollection(*, session: AlbertSession)
Bases: BaseCollection
BTInsightCollection is a collection class for managing Breakthrough insight entities.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AlbertSession
|
The Albert session instance. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
base_path |
str
|
The base path for BTInsight API requests. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AlbertSession
|
The Albert session instance. |
required |
Source code in src/albert/collections/btinsight.py
create
Create a new BTInsight.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
insight
|
BTInsight
|
The BTInsight record to create. |
required |
Returns:
| Type | Description |
|---|---|
BTInsight
|
The created BTInsight. |
Source code in src/albert/collections/btinsight.py
get_by_id
get_by_id(*, id: BTInsightId) -> BTInsight
Get a BTInsight by ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
BTInsightId
|
The Albert ID of the insight. |
required |
Returns:
| Type | Description |
|---|---|
BTInsight
|
The retrived BTInsight. |
Source code in src/albert/collections/btinsight.py
search
search(
*,
limit: int = 100,
offset: int | None = None,
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,
) -> Iterator[BTInsight]
Search for items in the BTInsight collection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit
|
int
|
Number of items to return per page, default 100 |
100
|
offset
|
int | None
|
Item offset to begin search at, default None |
None
|
order_by
|
OrderBy | None
|
Asc/desc ordering, default None |
None
|
sort_by
|
str | None
|
Sort field, default None |
None
|
text
|
str | None
|
Text field in search query, default None |
None
|
name
|
str | list[str] | None
|
BTInsight name search filter, default None |
None
|
state
|
BTInsightState | list[BTInsightState] | None
|
BTInsight state search filter, default None |
None
|
category
|
BTInsightCategory | list[BTInsightCategory] | None
|
BTInsight category search filter, default None |
None
|
Returns:
| Type | Description |
|---|---|
Iterator[BTInsight]
|
An iterator of elements returned by the BTInsight search query. |
Source code in src/albert/collections/btinsight.py
update
Update a BTInsight.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
insight
|
BTInsight
|
The BTInsight to update. |
required |
Returns:
| Type | Description |
|---|---|
BTInsight
|
The updated BTInsight. |
Source code in src/albert/collections/btinsight.py
delete
delete(*, id: BTInsightId) -> None
Delete a BTInsight by ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The ID of the BTInsight to delete. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|