class_docstr: A component for computing Document embeddings using Sentence Transformers models.
  The embedding of each Document is stored in the `embedding` field of the Document.
  
  Usage example:
  ```python
  from haystack import Document
  from haystack.components.embedders import SentenceTransformersDocumentEmbedder
  doc = Document(content="I love pizza!")
  doc_embedder = SentenceTransformersDocumentEmbedder()
  doc_embedder.warm_up()
  
  result = doc_embedder.run([doc])
  print(result['documents'][0].embedding)
  
  # [-0.07804739475250244, 0.1498992145061493, ...]
  ```
docstr: Create a SentenceTransformersDocumentEmbedder component.
  
  :param model: Local path or name of the model in Hugging Face's model hub,
      such as ``'sentence-transformers/all-mpnet-base-v2'``.
  :param device: Device (like 'cuda' / 'cpu') that should be used for computation.
      Defaults to CPU.
  :param token: The API token used to download private models from Hugging Face.
      If this parameter is set to `True`, then the token generated when running
      `transformers-cli login` (stored in ~/.huggingface) will be used.
  :param prefix: A string to add to the beginning of each Document text before embedding.
      Can be used to prepend the text with an instruction, as required by some embedding models,
      such as E5 and bge.
  :param suffix: A string to add to the end of each Document text before embedding.
  :param batch_size: Number of strings to encode at once.
  :param progress_bar: If true, displays progress bar during embedding.
  :param normalize_embeddings: If set to true, returned vectors will have length 1.
  :param meta_fields_to_embed: List of meta fields that should be embedded along with the Document content.
  :param embedding_separator: Separator used to concatenate the meta fields to the Document content.
code: def __init__(
      self,
      model: str = "sentence-transformers/all-mpnet-base-v2",
      device: Optional[str] = None,
      token: Union[bool, str, None] = None,
      prefix: str = "",
      suffix: str = "",
      batch_size: int = 32,
      progress_bar: bool = True,
      normalize_embeddings: bool = False,
      meta_fields_to_embed: Optional[List[str]] = None,
      embedding_separator: str = "\n",
  ):
      """
      Create a SentenceTransformersDocumentEmbedder component.
  
      :param model: Local path or name of the model in Hugging Face's model hub,
          such as ``'sentence-transformers/all-mpnet-base-v2'``.
      :param device: Device (like 'cuda' / 'cpu') that should be used for computation.
          Defaults to CPU.
      :param token: The API token used to download private models from Hugging Face.
          If this parameter is set to `True`, then the token generated when running
          `transformers-cli login` (stored in ~/.huggingface) will be used.
      :param prefix: A string to add to the beginning of each Document text before embedding.
          Can be used to prepend the text with an instruction, as required by some embedding models,
          such as E5 and bge.
      :param suffix: A string to add to the end of each Document text before embedding.
      :param batch_size: Number of strings to encode at once.
      :param progress_bar: If true, displays progress bar during embedding.
      :param normalize_embeddings: If set to true, returned vectors will have length 1.
      :param meta_fields_to_embed: List of meta fields that should be embedded along with the Document content.
      :param embedding_separator: Separator used to concatenate the meta fields to the Document content.
      """
  
      self.model = model
      # TODO: remove device parameter and use Haystack's device management once migrated
      self.device = device or "cpu"
      self.token = token
      self.prefix = prefix
      self.suffix = suffix
      self.batch_size = batch_size
      self.progress_bar = progress_bar
      self.normalize_embeddings = normalize_embeddings
      self.meta_fields_to_embed = meta_fields_to_embed or []
      self.embedding_separator = embedding_separator
  
file_path: haystack/haystack/components/embedders/sentence_transformers_document_embedder.py
imports: from typing import List, Optional, Union, Dict, Any
  from haystack import component, Document, default_to_dict
  from haystack.components.embedders.backends.sentence_transformers_backend import _SentenceTransformersEmbeddingBackendFactory
label_desc: Use image node_id 1 to create a new SentenceTransformersDocumentEmbedder object  with example: obj = SentenceTransformersDocumentEmbedder(model, device, token, prefix, suffix, batch_size, progress_bar, normalize_embeddings, meta_fields_to_embed, embedding_separator)