plexus.dashboard.api.models.base module

Base Model - Foundation for all API model classes.

This abstract base class provides common functionality for all model classes, establishing a consistent pattern for: - GraphQL field definition - Object instantiation from API responses - ID-based record retrieval - Client association

Each model class (Account, Evaluation, etc.) inherits from this base, ensuring consistent behavior across the API interface.

Implementation Notes:
  • Uses _BaseAPIClient for GraphQL operations

  • All models support get_by_id lookups

  • Models may implement additional lookup methods (get_by_key, etc.)

  • Models may implement background processing for mutations

  • Some models support batched operations

Example Usage:

# Direct lookup item = SomeModel.get_by_id(“123”, client)

# Custom lookups (if implemented) account = Account.get_by_key(“my-account”, client)

# Background mutations (if implemented) evaluation.update(status=”RUNNING”) # Returns immediately

# Batch operations (if implemented) ScoreResult.batch_create(client, items)

class plexus.dashboard.api.models.base.BaseModel(id: str, client: PlexusDashboardClient | None = None)

Bases: object

__init__(id: str, client: PlexusDashboardClient | None = None)
classmethod fields() str

Return the GraphQL fields to query for this model

classmethod from_dict(data: Dict[str, Any], client: PlexusDashboardClient) T

Create an instance from a dictionary of data

classmethod get_by_id(id: str, client: PlexusDashboardClient) T