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

from __future__ import annotations
from .chatcompletioncontentparttextparam import (
    ChatCompletionContentPartTextParam,
    ChatCompletionContentPartTextParamTypedDict,
)
from opperai.types import BaseModel
from opperai.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


ChatCompletionToolMessageParamContentTypedDict = TypeAliasType(
    "ChatCompletionToolMessageParamContentTypedDict",
    Union[str, List[ChatCompletionContentPartTextParamTypedDict]],
)


ChatCompletionToolMessageParamContent = TypeAliasType(
    "ChatCompletionToolMessageParamContent",
    Union[str, List[ChatCompletionContentPartTextParam]],
)


class ChatCompletionToolMessageParamTypedDict(TypedDict):
    content: ChatCompletionToolMessageParamContentTypedDict
    tool_call_id: str
    role: Literal["tool"]


class ChatCompletionToolMessageParam(BaseModel):
    content: ChatCompletionToolMessageParamContent

    tool_call_id: str

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