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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel


class RunMetrics(UncheckedBaseModel):
    id: str = pydantic.Field()
    """
    The id of the run this metric belongs to (matches runs.id).
    """

    agent_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The unique identifier of the agent.
    """

    project_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The project that the run belongs to (cloud only).
    """

    run_start_ns: typing.Optional[int] = pydantic.Field(default=None)
    """
    The timestamp of the start of the run in nanoseconds.
    """

    run_ns: typing.Optional[int] = pydantic.Field(default=None)
    """
    Total time for the run in nanoseconds.
    """

    num_steps: typing.Optional[int] = pydantic.Field(default=None)
    """
    The number of steps in the run.
    """

    tools_used: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    List of tool IDs that were used in this run.
    """

    template_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The template ID that the run belongs to (cloud only).
    """

    base_template_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The base template ID that the run belongs to (cloud only).
    """

    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
