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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .engine_type import EngineType


class JobMetadata(UniversalBaseModel):
    """
    Metadata for completed jobs.
    """

    processing_time: typing.Optional[float] = pydantic.Field(default=None)
    """
    Processing time in seconds
    """

    engine_used: typing.Optional[EngineType] = pydantic.Field(default=None)
    """
    Engine used for scraping
    """

    llm_calls: typing.Optional[int] = pydantic.Field(default=None)
    """
    Number of LLM API calls made
    """

    cache_hit: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether result was cached
    """

    field_mappings: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
    """
    Field mapping analysis
    """

    site_analysis: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
    """
    Site analysis 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
