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

from __future__ import annotations
from .imageurlchunk import ImageURLChunk, ImageURLChunkTypedDict
from .textchunk import TextChunk, TextChunkTypedDict
from mistralai.utils import get_discriminator
from pydantic import Discriminator, Tag
from typing import Union
from typing_extensions import Annotated


ContentChunkTypedDict = Union[TextChunkTypedDict, ImageURLChunkTypedDict]


ContentChunk = Annotated[
    Union[
        Annotated[ImageURLChunk, Tag("image_url")], Annotated[TextChunk, Tag("text")]
    ],
    Discriminator(lambda m: get_discriminator(m, "type", "type")),
]
