Pydantic Models

Smarter API Orchestrator Manifest Constants.

Smarter API Manifest - Orchestrator.metadata.

class smarter.apps.orchestrator.manifest.models.orchestrator.metadata.SAMOrchestratorMetadata(*, name: str, description: str | None, version: str | None, tags: List[str] | None = <factory>, annotations: dict[str, str] | None=<factory>)[source]

Bases: AbstractSAMMetadataBase

Smarter API Orchestrator Manifest - Metadata class.

class_identifier: ClassVar[str] = 'Orchestrator.metadata'
model_config = {'arbitrary_types_allowed': True, 'from_attributes': True, 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialize private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

Return type:

None

Pydantic manifest spec for the Orchestrator SAM (Smarter API Manifest) resource.

class smarter.apps.orchestrator.manifest.models.orchestrator.spec.SAMOrchestratorHarnessConfig(**data)[source]

Bases: BaseModel

A single LLMClient (Harness) membership within the Orchestrator.

Mirrors smarter.apps.orchestrator.models.OrchestratorHarness. The llmClientName is a reference by name, not by primary key, resolved at apply time: in accountNumber’s account if given, which may be another account, e.g. a department’s, otherwise the nearest of the owner’s account tree (ADR-036, ADR-037).

accountNumber: str | None
config: dict[str, Any]
executionOrder: int
isActive: bool
llmClientName: str
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

role: HarnessRole
class smarter.apps.orchestrator.manifest.models.orchestrator.spec.SAMOrchestratorSpec(*, config: SAMOrchestratorSpecConfig)[source]

Bases: AbstractSAMSpecBase

Smarter API Orchestrator Manifest Orchestrator.spec.

class_identifier: ClassVar[str] = 'Orchestrator.spec'
config: SAMOrchestratorSpecConfig
model_config = {'arbitrary_types_allowed': True, 'from_attributes': True, 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialize private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

Return type:

None

class smarter.apps.orchestrator.manifest.models.orchestrator.spec.SAMOrchestratorSpecConfig(**data)[source]

Bases: BaseModel

Spec block for an Orchestrator SAM manifest.

Mirrors smarter.apps.orchestrator.models.Orchestrator. Consumed by the manifest controller to create/update the corresponding Orchestrator model instance and its OrchestratorHarness memberships.

harnesses: list[SAMOrchestratorHarnessConfig]
isActive: bool
maxIterations: int
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

strategy: OrchestrationStrategy
validate_strategy_role_requirements()[source]

Check that the harnesses suit the strategy.

supervisor needs a planner harness, router needs a router harness, and debate and voting need at least two harnesses.

Return type:

SAMOrchestratorSpecConfig

Returns:

The config, unchanged.

Raises:

ValueError – when the harnesses do not meet the strategy’s requirement.

classmethod validate_unique_llmclients(v)[source]

Reject harnesses that name the same LLMClient more than once.

Parameters:

v (list[SAMOrchestratorHarnessConfig]) – The harnesses.

Return type:

list[SAMOrchestratorHarnessConfig]

Returns:

The harnesses, unchanged.

Raises:

ValueError – when an llmClientName appears more than once.

Smarter API Manifest - Orchestrator.status.

class smarter.apps.orchestrator.manifest.models.orchestrator.status.SAMOrchestratorStatus(*, recordLocator: str, created: datetime, modified: datetime, dependencies: List[SAMDependency] | None = None, accountNumber: str, username: str)[source]

Bases: AbstractSAMStatusBase

Smarter API Orchestrator Manifest - Status class.

accountNumber: str
class_identifier: ClassVar[str] = 'Orchestrator.status'
model_config = {'arbitrary_types_allowed': True, 'from_attributes': True, 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialize private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

Return type:

None

username: str

Smarter API Orchestrator Manifest.

class smarter.apps.orchestrator.manifest.models.orchestrator.model.SAMOrchestrator(*, apiVersion: str, kind: str, metadata: SAMOrchestratorMetadata, spec: SAMOrchestratorSpec, status: SAMOrchestratorStatus | None = None)[source]

Bases: AbstractSAMBase

Smarter API Manifest - Orchestrator.

class_identifier: ClassVar[str] = 'Orchestrator'
metadata: SAMOrchestratorMetadata
model_config = {'arbitrary_types_allowed': True, 'from_attributes': True, 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialize private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

Return type:

None

spec: SAMOrchestratorSpec
status: SAMOrchestratorStatus | None