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

from __future__ import annotations
import pydantic
from pydantic.functional_validators import AfterValidator
from r9s.types import BaseModel
from r9s.utils import validate_const
from typing import Literal
from typing_extensions import Annotated, TypedDict


class ToolChoiceFunctionTypedDict(TypedDict):
    name: str
    r"""Function name to call"""


class ToolChoiceFunction(BaseModel):
    name: str
    r"""Function name to call"""


class ToolChoiceTypedDict(TypedDict):
    r"""Specify specific tool selection"""

    function: ToolChoiceFunctionTypedDict
    type: Literal["function"]
    r"""Tool type"""


class ToolChoice(BaseModel):
    r"""Specify specific tool selection"""

    function: ToolChoiceFunction

    TYPE: Annotated[
        Annotated[Literal["function"], AfterValidator(validate_const("function"))],
        pydantic.Field(alias="type"),
    ] = "function"
    r"""Tool type"""
