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

from __future__ import annotations
from .responseinputaudio import ResponseInputAudio, ResponseInputAudioTypedDict
from .responseinputfile import ResponseInputFile, ResponseInputFileTypedDict
from .responseinputimage import ResponseInputImage, ResponseInputImageTypedDict
from .responseinputtext import ResponseInputText, ResponseInputTextTypedDict
from openrouter.types import BaseModel
from openrouter.utils import get_discriminator
from pydantic import Discriminator, Tag
from typing import List, Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict


OpenResponsesEasyInputMessageType = Literal["message",]


OpenResponsesEasyInputMessageRoleDeveloper = Literal["developer",]


OpenResponsesEasyInputMessageRoleAssistant = Literal["assistant",]


OpenResponsesEasyInputMessageRoleSystem = Literal["system",]


OpenResponsesEasyInputMessageRoleUser = Literal["user",]


OpenResponsesEasyInputMessageRoleUnionTypedDict = TypeAliasType(
    "OpenResponsesEasyInputMessageRoleUnionTypedDict",
    Union[
        OpenResponsesEasyInputMessageRoleUser,
        OpenResponsesEasyInputMessageRoleSystem,
        OpenResponsesEasyInputMessageRoleAssistant,
        OpenResponsesEasyInputMessageRoleDeveloper,
    ],
)


OpenResponsesEasyInputMessageRoleUnion = TypeAliasType(
    "OpenResponsesEasyInputMessageRoleUnion",
    Union[
        OpenResponsesEasyInputMessageRoleUser,
        OpenResponsesEasyInputMessageRoleSystem,
        OpenResponsesEasyInputMessageRoleAssistant,
        OpenResponsesEasyInputMessageRoleDeveloper,
    ],
)


OpenResponsesEasyInputMessageContent1TypedDict = TypeAliasType(
    "OpenResponsesEasyInputMessageContent1TypedDict",
    Union[
        ResponseInputTextTypedDict,
        ResponseInputAudioTypedDict,
        ResponseInputImageTypedDict,
        ResponseInputFileTypedDict,
    ],
)


OpenResponsesEasyInputMessageContent1 = Annotated[
    Union[
        Annotated[ResponseInputText, Tag("input_text")],
        Annotated[ResponseInputImage, Tag("input_image")],
        Annotated[ResponseInputFile, Tag("input_file")],
        Annotated[ResponseInputAudio, Tag("input_audio")],
    ],
    Discriminator(lambda m: get_discriminator(m, "type", "type")),
]


OpenResponsesEasyInputMessageContent2TypedDict = TypeAliasType(
    "OpenResponsesEasyInputMessageContent2TypedDict",
    Union[List[OpenResponsesEasyInputMessageContent1TypedDict], str],
)


OpenResponsesEasyInputMessageContent2 = TypeAliasType(
    "OpenResponsesEasyInputMessageContent2",
    Union[List[OpenResponsesEasyInputMessageContent1], str],
)


class OpenResponsesEasyInputMessageTypedDict(TypedDict):
    role: OpenResponsesEasyInputMessageRoleUnionTypedDict
    content: OpenResponsesEasyInputMessageContent2TypedDict
    type: NotRequired[OpenResponsesEasyInputMessageType]


class OpenResponsesEasyInputMessage(BaseModel):
    role: OpenResponsesEasyInputMessageRoleUnion

    content: OpenResponsesEasyInputMessageContent2

    type: Optional[OpenResponsesEasyInputMessageType] = None
