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

from __future__ import annotations
import pydantic
from pydantic.functional_validators import AfterValidator
from r9s.types import BaseModel
from r9s.utils import validate_const
from typing import Literal
from typing_extensions import Annotated, TypedDict


MediaType = Literal[
    "image/jpeg",
    "image/png",
    "image/gif",
    "image/webp",
]
r"""MIME type of the image"""


class AnthropicImageSourceBase64TypedDict(TypedDict):
    media_type: MediaType
    r"""MIME type of the image"""
    data: str
    r"""Base64-encoded image data"""
    type: Literal["base64"]


class AnthropicImageSourceBase64(BaseModel):
    media_type: MediaType
    r"""MIME type of the image"""

    data: str
    r"""Base64-encoded image data"""

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