# This file was auto-generated by Fern from our API Definition.

from ..core.pydantic_utilities import UniversalBaseModel
import datetime as dt
from .step_status import StepStatus
import typing
from .agent_step_output import AgentStepOutput
from ..core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic


class Step(UniversalBaseModel):
    created_at: dt.datetime
    modified_at: dt.datetime
    task_id: str
    step_id: str
    status: StepStatus
    output: typing.Optional[AgentStepOutput] = None
    order: int
    is_last: bool
    retry_index: typing.Optional[int] = None
    organization_id: typing.Optional[str] = None
    input_token_count: typing.Optional[int] = None
    output_token_count: typing.Optional[int] = None
    step_cost: typing.Optional[float] = None

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
