"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
# @generated-id: f582b26db67b

from __future__ import annotations
from .audiourl import AudioURL, AudioURLTypedDict
from mistralai.client.types import BaseModel
from mistralai.client.utils import validate_const
import pydantic
from pydantic.functional_validators import AfterValidator
from typing import Literal, Union
from typing_extensions import Annotated, TypeAliasType, TypedDict


AudioURLUnionTypedDict = TypeAliasType(
    "AudioURLUnionTypedDict", Union[AudioURLTypedDict, str]
)


AudioURLUnion = TypeAliasType("AudioURLUnion", Union[AudioURL, str])


class AudioURLChunkTypedDict(TypedDict):
    r"""Audio URL chunk.

    Attributes:
    type: The type of the chunk, which is always `ChunkTypes.audio_url`.
    audio_url: The URL of the audio file.
    """

    audio_url: AudioURLUnionTypedDict
    type: Literal["audio_url"]


class AudioURLChunk(BaseModel):
    r"""Audio URL chunk.

    Attributes:
    type: The type of the chunk, which is always `ChunkTypes.audio_url`.
    audio_url: The URL of the audio file.
    """

    audio_url: AudioURLUnion

    type: Annotated[
        Annotated[Literal["audio_url"], AfterValidator(validate_const("audio_url"))],
        pydantic.Field(alias="type"),
    ] = "audio_url"


try:
    AudioURLChunk.model_rebuild()
except NameError:
    pass
