Breakthrough Insights
albert.collections.btinsight
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
|
Methods:
Name | Description |
---|---|
request |
|
Source code in src/albert/session.py
request
Source code in src/albert/session.py
BTInsight
Bases: BaseResource
content_edited
class-attribute
instance-attribute
content_edited: bool | None = Field(
default=None, alias="contentEdited"
)
dataset_id
class-attribute
instance-attribute
dataset_id: BTDatasetId | None = Field(
default=None, alias="datasetId"
)
end_time
class-attribute
instance-attribute
end_time: str | None = Field(default=None, alias='endTime')
id
class-attribute
instance-attribute
id: BTInsightId | None = Field(
default=None, alias="albertId"
)
metadata
class-attribute
instance-attribute
model_id
class-attribute
instance-attribute
model_id: BTModelId | None = Field(
default=None, alias="modelId"
)
model_session_id
class-attribute
instance-attribute
model_session_id: BTModelSessionId | None = Field(
default=None, alias="modelSessionId"
)
output_key
class-attribute
instance-attribute
output_key: str | None = Field(
default=None, alias="outputKey"
)
payload_type
class-attribute
instance-attribute
raw_payload
class-attribute
instance-attribute
registry
class-attribute
instance-attribute
start_time
class-attribute
instance-attribute
start_time: str | None = Field(
default=None, alias="startTime"
)
total_time
class-attribute
instance-attribute
total_time: str | None = Field(
default=None, alias="totalTime"
)
BTInsightCategory
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 |
Methods:
Name | Description |
---|---|
create |
Create a new BTInsight. |
delete |
Delete a BTInsight by ID. |
get_by_id |
Get a BTInsight by ID. |
search |
Search for items in the BTInsight collection. |
update |
Update a BTInsight. |
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
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
|
|
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
BTInsightState
GENERATING_CANDIDATES
class-attribute
instance-attribute
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 |