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

        Args:
            records (List[Union[FeedbackRecord, RemoteFeedbackRecord]]): A list of FeedbackDataset or RemoteFeedbackDataset records.
            fields (List[str]): A list of fields to extract metrics for. If None, extract metrics for all fields.
            overwrite (Optional[bool]): Whether to overwrite existing metadata properties with the same name. Defaults to False.
            metadata_prop_types (Optional[dict]): A dictionary with the name of the metadata property and the type if needed. Defaults to None.

        Returns:
            List[Union[FeedbackRecord, RemoteFeedbackRecord]]: A list of FeedbackDataset or RemoteFeedbackDataset records with text descriptives metrics added as metadata.

        Examples:
        >>> from argilla_v1.client.feedback.integrations.textdescriptives import TextDescriptivesExtractor
        >>> records = [rg.FeedbackRecord(fields={"text": "This is a test."})]
        >>> tde = TextDescriptivesExtractor()
        >>> updated_records = tde.update_records(records)
        """
        available_fields = set()
        # ensure records are unique and don't update updated indices
        modified_records = []
        for rec in records:
            modified_records.append(rec)
            for key in rec.fields:
                available_fields.add(key)
        if fields is None:
            fields = list(available_fields)
        # Extract text descriptives metrics from records
        extracted_metrics = self._extract_metrics_for_all_fields(modified_records, overwrite=overwrite, fields=fields)
        # If the dataframe doesn't contain any columns, return the original records and log a warning
        if extracted_metrics.shape[1] == 0:
            warnings.warn(
                "No text descriptives metrics were extracted. This could be because the metrics contained NaNs."
            )
            return modified_records
        else:
            # Cast integer and boolean columns to Python native types
            extracted_metrics = self._cast_to_python_types(extracted_metrics)
            # Clean column names
            extracted_metrics.columns = [self._clean_column_name(col) for col in extracted_metrics.columns]
            # Add the metrics to the metadata of the records
            if metadata_prop_types is None:
                modified_records = self._add_text_descriptives_to_metadata(modified_records, extracted_metrics)
            else:
                modified_records = self._add_text_descriptives_to_metadata(
                    modified_records, extracted_metrics, metadata_prop_types
                )
            return modified_records

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

        Args:
            records (List[Union[FeedbackRecord, RemoteFeedbackRecord]]): A list of FeedbackDataset or RemoteFeedbackDataset records.
            fields (List[str]): A list of fields to extract metrics for. If None, extract metrics for all fields.
            overwrite (Optional[bool]): Whether to overwrite existing metadata properties with the same name. Defaults to False.
            metadata_prop_types (Optional[dict]): A dictionary with the name of the metadata property and the type if needed. Defaults to None.

        Returns:
            List[Union[FeedbackRecord, RemoteFeedbackRecord]]: A list of FeedbackDataset or RemoteFeedbackDataset records with text descriptives metrics added as metadata.

        Examples:
        >>> from argilla_v1.client.feedback.integrations.textdescriptives import TextDescriptivesExtractor
        >>> records = [rg.FeedbackRecord(fields={"text": "This is a test."})]
        >>> tde = TextDescriptivesExtractor()
        >>> updated_records = tde.update_records(records)
        
argilla-v1/src/argilla_v1/client/feedback/integrations/textdescriptives.py