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

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


ChatMessageContentItemTypedDict = TypeAliasType(
    "ChatMessageContentItemTypedDict",
    Union[
        ChatMessageContentItemTextTypedDict,
        ChatMessageContentItemImageTypedDict,
        ChatMessageContentItemAudioTypedDict,
        ChatMessageContentItemVideoTypedDict,
    ],
)


ChatMessageContentItem = Annotated[
    Union[
        Annotated[ChatMessageContentItemText, Tag("text")],
        Annotated[ChatMessageContentItemImage, Tag("image_url")],
        Annotated[ChatMessageContentItemAudio, Tag("input_audio")],
        Annotated[ChatMessageContentItemVideo, Tag("input_video")],
    ],
    Discriminator(lambda m: get_discriminator(m, "type", "type")),
]
