"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from .chatcontentaudio import ChatContentAudio, ChatContentAudioTypedDict
from .chatcontentfile import ChatContentFile, ChatContentFileTypedDict
from .chatcontentimage import ChatContentImage, ChatContentImageTypedDict
from .chatcontenttext import ChatContentText, ChatContentTextTypedDict
from .chatcontentvideo import ChatContentVideo, ChatContentVideoTypedDict
from .legacy_chatcontentvideo import (
    LegacyChatContentVideo,
    LegacyChatContentVideoTypedDict,
)
from openrouter.utils import get_discriminator
from pydantic import Discriminator, Tag
from typing import Union
from typing_extensions import Annotated, TypeAliasType


ChatContentItems1TypedDict = TypeAliasType(
    "ChatContentItems1TypedDict",
    Union[LegacyChatContentVideoTypedDict, ChatContentVideoTypedDict],
)


ChatContentItems1 = Annotated[
    Union[
        Annotated[LegacyChatContentVideo, Tag("input_video")],
        Annotated[ChatContentVideo, Tag("video_url")],
    ],
    Discriminator(lambda m: get_discriminator(m, "type", "type")),
]


ChatContentItemsTypedDict = TypeAliasType(
    "ChatContentItemsTypedDict",
    Union[
        ChatContentImageTypedDict,
        ChatContentAudioTypedDict,
        ChatContentFileTypedDict,
        ChatContentTextTypedDict,
        ChatContentItems1TypedDict,
    ],
)
r"""Content part for chat completion messages"""


ChatContentItems = TypeAliasType(
    "ChatContentItems",
    Union[
        ChatContentImage,
        ChatContentAudio,
        ChatContentFile,
        ChatContentText,
        ChatContentItems1,
    ],
)
r"""Content part for chat completion messages"""
