async def create_function_async(
        self,
        *,
        function_name: str,
        routine_definition: str,
        data_type: str,
        full_data_type: str,
        comment: str,
        parameters: Optional[List[Union[FunctionParameterInfo, Dict[str, str]]]] = None,
        properties: Optional[str] = "null",
        timeout: Optional[float] = None,
        replace: bool = False,
    ) -> FunctionInfo:
        """
        Create a function in Unity Catalog asynchronously.

        Args:
            function_name: The full function name in the format <catalog_name>.<schema_name>.<function_name>.
            routine_definition: The function definition.
            data_type: The return data type. Allowed values are:
                "BOOLEAN", "BYTE", "SHORT", "INT", "LONG", "FLOAT", "DOUBLE", "DATE", "TIMESTAMP",
                "TIMESTAMP_NTZ", "STRING", "BINARY", "DECIMAL", "INTERVAL", "ARRAY", "STRUCT",
                "MAP", "CHAR"
            full_data_type: The full return data type, including inner types for collections, i.e.:
                "ARRAY<STRING>". If the return data type is a scalar, this is the same as the 'data_type'
                field.
            comment: The description of the function.
            parameters: The input parameters.
            properties: JSON-serialized key-value pair map encoded as a string.
            timeout: The timeout in seconds.
            replace: Whether to replace the function if it already exists. Defaults to False.

        Returns:
            The created FunctionInfo object.
        """

        validate_function_name_length(function_name=function_name)

        function_name = FullFunctionName.validate_full_function_name(function_name)
        parameters = [validate_input_parameter(param) for param in parameters]
        if data_type not in ALLOWED_DATA_TYPES:
            raise ValueError(
                f"Invalid data_type {data_type}, allowed values are {ALLOWED_DATA_TYPES}."
            )

        try:
            if await self.get_function_async(str(function_name), timeout=timeout):
                if replace:
                    _logger.info(f"Function {function_name} already exists, replacing it.")
                    await self.delete_function_async(str(function_name), timeout=timeout)
                else:
                    raise ValueError(
                        f"Function {function_name} already exists. Set replace=True to overwrite it."
                    )
        except ServiceException:
            pass

        function_info = CreateFunction(
            catalog_name=function_name.catalog,
            schema_name=function_name.schema,
            name=function_name.function,
            specific_name=function_name.function,
            input_params=FunctionParameterInfos(parameters=parameters),
            data_type=data_type,
            full_data_type=full_data_type,
            routine_body="EXTERNAL",
            routine_definition=routine_definition,
            security_type="DEFINER",
            parameter_style="S",
            external_language="PYTHON",
            sql_data_access="NO_SQL",
            is_deterministic=True,
            is_null_call=False,
            properties=properties,
            comment=comment,
        )
        function_request = CreateFunctionRequest(function_info=function_info)
        function_metadata = await self.uc.functions_client.create_function(
            function_request, _request_timeout=timeout
        )
        # NB: Clearing the function cache here only if the function creation is successful
        # to ensure that the cache state is viable and any replacement operations, on next execution,
        # refresh the cache with the new function definition
        if replace:
            self.clear_function_cache()
        return function_metadata

        Create a function in Unity Catalog asynchronously.

        Args:
            function_name: The full function name in the format <catalog_name>.<schema_name>.<function_name>.
            routine_definition: The function definition.
            data_type: The return data type. Allowed values are:
                "BOOLEAN", "BYTE", "SHORT", "INT", "LONG", "FLOAT", "DOUBLE", "DATE", "TIMESTAMP",
                "TIMESTAMP_NTZ", "STRING", "BINARY", "DECIMAL", "INTERVAL", "ARRAY", "STRUCT",
                "MAP", "CHAR"
            full_data_type: The full return data type, including inner types for collections, i.e.:
                "ARRAY<STRING>". If the return data type is a scalar, this is the same as the 'data_type'
                field.
            comment: The description of the function.
            parameters: The input parameters.
            properties: JSON-serialized key-value pair map encoded as a string.
            timeout: The timeout in seconds.
            replace: Whether to replace the function if it already exists. Defaults to False.

        Returns:
            The created FunctionInfo object.
        
ai/core/src/unitycatalog/ai/core/client.py