def update_dataset(
        self,
        dataset: Union[FeedbackDataset, RemoteFeedbackDataset],
        fields: Optional[List[str]] = None,
        update_records: Optional[bool] = True,
        overwrite: Optional[bool] = False,
    ) -> Union[FeedbackDataset, RemoteFeedbackDataset]:
        """
        Extract text descriptives metrics from records in a FeedbackDataset
        or RemoteFeedbackDataset, add them as metadata to the records and
        return the updated dataset.

        Args:
            dataset (Union[FeedbackDataset, RemoteFeedbackDataset]): A FeedbackDataset or RemoteFeedbackDataset.
            fields (Optional[List[str]]): A list of fields to extract metrics for. If None, extract metrics for all fields.
            update_records (Optional[bool]): Whether to update the records in the dataset too. Defaults to True.
            overwrite (Optional[bool]): Whether to overwrite existing metadata properties with the same name. Defaults to False.

        Returns:
            Union[FeedbackDataset, RemoteFeedbackDataset]: A FeedbackDataset or RemoteFeedbackDataset with text descriptives metrics added as metadata.

        Examples:
        >>> import argilla_v1 as rg
        >>> from argilla_v1.client.feedback.integrations.textdescriptives import TextDescriptivesExtractor
        >>> dataset = rg.FeedbackDataset(...)
        >>> tde = TextDescriptivesExtractor()
        >>> updated_dataset = tde.update_dataset(dataset)
        """
        # If fields is None, use all fields
        if fields is None:
            fields = [field.name for field in dataset.fields]
        available_fields = [field.name for field in dataset.fields]
        if not all([field in available_fields for field in fields]):
            raise ValueError(f"Fields {fields} are not present in the dataset.")
        # Create metadata properties based on dataframe columns and data types
        dataset = self._create_metadata_property_settings(dataset=dataset, fields=fields, overwrite=overwrite)

        # Update the records in the dataset too
        if update_records:
            metadata_prop_types = {item.name: item.type for item in dataset.metadata_properties}
            records = self.update_records(
                records=dataset.records, fields=fields, overwrite=overwrite, metadata_prop_types=metadata_prop_types
            )
            if isinstance(dataset, RemoteFeedbackDataset):
                dataset.update_records(records)
        return dataset

        Extract text descriptives metrics from records in a FeedbackDataset
        or RemoteFeedbackDataset, add them as metadata to the records and
        return the updated dataset.

        Args:
            dataset (Union[FeedbackDataset, RemoteFeedbackDataset]): A FeedbackDataset or RemoteFeedbackDataset.
            fields (Optional[List[str]]): A list of fields to extract metrics for. If None, extract metrics for all fields.
            update_records (Optional[bool]): Whether to update the records in the dataset too. Defaults to True.
            overwrite (Optional[bool]): Whether to overwrite existing metadata properties with the same name. Defaults to False.

        Returns:
            Union[FeedbackDataset, RemoteFeedbackDataset]: A FeedbackDataset or RemoteFeedbackDataset with text descriptives metrics added as metadata.

        Examples:
        >>> import argilla_v1 as rg
        >>> from argilla_v1.client.feedback.integrations.textdescriptives import TextDescriptivesExtractor
        >>> dataset = rg.FeedbackDataset(...)
        >>> tde = TextDescriptivesExtractor()
        >>> updated_dataset = tde.update_dataset(dataset)
        
argilla-v1/src/argilla_v1/client/feedback/integrations/textdescriptives.py