Breakthrough Model
albert.collections.btmodel
BTModelSessionId
module-attribute
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
BTModel
Bases: BaseResource
A single Breakthrough model.
A BTModel may have a parent_id
or be a detached, standalone model.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the model. |
id |
BTModelId | None
|
The unique identifier for the model. |
dataset_id |
BTDatasetId | None
|
The identifier for the dataset associated with the model. |
parent_id |
BTModelSessionId | None
|
The identifier for the parent model session, if applicable. |
metadata |
dict[str, Any] | None
|
Metadata associated with the model, if applicable. |
type |
BTModelType | None
|
The type of the model (e.g., Session, Detached). |
state |
BTModelState | None
|
The current state of the model (e.g., Queued, Building Models, Complete). |
target |
list[str] | None
|
The target variables for the model, if applicable. |
start_time |
str | None
|
The start time of the model creation, if applicable. |
end_time |
str | None
|
The end time of the model creation, if applicable. |
total_time |
str | None
|
The total time taken for the model creation, if applicable. |
model_binary_key |
str | None
|
The storage key for the model data, if applicable. |
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')
metadata
class-attribute
instance-attribute
model_binary_key
class-attribute
instance-attribute
model_binary_key: str | None = Field(
default=None, alias="modelBinaryKey"
)
parent_id
class-attribute
instance-attribute
parent_id: BTModelSessionId | None = Field(
default=None, alias="parentId"
)
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"
)
BTModelCollection
BTModelCollection(*, session: AlbertSession)
Bases: BaseCollection
BTModelCollection is a collection class for managing Breakthrough model entities.
Breakthrough models can be associated with a parent Breakthrough model session, or a detached without a parent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
AlbertSession
|
The Albert session instance. |
required |
Methods:
Name | Description |
---|---|
create |
Create a new BTModel instance. |
delete |
Delete a BTModel by ID. |
get_by_id |
Retrieve a BTModel by its ID. |
update |
Update an existing BTModel. |
Source code in src/albert/collections/btmodel.py
create
create(
*,
model: BTModel,
parent_id: BTModelSessionId | None = None,
) -> BTModel
Create a new BTModel instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model
|
BTModel
|
The BTModel instance to create. |
required |
parent_id
|
BTModelSessionId | None
|
The optional ID of the parent BTModelSession. |
None
|
Returns:
Type | Description |
---|---|
BTModel
|
The created BTModel instance. |
Source code in src/albert/collections/btmodel.py
delete
delete(
*,
id: BTModelId,
parent_id: BTModelSessionId | None = None,
) -> None
Delete a BTModel by ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
BTModelId
|
The ID of the BTModel to delete. |
required |
parent_id
|
BTModelSessionId | None
|
The optional ID of the parent BTModelSession. |
None
|
Returns:
Type | Description |
---|---|
None
|
|
Source code in src/albert/collections/btmodel.py
get_by_id
get_by_id(
*,
id: BTModelId,
parent_id: BTModelSessionId | None = None,
) -> BTModel
Retrieve a BTModel by its ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
BTModelId
|
The ID of the BTModel to retrieve. |
required |
parent_id
|
BTModelSessionId | None
|
The optional ID of the parent BTModelSession. |
None
|
Returns:
Type | Description |
---|---|
BTModel
|
The retrieved BTModel instance. |
Source code in src/albert/collections/btmodel.py
update
update(
*,
model: BTModel,
parent_id: BTModelSessionId | None = None,
) -> BTModel
Update an existing BTModel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model
|
BTModel
|
The BTModel instance with updated data. |
required |
parent_id
|
BTModelSessionId | None
|
The optional ID of the parent BTModelSession. |
None
|
Returns:
Type | Description |
---|---|
BTModel
|
The updated BTModel instance. |
Source code in src/albert/collections/btmodel.py
BTModelSession
Bases: BaseResource
Parent session for a set of BTModels.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the model session. |
category |
BTModelSessionCategory
|
The category of the model session (e.g., userModel, albertModel). |
id |
BTModelSessionId | None
|
The unique identifier for the model session. |
dataset_id |
BTDatasetId
|
The identifier for the dataset associated with the model session. |
default_model |
str | None
|
The default model name for the session, if applicable. |
total_time |
str | None
|
The total time taken for the session, if applicable. |
model_count |
int | None
|
The number of models in the session, if applicable. |
target |
list[str] | None
|
The target variables for the models in the session, if applicable. |
registry |
BTModelRegistry | None
|
The registry containing build logs and metrics for the session, if applicable. |
albert_model_details |
dict[str, Any] | None
|
Details specific to the Albert model, if applicable. |
albert_model_details
class-attribute
instance-attribute
dataset_id
class-attribute
instance-attribute
dataset_id: BTDatasetId = Field(..., alias='datasetId')
default_model
class-attribute
instance-attribute
default_model: str | None = Field(
default=None, alias="defaultModel"
)
model_count
class-attribute
instance-attribute
model_count: int | None = Field(
default=None, alias="modelCount"
)
registry
class-attribute
instance-attribute
total_time
class-attribute
instance-attribute
total_time: str | None = Field(
default=None, alias="totalTime"
)
BTModelSessionCollection
BTModelSessionCollection(*, session: AlbertSession)
Bases: BaseCollection
BTModelSessionCollection is a collection class for managing Breakthrough model session entities.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
AlbertSession
|
The Albert session instance. |
required |
Attributes:
Name | Type | Description |
---|---|---|
base_path |
str
|
The base path for BTModelSession API requests. |
Methods:
Name | Description |
---|---|
create |
|
delete |
Delete a BTModelSession by ID. |
get_by_id |
|
update |
|
Source code in src/albert/collections/btmodel.py
create
create(*, model_session: BTModelSession) -> BTModelSession
Source code in src/albert/collections/btmodel.py
delete
delete(*, id: BTModelSessionId) -> None
Delete a BTModelSession by ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
BTModelSessionId
|
The ID of the BTModelSession to delete. |
required |
Returns:
Type | Description |
---|---|
None
|
|
Source code in src/albert/collections/btmodel.py
get_by_id
get_by_id(*, id: BTModelSessionId) -> BTModelSession
update
update(*, model_session: BTModelSession) -> BTModelSession
Source code in src/albert/collections/btmodel.py
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 |