# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel


class FunctionTool(UniversalBaseModel):
    """
    Custom function tool definition.

    Parameters are passed through to the provider as-is (arbitrary JSON object).
    We validate it's a JSON object but don't restrict the schema structure.
    """

    name: str = pydantic.Field()
    """
    Function name (alphanumeric and underscores, max 64 chars)
    """

    description: typing.Optional[str] = pydantic.Field(default=None)
    """
    What the function does (max 1024 chars)
    """

    parameters: typing.Dict[str, typing.Any] = pydantic.Field()
    """
    JSON object defining function parameters (passed through to provider)
    """

    strict: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Request strict parameter validation from provider
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
