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

from __future__ import annotations
from .anthropictoolresultcontent import (
    AnthropicToolResultContent,
    AnthropicToolResultContentTypedDict,
)
from .anthropictoolusecontent import (
    AnthropicToolUseContent,
    AnthropicToolUseContentTypedDict,
)
from pydantic import Discriminator, Tag
from r9s.utils import get_discriminator
from typing import Union
from typing_extensions import Annotated, TypeAliasType


AnthropicToolContentTypedDict = TypeAliasType(
    "AnthropicToolContentTypedDict",
    Union[AnthropicToolResultContentTypedDict, AnthropicToolUseContentTypedDict],
)


AnthropicToolContent = Annotated[
    Union[
        Annotated[AnthropicToolUseContent, Tag("tool_use")],
        Annotated[AnthropicToolResultContent, Tag("tool_result")],
    ],
    Discriminator(lambda m: get_discriminator(m, "type", "type")),
]
