# 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, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .created_at import CreatedAt
from .embedding_data import EmbeddingData
from .embedding_task_media_metadata import EmbeddingTaskMediaMetadata
from .embedding_task_response_status import EmbeddingTaskResponseStatus
from .updated_at import UpdatedAt


class EmbeddingTaskResponse(UniversalBaseModel):
    """
    An object containing the status of the embedding task and the embeddings (when ready).
    """

    id: typing_extensions.Annotated[str, FieldMetadata(alias="_id")] = pydantic.Field()
    """
    The unique identifier of the embedding task.
    """

    status: EmbeddingTaskResponseStatus = pydantic.Field()
    """
    The current status of the task.
    
    
    **Values**:
    - `processing`: The platform is creating the embeddings
    - `ready`: Processing is complete. Embeddings are available in the `data` field
    - `failed`: The task failed. The `data` field is `null`
    """

    created_at: typing.Optional[CreatedAt] = None
    updated_at: typing.Optional[UpdatedAt] = None
    data: typing.Optional[typing.List[EmbeddingData]] = pydantic.Field(default=None)
    """
    An object containing the embedding results, or `null` otherwise.
    """

    metadata: typing.Optional[EmbeddingTaskMediaMetadata] = None

    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
