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: Embed a list of Documents.
  The embedding of each Document is stored in the `embedding` field of the Document.
code: def run(self, documents: List[Document]):
      """
      Embed a list of Documents.
      The embedding of each Document is stored in the `embedding` field of the Document.
      """
      if (
          not isinstance(documents, list)
          or documents
          and not isinstance(documents[0], Document)
      ):
          raise TypeError(
              "SentenceTransformersDocumentEmbedder expects a list of Documents as input."
              "In case you want to embed a list of strings, please use the SentenceTransformersTextEmbedder."
          )
      if not hasattr(self, "embedding_backend"):
          raise RuntimeError(
              "The embedding model has not been loaded. Please call warm_up() before running."
          )
  
      # TODO: once non textual Documents are properly supported, we should also prepare them for embedding here
  
      texts_to_embed = []
      for doc in documents:
          meta_values_to_embed = [
              str(doc.meta[key])
              for key in self.meta_fields_to_embed
              if key in doc.meta and doc.meta[key]
          ]
          text_to_embed = (
              self.prefix
              + self.embedding_separator.join(
                  meta_values_to_embed + [doc.content or ""]
              )
              + self.suffix
          )
          texts_to_embed.append(text_to_embed)
  
      embeddings = self.embedding_backend.embed(
          texts_to_embed,
          batch_size=self.batch_size,
          show_progress_bar=self.progress_bar,
          normalize_embeddings=self.normalize_embeddings,
      )
  
      for doc, emb in zip(documents, embeddings):
          doc.embedding = emb
  
      return {"documents": documents}
  
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 5 for calling the SentenceTransformersDocumentEmbedder obj's underlying member method code with example usage: obj.run(documents) and returns: dict