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

from __future__ import annotations

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .embedding_audio_metadata_embedding_scopes_item import EmbeddingAudioMetadataEmbeddingScopesItem
from .embedding_video_metadata_embedding_scopes_item import EmbeddingVideoMetadataEmbeddingScopesItem


class EmbeddingTaskMediaMetadata_Audio(UniversalBaseModel):
    """
    Metadata for the media input.
    """

    input_type: typing.Literal["audio"] = "audio"
    input_url: typing.Optional[str] = None
    input_filename: typing.Optional[str] = None
    embedding_options: typing.List[str]
    embedding_scopes: typing.List[EmbeddingAudioMetadataEmbeddingScopesItem]
    duration: float
    start_offset_sec: typing.Optional[float] = None
    end_offset_sec: typing.Optional[float] = 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


class EmbeddingTaskMediaMetadata_Video(UniversalBaseModel):
    """
    Metadata for the media input.
    """

    input_type: typing.Literal["video"] = "video"
    input_url: typing.Optional[str] = None
    input_filename: typing.Optional[str] = None
    clip_length: typing.Optional[int] = None
    embedding_scopes: typing.List[EmbeddingVideoMetadataEmbeddingScopesItem]
    embedding_options: typing.List[str]
    duration: float
    start_offset_sec: typing.Optional[float] = None
    end_offset_sec: typing.Optional[float] = 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


EmbeddingTaskMediaMetadata = typing.Union[EmbeddingTaskMediaMetadata_Audio, EmbeddingTaskMediaMetadata_Video]
