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

import typing

import typing_extensions
from ..core.serialization import FieldMetadata
from ..types.json_object import JsonObject
from ..types.legacy_extraction_config_base_processor import LegacyExtractionConfigBaseProcessor
from .legacy_extraction_advanced_options import LegacyExtractionAdvancedOptionsParams
from .legacy_extraction_field import LegacyExtractionFieldParams
from .parse_config import ParseConfigParams


class LegacyExtractionConfigParams(typing_extensions.TypedDict):
    base_processor: typing_extensions.NotRequired[
        typing_extensions.Annotated[LegacyExtractionConfigBaseProcessor, FieldMetadata(alias="baseProcessor")]
    ]
    """
    The base processor to use. For extractors, this must be either `"extraction_performance"` or `"extraction_light"`. See [Extraction Changelog](/changelog/extraction/extraction-performance) for more details.
    """

    base_version: typing_extensions.NotRequired[typing_extensions.Annotated[str, FieldMetadata(alias="baseVersion")]]
    """
    The version of the `"extraction_performance"` or `"extraction_light"` processor to use. If this is provided, the `baseProcessor` must also be provided. See [Extraction Changelog](/changelog/extraction/extraction-performance) for more details.
    """

    extraction_rules: typing_extensions.NotRequired[
        typing_extensions.Annotated[str, FieldMetadata(alias="extractionRules")]
    ]
    """
    Custom rules to guide the extraction process in natural language.
    """

    schema: typing_extensions.NotRequired[JsonObject]
    """
    JSON Schema definition of the data to extract. Either `fields` or `schema` must be provided.
    
    See the [JSON Schema guide](/product/extraction/schema/json-schema) for details and examples of schema configuration.
    """

    fields: typing_extensions.NotRequired[typing.Sequence[LegacyExtractionFieldParams]]
    """
    Array of fields to extract from the document. Either `fields` or `schema` must be provided.
    
    We recommend using `schema` for new implementations.
    """

    advanced_options: typing_extensions.NotRequired[
        typing_extensions.Annotated[LegacyExtractionAdvancedOptionsParams, FieldMetadata(alias="advancedOptions")]
    ]
    """
    Advanced configuration options.
    """

    parser: typing_extensions.NotRequired[ParseConfigParams]
    """
    Configuration options for the parsing process.
    """
