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

from __future__ import annotations
from .chatmessagecontentitem import (
    ChatMessageContentItem,
    ChatMessageContentItemTypedDict,
)
from openrouter.types import BaseModel
from openrouter.utils import validate_const
import pydantic
from pydantic.functional_validators import AfterValidator
from typing import List, Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict


UserMessageContentTypedDict = TypeAliasType(
    "UserMessageContentTypedDict", Union[str, List[ChatMessageContentItemTypedDict]]
)


UserMessageContent = TypeAliasType(
    "UserMessageContent", Union[str, List[ChatMessageContentItem]]
)


class UserMessageTypedDict(TypedDict):
    content: UserMessageContentTypedDict
    role: Literal["user"]
    name: NotRequired[str]


class UserMessage(BaseModel):
    content: UserMessageContent

    ROLE: Annotated[
        Annotated[Literal["user"], AfterValidator(validate_const("user"))],
        pydantic.Field(alias="role"),
    ] = "user"

    name: Optional[str] = None
