"""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, Union
from typing_extensions import Annotated, TypeAliasType, TypedDict


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


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


class ToolResponseMessageTypedDict(TypedDict):
    content: ToolResponseMessageContentTypedDict
    tool_call_id: str
    role: Literal["tool"]


class ToolResponseMessage(BaseModel):
    content: ToolResponseMessageContent

    tool_call_id: str

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