prefactor_core.models module
prefactor_core.models module
Section titled “prefactor_core.models module”Data models for prefactor-core.
This module contains dataclasses and models used throughout the SDK.
class prefactor_core.models.AgentInstance(id: str, agent_id: str, status: str = ‘pending’, created_at: datetime = , started_at: datetime | None = None, finished_at: datetime | None = None, metadata: dict[str, ~typing.Any]=)
Section titled “class prefactor_core.models.AgentInstance(id: str, agent_id: str, status: str = ‘pending’, created_at: datetime = , started_at: datetime | None = None, finished_at: datetime | None = None, metadata: dict[str, ~typing.Any]=)”Bases: object
Represents an agent instance.
An agent instance is a single execution of an agent. It tracks the lifecycle from registration through completion.
Unique identifier for this instance.
- Type: str
agent_id
Section titled “agent_id”ID of the agent this is an instance of.
- Type: str
status
Section titled “status”Current status (pending, active, complete).
- Type: str
created_at
Section titled “created_at”When the instance was registered.
- Type: datetime.datetime
started_at
Section titled “started_at”When the instance started executing (if started).
- Type: datetime.datetime | None
finished_at
Section titled “finished_at”When the instance completed (if finished).
- Type: datetime.datetime | None
metadata
Section titled “metadata”Additional metadata about the instance.
- Type: dict[str, Any]
agent_id : str
Section titled “agent_id : str”created_at : datetime
Section titled “created_at : datetime”finished_at : datetime | None = None
Section titled “finished_at : datetime | None = None”id : str
Section titled “id : str”metadata : dict[str, Any]
Section titled “metadata : dict[str, Any]”started_at : datetime | None = None
Section titled “started_at : datetime | None = None”status : str = ‘pending’
Section titled “status : str = ‘pending’”class prefactor_core.models.Span(id: str, instance_id: str, schema_name: str, parent_span_id: str | None = None, status: str = ‘pending’, payload: dict[str, ~typing.Any]=, created_at: datetime = , started_at: datetime | None = None, finished_at: datetime | None = None)
Section titled “class prefactor_core.models.Span(id: str, instance_id: str, schema_name: str, parent_span_id: str | None = None, status: str = ‘pending’, payload: dict[str, ~typing.Any]=, created_at: datetime = , started_at: datetime | None = None, finished_at: datetime | None = None)”Bases: object
Represents a span within an agent instance.
Spans represent discrete units of work within an agent execution, such as LLM calls, tool executions, or processing steps.
Unique identifier for this span.
- Type: str
instance_id
Section titled “instance_id”ID of the agent instance this span belongs to.
- Type: str
parent_span_id
Section titled “parent_span_id”ID of the parent span (if nested).
- Type: str | None
schema_name
Section titled “schema_name”Name of the schema defining this span type.
- Type: str
status
Section titled “status”Current status (pending, active, complete).
- Type: str
payload
Section titled “payload”Arbitrary data associated with this span.
- Type: dict[str, Any]
created_at
Section titled “created_at”When the span was created.
- Type: datetime.datetime
started_at
Section titled “started_at”When the span started (defaults to created_at).
- Type: datetime.datetime | None
finished_at
Section titled “finished_at”When the span completed (if finished).
- Type: datetime.datetime | None