def execute_function(
        self, function_name: str, parameters: Optional[Dict[str, Any]] = None, **kwargs: Any
    ) -> FunctionExecutionResult:
        """
        Execute a UC function by name with the given parameters.

        Args:
            function_name: The name of the function to execute.
            parameters: The parameters to pass to the function. Defaults to None.
            kwargs: additional key-value pairs to include when executing the function.

        Returns:
            FunctionExecutionResult: The result of executing the function.
        """
        with self._lock:
            function_info = self.get_function(function_name, **kwargs)
            parameters = parameters or {}
            self.validate_input_params(function_info.input_params, parameters)

            if kwargs.get("enable_retriever_tracing", False) and has_retriever_signature(
                function_info
            ):
                return _execute_uc_function_with_retriever_tracing(
                    self._execute_uc_function, function_info, parameters, **kwargs
                )

            return self._execute_uc_function(function_info, parameters, **kwargs)

        Execute a UC function by name with the given parameters.

        Args:
            function_name: The name of the function to execute.
            parameters: The parameters to pass to the function. Defaults to None.
            kwargs: additional key-value pairs to include when executing the function.

        Returns:
            FunctionExecutionResult: The result of executing the function.
        
ai/core/src/unitycatalog/ai/core/base.py