"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
# @generated-id: 48b4f6f50fe9

from __future__ import annotations
from .function import Function, FunctionTypedDict
from mistralai.client.types import BaseModel, UnrecognizedStr
from mistralai.client.utils import validate_const
import pydantic
from pydantic.functional_validators import AfterValidator
from typing import Literal, Union
from typing_extensions import Annotated, TypedDict


class ToolTypedDict(TypedDict):
    function: FunctionTypedDict
    type: Union[Literal["function"], UnrecognizedStr]


class Tool(BaseModel):
    function: Function

    type: Annotated[
        Annotated[
            Union[Literal["function"], UnrecognizedStr],
            AfterValidator(validate_const("function")),
        ],
        pydantic.Field(alias="type"),
    ] = "function"


try:
    Tool.model_rebuild()
except NameError:
    pass
