def list_datasets(
    workspace: Optional[str] = None, type: Optional[Union[str, DatasetType]] = None
) -> List[Union[DatasetModel, "RemoteFeedbackDataset"]]:
    """Lists all the available datasets for the current user in Argilla.

    Args:
        workspace: If provided, list datasets from that workspace only. Note that
            the workspace must exist in advance, otherwise a HTTP 400 error will be
            raised.

    Returns:
        A list of `DatasetModel` objects, containing the dataset
        attributes: tags, metadata, name, id, task, owner, workspace, created_at,
        and last_updated.
    """
    if type is not None:
        type = type if isinstance(type, DatasetType) else DatasetType(type)

    old_datasets = []
    if type is None or type == DatasetType.other:
        old_datasets = ArgillaSingleton.get().list_datasets(workspace=workspace)

    datasets = []
    if type is None or type == DatasetType.feedback:
        datasets = FeedbackDataset.list(workspace=workspace)

    return old_datasets + datasets
Lists all the available datasets for the current user in Argilla.

    Args:
        workspace: If provided, list datasets from that workspace only. Note that
            the workspace must exist in advance, otherwise a HTTP 400 error will be
            raised.

    Returns:
        A list of `DatasetModel` objects, containing the dataset
        attributes: tags, metadata, name, id, task, owner, workspace, created_at,
        and last_updated.
    
argilla-v1/src/argilla_v1/client/api.py