class_docstr: This class extracts a number of basic text descriptives from FeedbackDataset
  records using the TextDescriptives library and adds them as record metadata.
docstr: Update the dataset by encoding fields with vectors.
  
  Args:
      dataset (Union[FeedbackDataset, RemoteFeedbackDataset]): The dataset to update.
      fields (Optional[List[str]]): The fields to update. If None, use all available fields.
      update_records (bool): Whether to update the records with vectors. Defaults to True.
      overwrite (bool): Whether to overwrite existing vectors. Defaults to False.
      **kwargs: Additional keyword arguments for encoding with sentence-transformers.
  
  Returns:
      Union[FeedbackDataset, RemoteFeedbackDataset]: The updated dataset.
  
  Examples:
  >>> import argilla as rg
  >>> from argilla.client.feedback.integrations.sentencetransformers import SentenceTransformersExtractor
  >>> dataset = rg.FeedbackDataset(...)
  >>> tde = SentenceTransformersExtractor()
  >>> updated_dataset = tde.update_dataset(dataset)
docstr_tok: ["Update","the","dataset","by","encoding","fields","with","vectors",".","Args",":","dataset","(","Union","[","FeedbackDataset",",","RemoteFeedbackDataset","]",")",":","The","dataset","to","update",".","fields","(","Optional","[","List","[","str","]","]",")",":","The","fields","to","update",".","If","None",",","use","all","available","fields",".","update_records","(","bool",")",":","Whether","to","update","the","records","with","vectors",".","Defaults","to","True",".","overwrite","(","bool",")",":","Whether","to","overwrite","existing","vectors",".","Defaults","to","False",".","*","*","kwargs",":","Additional","keyword","arguments","for","encoding","with","sentence-transformers",".","Returns",":","Union","[","FeedbackDataset",",","RemoteFeedbackDataset","]",":","The","updated","dataset",".","Examples",":",">",">",">","import","argilla","as","rg",">",">",">","from","argilla.client.feedback.integrations.sentencetransformers","import","SentenceTransformersExtractor",">",">",">","dataset","=","rg.FeedbackDataset","(","...",")",">",">",">","tde","=","SentenceTransformersExtractor","(",")",">",">",">","updated_dataset","=","tde.update_dataset","(","dataset",")"]
code: def update_dataset(
      self,
      dataset: Union[FeedbackDataset, RemoteFeedbackDataset],
      fields: Optional[List[str]] = None,
      update_records: Optional[bool] = True,
      overwrite: Optional[bool] = False,
      **kwargs,
  ) -> Union[FeedbackDataset, RemoteFeedbackDataset]:
      """
      Update the dataset by encoding fields with vectors.
  
      Args:
          dataset (Union[FeedbackDataset, RemoteFeedbackDataset]): The dataset to update.
          fields (Optional[List[str]]): The fields to update. If None, use all available fields.
          update_records (bool): Whether to update the records with vectors. Defaults to True.
          overwrite (bool): Whether to overwrite existing vectors. Defaults to False.
          **kwargs: Additional keyword arguments for encoding with sentence-transformers.
  
      Returns:
          Union[FeedbackDataset, RemoteFeedbackDataset]: The updated dataset.
  
      Examples:
      >>> import argilla as rg
      >>> from argilla.client.feedback.integrations.sentencetransformers import SentenceTransformersExtractor
      >>> dataset = rg.FeedbackDataset(...)
      >>> tde = SentenceTransformersExtractor()
      >>> 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."
          )
  
      dataset = self._create_vector_settings(
          dataset=dataset, fields=fields, overwrite=overwrite
      )
  
      if update_records:
          records = self.update_records(
              records=dataset.records,
              fields=fields,
              overwrite=overwrite,
              **kwargs,
          )
          if isinstance(dataset, RemoteFeedbackDataset):
              dataset.update_records(records)
      return dataset
  
file_path: argilla/src/argilla/client/feedback/integrations/sentencetransformers.py
imports: import warnings
  from typing import List, Optional, Union
  from argilla.client.feedback.dataset.local.dataset import FeedbackDataset
  from argilla.client.feedback.dataset.remote.dataset import RemoteFeedbackDataset
  from argilla.client.feedback.schemas.records import FeedbackRecord
  from argilla.client.feedback.schemas.remote.records import RemoteFeedbackRecord
  from argilla.client.feedback.schemas.vector_settings import VectorSettings
  from argilla.utils.dependency import require_dependencies
label_desc: Use image node_id 5 for calling the SentenceTransformersExtractor obj's underlying member method code with example usage: obj.update_dataset(dataset, fields, update_records, overwrite) and returns: dataset