# 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 .worker_config_input_config import WorkerConfigInputConfig
from .worker_config_output_config import WorkerConfigOutputConfig


class WorkerConfig(UniversalBaseModel):
    input_config: WorkerConfigInputConfig = pydantic.Field()
    """
    Input Config
    """

    output_config: typing.Optional[WorkerConfigOutputConfig] = pydantic.Field(default=None)
    """
    Output Config
    """

    num_concurrent_workers: int = pydantic.Field(default=1)
    """
    Number of concurrent workers to spawn for the processor
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow")  # type: ignore # Pydantic v2
    else:

        class Config:
            smart_union = True
            extra = pydantic.Extra.allow
