# 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 .parameters import Parameters


class ParserResponse(UniversalBaseModel):
    msg_hash: typing.Optional[str] = pydantic.Field(default=None)
    """
    The hash of the messages used to run the activity
    """

    error: typing.Optional[str] = pydantic.Field(default=None)
    """
    The error that occurred during the activity
    """

    duration: float = pydantic.Field()
    """
    The duration of the activity in seconds
    """

    model: typing.Optional[str] = pydantic.Field(default=None)
    """
    The model used to run the activity
    """

    parameters: typing.Optional[Parameters] = pydantic.Field(default=None)
    """
    The parameters used to run the activity
    """

    prompt: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
    """
    The prompt used to run the activity
    """

    completion: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
    """
    The completion used to run the activity
    """

    provider: typing.Optional[str] = pydantic.Field(default=None)
    """
    The provider used to run the activity
    """

    repair_log: typing.Optional[typing.List[typing.Dict[str, str]]] = pydantic.Field(default=None)
    """
    The LLM output's JSON repair log for the activity
    """

    run_id: str = pydantic.Field()
    """
    The Temporal workflow run ID
    """

    workflow_id: str = pydantic.Field()
    """
    The Temporal workflow ID
    """

    extracted_text: str = pydantic.Field()
    """
    The extracted text from the file.
    """

    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
