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

from __future__ import annotations
from .imageurl import ImageURL, ImageURLTypedDict
from mistralai.gcp.client.types import BaseModel
from mistralai.gcp.client.utils import validate_const
import pydantic
from pydantic.functional_validators import AfterValidator
from typing import Literal, Union
from typing_extensions import Annotated, TypeAliasType, TypedDict


ImageURLUnionTypedDict = TypeAliasType(
    "ImageURLUnionTypedDict", Union[ImageURLTypedDict, str]
)


ImageURLUnion = TypeAliasType("ImageURLUnion", Union[ImageURL, str])


class ImageURLChunkTypedDict(TypedDict):
    r"""{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,iVBORw0"""

    image_url: ImageURLUnionTypedDict
    type: Literal["image_url"]


class ImageURLChunk(BaseModel):
    r"""{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,iVBORw0"""

    image_url: ImageURLUnion

    type: Annotated[
        Annotated[Literal["image_url"], AfterValidator(validate_const("image_url"))],
        pydantic.Field(alias="type"),
    ] = "image_url"


try:
    ImageURLChunk.model_rebuild()
except NameError:
    pass
