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

from __future__ import annotations
from .anthropicimagesourcebase64 import (
    AnthropicImageSourceBase64,
    AnthropicImageSourceBase64TypedDict,
)
from .anthropicimagesourceurl import (
    AnthropicImageSourceURL,
    AnthropicImageSourceURLTypedDict,
)
from pydantic import Discriminator, Tag
from r9s.utils import get_discriminator
from typing import Union
from typing_extensions import Annotated, TypeAliasType


AnthropicImageSourceTypedDict = TypeAliasType(
    "AnthropicImageSourceTypedDict",
    Union[AnthropicImageSourceURLTypedDict, AnthropicImageSourceBase64TypedDict],
)


AnthropicImageSource = Annotated[
    Union[
        Annotated[AnthropicImageSourceBase64, Tag("base64")],
        Annotated[AnthropicImageSourceURL, Tag("url")],
    ],
    Discriminator(lambda m: get_discriminator(m, "type", "type")),
]
