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

from __future__ import annotations
from .reasoningdetailencrypted import (
    ReasoningDetailEncrypted,
    ReasoningDetailEncryptedTypedDict,
)
from .reasoningdetailsummary import (
    ReasoningDetailSummary,
    ReasoningDetailSummaryTypedDict,
)
from .reasoningdetailtext import ReasoningDetailText, ReasoningDetailTextTypedDict
from openrouter.utils import get_discriminator
from pydantic import Discriminator, Tag
from typing import Union
from typing_extensions import Annotated, TypeAliasType


ReasoningDetailUnionTypedDict = TypeAliasType(
    "ReasoningDetailUnionTypedDict",
    Union[
        ReasoningDetailSummaryTypedDict,
        ReasoningDetailEncryptedTypedDict,
        ReasoningDetailTextTypedDict,
    ],
)
r"""Reasoning detail union schema"""


ReasoningDetailUnion = Annotated[
    Union[
        Annotated[ReasoningDetailSummary, Tag("reasoning.summary")],
        Annotated[ReasoningDetailEncrypted, Tag("reasoning.encrypted")],
        Annotated[ReasoningDetailText, Tag("reasoning.text")],
    ],
    Discriminator(lambda m: get_discriminator(m, "type", "type")),
]
r"""Reasoning detail union schema"""
