def uc_function_to_litellm_tool(
        *,
        client: Optional[BaseFunctionClient] = None,
        function_name: Optional[str] = None,
        function_info: Optional[Any] = None,
        filter_accessible_functions: bool = False,
    ) -> Optional[dict]:
        """
        Converts a Unity Catalog function to an Lite LLM tool definition.

        Args:
            client (Optional[BaseFunctionClient]): The client for managing functions.
            function_name (Optional[str]): The full name of the function in 'catalog.schema.function' format.
            function_info (Optional[Any]): The function info object returned by the client.

        Returns:
            Dict: The corresponding Lite LLM tool definition.
        """
        if function_name and function_info:
            raise ValueError("Only one of function_name or function_info should be provided.")
        client = validate_or_set_default_client(client)

        if function_name:
            try:
                function_info = client.get_function(function_name)
            except PermissionError as e:
                _logger.info(f"Skipping {function_name} due to permission errors.")
                if filter_accessible_functions:
                    return None
                raise e
        elif function_info:
            function_name = function_info.full_name
        else:
            raise ValueError("Either function_name or function_info should be provided.")

        generated_model = generate_function_input_params_schema(function_info).pydantic_model

        if generated_model == BaseModel:
            # NB: Pydantic BaseModel.schema(), which is used by LiteLLM, requires a subclass
            # of BaseClass. When function_info.input_params is None, we return a BaseModel as the
            # pydantic_model
            _BaseModelWrapper = type("BaseModelWrapper", (generated_model,), {})

            generated_model = _BaseModelWrapper

        tool = pydantic_function_tool(
            model=generated_model,
            name=get_tool_name(function_name),
            description=function_info.comment or "",
        )

        return dict(
            name=get_tool_name(function_name),
            description=function_info.comment or "",
            tool=tool,
        )

        Converts a Unity Catalog function to an Lite LLM tool definition.

        Args:
            client (Optional[BaseFunctionClient]): The client for managing functions.
            function_name (Optional[str]): The full name of the function in 'catalog.schema.function' format.
            function_info (Optional[Any]): The function info object returned by the client.

        Returns:
            Dict: The corresponding Lite LLM tool definition.
        
ai/integrations/litellm/src/unitycatalog/ai/litellm/toolkit.py