# This file was auto-generated by Fern from our API Definition.

from __future__ import annotations
from ..core.pydantic_utilities import UniversalBaseModel
import typing
from ..core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic


class ChatMessageBlocksItem_Image(UniversalBaseModel):
    block_type: typing.Literal["image"] = "image"
    image: typing.Optional[str] = None
    path: typing.Optional[str] = None
    url: typing.Optional[str] = None
    image_mimetype: typing.Optional[str] = None
    detail: typing.Optional[str] = None

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow


class ChatMessageBlocksItem_Text(UniversalBaseModel):
    block_type: typing.Literal["text"] = "text"
    text: str

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow


ChatMessageBlocksItem = typing.Union[ChatMessageBlocksItem_Image, ChatMessageBlocksItem_Text]
