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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.serialization import FieldMetadata
from ..core.unchecked_base_model import UncheckedBaseModel
from .classifications import Classifications
from .classify_advanced_options import ClassifyAdvancedOptions
from .classify_base_processor import ClassifyBaseProcessor
from .parse_config import ParseConfig


class ClassifyConfig(UncheckedBaseModel):
    base_processor: typing_extensions.Annotated[
        typing.Optional[ClassifyBaseProcessor], FieldMetadata(alias="baseProcessor")
    ] = pydantic.Field(alias="baseProcessor", default=None)
    base_version: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="baseVersion")] = (
        pydantic.Field(alias="baseVersion", default=None)
    )
    """
    The version of the `"classification_performance"` or `"classification_light"` processor to use. If not provided, the latest stable version for the selected `baseProcessor` will be used automatically. See [Classification Changelog](https://docs.extend.ai/2026-02-09/changelog/classification/classification-performance) for more details.
    """

    classifications: Classifications
    classification_rules: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="classificationRules")
    ] = pydantic.Field(alias="classificationRules", default=None)
    """
    Custom rules to guide the classification process in natural language.
    """

    advanced_options: typing_extensions.Annotated[
        typing.Optional[ClassifyAdvancedOptions], FieldMetadata(alias="advancedOptions")
    ] = pydantic.Field(alias="advancedOptions", default=None)
    """
    Advanced configuration options.
    """

    parse_config: typing_extensions.Annotated[typing.Optional[ParseConfig], FieldMetadata(alias="parseConfig")] = (
        pydantic.Field(alias="parseConfig", default=None)
    )
    """
    Configuration options for the parsing process.
    """

    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
