OrchestrationStep

All models for the Orchestrator app.

class smarter.apps.orchestrator.models.orchestration_step.OrchestrationStep(*args, **kwargs)[source]

Bases: TimestampedModel

A single LLMClient invocation within an OrchestrationRun.

One row per turn/hop in the orchestration loop: which Harness ran, and where in the run’s sequence. Input/output, token counts, and latency live on LLMClient’s own execution-tracking model (execution) — this model just adds the run/sequence/orchestration-status context on top, so that data isn’t duplicated in two places.

Parameters:
  • id (Unknown) – Primary key: ID

  • updated_at (Unknown) – Updated at

  • sequence (Unknown) – Sequence. Ordinal position of this step within the run.

  • status (Unknown) – Status

  • error_message (Unknown) – Error message. Orchestration-level failure reason (e.g. bad handoff), distinct from any error on the execution record itself.

  • created_at (Unknown) – Created at

Relationship fields:

Parameters:
  • run (Unknown) – Run (related name: steps)

  • harness (Unknown) – Harness. Which Orchestrator/LLMClient membership executed this step. (related name: steps)

  • prompt (Unknown) – Prompt. The underlying LLMClient execution record (input/output, tokens, latency). OrchestrationStep only adds the run/sequence context on top of it. (related name: orchestration_steps)

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

exception NotUpdated

Bases: ObjectNotUpdated, DatabaseError

class StepStatus(*values)[source]

Bases: TextChoices

FAILED = 'failed'
SKIPPED = 'skipped'
SUCCEEDED = 'succeeded'
created_at

DateTimeField

Created at

Timestamp indicating when the model instance was created.

This field is automatically set to the current date and time when the instance is first created. It is indexed in the database for efficient querying.

Type:

Type

error_message

TextField

Error message. Orchestration-level failure reason (e.g. bad handoff), distinct from any error on the execution record itself.

Type:

Type

get_next_by_created_at(*, field=<django.db.models.DateTimeField: created_at>, is_next=True, **kwargs)

Finds next instance based on created_at. See get_next_by_FOO() for more information.

get_previous_by_created_at(*, field=<django.db.models.DateTimeField: created_at>, is_next=False, **kwargs)

Finds previous instance based on created_at. See get_previous_by_FOO() for more information.

get_status_display(*, field=<django.db.models.CharField: status>)

Shows the label of the status. See get_FOO_display() for more information.

harness

ForeignKey to OrchestratorHarness

Harness. Which Orchestrator/LLMClient membership executed this step. (related name: steps)

Type:

Type

harness_id

Internal field, use harness instead.

id

BigAutoField

Primary key: ID

Type:

Type

objects = <django.db.models.Manager object>
prompt

ForeignKey to Prompt

Prompt. The underlying LLMClient execution record (input/output, tokens, latency). OrchestrationStep only adds the run/sequence context on top of it. (related name: orchestration_steps)

Type:

Type

prompt_id

Internal field, use prompt instead.

run

ForeignKey to OrchestrationRun

Run (related name: steps)

Type:

Type

run_id

Internal field, use run instead.

sequence

PositiveIntegerField

Sequence. Ordinal position of this step within the run.

Type:

Type

status

CharField

Status

Choices:

  • succeeded

  • failed

  • skipped

Type:

Type

updated_at

DateTimeField

Updated at

Timestamp indicating when the model instance was last updated.

This field is automatically updated to the current date and time whenever the instance is saved. It is indexed in the database for efficient querying.

Type:

Type