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

from __future__ import annotations
from .chatmessagecontentitemaudio import (
    ChatMessageContentItemAudio,
    ChatMessageContentItemAudioTypedDict,
)
from .chatmessagecontentitemfile import (
    ChatMessageContentItemFile,
    ChatMessageContentItemFileTypedDict,
)
from .chatmessagecontentitemimage import (
    ChatMessageContentItemImage,
    ChatMessageContentItemImageTypedDict,
)
from .chatmessagecontentitemtext import (
    ChatMessageContentItemText,
    ChatMessageContentItemTextTypedDict,
)
from .chatmessagecontentitemvideo import (
    ChatMessageContentItemVideo,
    ChatMessageContentItemVideoTypedDict,
)
from .chatmessagecontentitemvideolegacy import (
    ChatMessageContentItemVideoLegacy,
    ChatMessageContentItemVideoLegacyTypedDict,
)
from openrouter.utils import get_discriminator
from pydantic import Discriminator, Tag
from typing import Union
from typing_extensions import Annotated, TypeAliasType


ChatMessageContentItem1TypedDict = TypeAliasType(
    "ChatMessageContentItem1TypedDict",
    Union[
        ChatMessageContentItemVideoLegacyTypedDict, ChatMessageContentItemVideoTypedDict
    ],
)


ChatMessageContentItem1 = Annotated[
    Union[
        Annotated[ChatMessageContentItemVideoLegacy, Tag("input_video")],
        Annotated[ChatMessageContentItemVideo, Tag("video_url")],
    ],
    Discriminator(lambda m: get_discriminator(m, "type", "type")),
]


ChatMessageContentItemTypedDict = TypeAliasType(
    "ChatMessageContentItemTypedDict",
    Union[
        ChatMessageContentItemImageTypedDict,
        ChatMessageContentItemAudioTypedDict,
        ChatMessageContentItemFileTypedDict,
        ChatMessageContentItemTextTypedDict,
        ChatMessageContentItem1TypedDict,
    ],
)
r"""Content part for chat completion messages"""


ChatMessageContentItem = TypeAliasType(
    "ChatMessageContentItem",
    Union[
        ChatMessageContentItemImage,
        ChatMessageContentItemAudio,
        ChatMessageContentItemFile,
        ChatMessageContentItemText,
        ChatMessageContentItem1,
    ],
)
r"""Content part for chat completion messages"""
