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

from __future__ import annotations
from .anthropicdocumentsourcebase64 import (
    AnthropicDocumentSourceBase64,
    AnthropicDocumentSourceBase64TypedDict,
)
from .anthropicdocumentsourceurl import (
    AnthropicDocumentSourceURL,
    AnthropicDocumentSourceURLTypedDict,
)
from pydantic import Discriminator, Tag
from r9s.utils import get_discriminator
from typing import Union
from typing_extensions import Annotated, TypeAliasType


AnthropicDocumentSourceTypedDict = TypeAliasType(
    "AnthropicDocumentSourceTypedDict",
    Union[AnthropicDocumentSourceURLTypedDict, AnthropicDocumentSourceBase64TypedDict],
)


AnthropicDocumentSource = Annotated[
    Union[
        Annotated[AnthropicDocumentSourceBase64, Tag("base64")],
        Annotated[AnthropicDocumentSourceURL, Tag("url")],
    ],
    Discriminator(lambda m: get_discriminator(m, "type", "type")),
]
