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

from ..core.pydantic_utilities import UniversalBaseModel
import typing
import pydantic
import datetime as dt
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class FactualConsistencyScoreSpan(UniversalBaseModel):
    """
    The factual consistency of the generation.
    """

    type: typing.Literal["fcs"] = "fcs"
    latency_millis: typing.Optional[int] = pydantic.Field(default=None)
    """
    Time taken in milliseconds.
    """

    started_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    When the span started.
    """

    score: typing.Optional[float] = pydantic.Field(default=None)
    """
    The probability that the summary is factually consistent with the results.
    """

    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
