# 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 .extract_action_data import ExtractActionData
from .extract_action_extract_schema import ExtractActionExtractSchema


class ExtractAction(UniversalBaseModel):
    """
    Extract data action parameters.
    """

    prompt: typing.Optional[str] = pydantic.Field(default=None)
    """
    Extraction prompt
    """

    extract_schema: typing.Optional[ExtractActionExtractSchema] = pydantic.Field(default=None)
    """
    Schema for extraction
    """

    error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = pydantic.Field(default=None)
    """
    Error code mapping for extraction
    """

    intention: typing.Optional[str] = pydantic.Field(default=None)
    """
    The intention or goal of the extraction
    """

    data: typing.Optional[ExtractActionData] = pydantic.Field(default=None)
    """
    Additional context data
    """

    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
