def delete(name: str, workspace: Optional[str] = None) -> None:
    """
    Deletes an Argilla dataset from the server. It can be used with both `Dataset` and `FeedbackDataset`, although
    for the latter it's recommended to use `rg.FeedbackDataset.delete` instead.

    Args:
        name: The name of the dataset to delete.
        workspace: The workspace to which the dataset belongs. If `None` (default) and the env variable
            ``ARGILLA_WORKSPACE`` is not set, it will default to the private user workspace.

    Raises:
        ValueError: If no dataset is found with the given name and workspace.
        PermissionError: If the dataset that's being deleted is a `FeedbackDataset` and the user doesn't have enough
            permissions to delete it.
        RuntimeError: If the dataset that's being deleted is a `FeedbackDataset` and some kind of error occurs during
            the deletion process.

    Examples:
        >>> import argilla_v1 as rg
        >>> rg.delete(name="example-dataset")
    """
    argilla = ArgillaSingleton.get()
    workspace = workspace or argilla.get_workspace()
    try:
        # `delete` method is always successful, even if the dataset does not exist and that's why we need the extra
        # call to `get_dataset` to check if the dataset exists. If it doesn't exist, then we try to delete a `FeedbackDataset`.
        argilla.get_dataset(name=name, workspace=workspace)
        argilla.delete(name=name, workspace=workspace)
    except errors.ArApiResponseError as e:
        try:
            dataset = FeedbackDataset.from_argilla(name=name, workspace=workspace)
        except ValueError:
            raise e

        dataset.delete()

        warnings.warn(
            "Removed dataset was a `FeedbackDataset`. It's recommended to use "
            f"`rg.FeedbackDataset.from_argilla(name='{name}', workspace='{workspace}').delete()` instead.",
            UserWarning,
            stacklevel=2,
        )

    Deletes an Argilla dataset from the server. It can be used with both `Dataset` and `FeedbackDataset`, although
    for the latter it's recommended to use `rg.FeedbackDataset.delete` instead.

    Args:
        name: The name of the dataset to delete.
        workspace: The workspace to which the dataset belongs. If `None` (default) and the env variable
            ``ARGILLA_WORKSPACE`` is not set, it will default to the private user workspace.

    Raises:
        ValueError: If no dataset is found with the given name and workspace.
        PermissionError: If the dataset that's being deleted is a `FeedbackDataset` and the user doesn't have enough
            permissions to delete it.
        RuntimeError: If the dataset that's being deleted is a `FeedbackDataset` and some kind of error occurs during
            the deletion process.

    Examples:
        >>> import argilla_v1 as rg
        >>> rg.delete(name="example-dataset")
    
argilla-v1/src/argilla_v1/client/api.py