# 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 .correction_item import CorrectionItem


class HallucinationCorrectionResponse(UniversalBaseModel):
    """
    The response that contains the hallucination correction results.
    """

    corrections: typing.List[CorrectionItem] = pydantic.Field()
    """
    A list of corrections applied to the text, with explanations.
    """

    corrected_text: str = pydantic.Field()
    """
    The revised version of the text, with minimal edits made to correct unsupported or inaccurate statements. If no corrections are needed, this value is identical to the original text.
    """

    model: typing.Optional[str] = pydantic.Field(default=None)
    """
    The name of the model used for hallucination correction.
    """

    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
