plexus.dashboard.api.models.scoring_job module

class plexus.dashboard.api.models.scoring_job.ScoringJob(id: str, accountId: str, status: str, createdAt: datetime, updatedAt: datetime, scorecardId: str, itemId: str, startedAt: datetime | None = None, completedAt: datetime | None = None, errorMessage: str | None = None, errorDetails: Dict | None = None, metadata: Dict | None = None, evaluationId: str | None = None, scoreId: str | None = None, batchId: str | None = None, client: _BaseAPIClient | None = None)

Bases: BaseModel

Represents an individual scoring operation job.

A ScoringJob tracks the execution of a single scoring operation on an item, managing its lifecycle from creation through completion or failure.

Parameters:
  • accountId – Identifier for the account owning this job

  • status – Current status of the scoring job

  • createdAt – Timestamp when the job was created

  • updatedAt – Timestamp of the last update

  • scorecardId – Associated scorecard identifier

  • itemId – Identifier of the item being scored

  • startedAt – Timestamp when scoring started

  • completedAt – Timestamp when scoring completed

  • errorMessage – Error message if scoring failed

  • errorDetails – Detailed error information

  • metadata – Additional metadata about the scoring job

  • evaluationId – Associated evaluation identifier

  • scoreId – Associated score identifier

  • batchId – Identifier of the batch this job belongs to

__init__(id: str, accountId: str, status: str, createdAt: datetime, updatedAt: datetime, scorecardId: str, itemId: str, startedAt: datetime | None = None, completedAt: datetime | None = None, errorMessage: str | None = None, errorDetails: Dict | None = None, metadata: Dict | None = None, evaluationId: str | None = None, scoreId: str | None = None, batchId: str | None = None, client: _BaseAPIClient | None = None)
accountId: str
batchId: str | None = None
completedAt: datetime | None = None
classmethod create(client: _BaseAPIClient, accountId: str, scorecardId: str, itemId: str, parameters: Dict, **kwargs) ScoringJob

Creates a new scoring job.

Parameters:
  • client – API client instance for making requests

  • accountId – Account identifier for the job

  • scorecardId – Associated scorecard identifier

  • itemId – Item identifier to be scored

  • parameters – Additional parameters for job creation

  • kwargs – Optional parameters (status, metadata, etc.)

Returns:

New ScoringJob instance

Raises:

Exception if creation fails

createdAt: datetime
errorDetails: Dict | None = None
errorMessage: str | None = None
evaluationId: str | None = None
classmethod fields() str

Return the GraphQL fields to query for this model

classmethod find_by_item_id(item_id: str, client: _BaseAPIClient) ScoringJob | None

Finds a scoring job by its associated item identifier.

Parameters:
  • item_id – Item identifier to search for

  • client – API client instance

Returns:

ScoringJob instance if found, None otherwise

classmethod from_dict(data: Dict[str, Any], client: _BaseAPIClient) ScoringJob

Creates a ScoringJob instance from dictionary data.

Parameters:
  • data – Dictionary containing scoring job data

  • client – API client instance

Returns:

ScoringJob instance

classmethod get_batch_job(scoring_job_id: str, client: _BaseAPIClient) BatchJob | None

Gets the associated batch job for a scoring job through the join table.

Parameters:
  • scoring_job_id – ID of the scoring job

  • client – API client instance

Returns:

BatchJob instance if found, None otherwise

classmethod get_by_id(id: str, client: _BaseAPIClient) ScoringJob

Retrieves a scoring job by its identifier.

Parameters:
  • id – Scoring job identifier

  • client – API client instance

Returns:

ScoringJob instance

Raises:

Exception if scoring job not found

itemId: str
metadata: Dict | None = None
scoreId: str | None = None
scorecardId: str
startedAt: datetime | None = None
status: str
update(**kwargs) ScoringJob

Updates scoring job fields.

Parameters:

kwargs – Fields to update and their new values

Returns:

Updated ScoringJob instance

Raises:

ValueError if attempting to modify createdAt

updatedAt: datetime