class_docstr: A component for computing Document embeddings using HuggingFace Text-Embeddings-Inference endpoints. This component
  is designed to seamlessly inference models deployed on the Text Embeddings Inference (TEI) backend.
  The embedding of each Document is stored in the `embedding` field of the Document.
  
  You can use this component for embedding models hosted on Hugging Face Inference endpoints, the rate-limited
  Inference API tier:
  
  ```python
  from haystack.dataclasses import Document
  from haystack.components.embedders import HuggingFaceTEIDocumentEmbedder
  
  doc = Document(content="I love pizza!")
  
  document_embedder = HuggingFaceTEIDocumentEmbedder(
      model="BAAI/bge-small-en-v1.5", token="<your-token>"
  )
  
  result = document_embedder.run([doc])
  print(result["documents"][0].embedding)
  
  # [0.017020374536514282, -0.023255806416273117, ...]
  ```
  
  Or for embedding models hosted on paid https://huggingface.co/inference-endpoints endpoint, and/or your own custom
  TEI endpoint. In these two cases, you'll need to provide the URL of the endpoint as well as a valid token:
  
  ```python
  from haystack.dataclasses import Document
  from haystack.components.embedders import HuggingFaceTEIDocumentEmbedder
  
  doc = Document(content="I love pizza!")
  
  document_embedder = HuggingFaceTEIDocumentEmbedder(
      model="BAAI/bge-small-en-v1.5", url="<your-tei-endpoint-url>", token="<your-token>"
  )
  
  result = document_embedder.run([doc])
  print(result["documents"][0].embedding)
  
  # [0.017020374536514282, -0.023255806416273117, ...]
  ```
  
  Key Features and Compatibility:
      - **Primary Compatibility**: Designed to work seamlessly with any embedding model deployed using the TEI
      framework. For more information on TEI, visit https://github.com/huggingface/text-embeddings-inference.
      - **Hugging Face Inference Endpoints**: Supports inference of TEI embedding models deployed on Hugging Face
      Inference endpoints. For more details refer to https://huggingface.co/inference-endpoints.
      - **Inference API Support**: Supports inference of TEI embedding models hosted on the rate-limited Inference
      API tier. Learn more about the Inference API at: https://huggingface.co/inference-api
      Discover available embedding models using the following command:
      ```
      wget -qO- https://api-inference.huggingface.co/framework/sentence-transformers
      ```
      And simply use the model ID as the model parameter for this component. You'll also need to provide a valid
      Hugging Face API token as the token parameter.
      - **Custom TEI Endpoints**: Supports inference of embedding models deployed on custom TEI endpoints. Anyone can
      deploy their own TEI endpoint using the TEI framework. For more details refer
      to https://huggingface.co/inference-endpoints.
class_docstr_tok: ["A","component","for","computing","Document","embeddings","using","HuggingFace","Text-Embeddings-Inference","endpoints",".","This","component","is","designed","to","seamlessly","inference","models","deployed","on","the","Text","Embeddings","Inference","(","TEI",")","backend",".","The","embedding","of","each","Document","is","stored","in","the","`","embedding","`","field","of","the","Document",".","You","can","use","this","component","for","embedding","models","hosted","on","Hugging","Face","Inference","endpoints",",","the","rate-limited","Inference","API","tier",":","``","`","python","from","haystack.dataclasses","import","Document","from","haystack.components.embedders","import","HuggingFaceTEIDocumentEmbedder","doc","=","Document","(","content=","''","I","love","pizza","!","''",")","document_embedder","=","HuggingFaceTEIDocumentEmbedder","(","model=","''","BAAI\/bge-small-en-v1.5","''",",","token=","''","<","your-token",">","''",")","result","=","document_embedder.run","(","[","doc","]",")","print","(","result","[","``","documents","''","]","[","0","]",".embedding",")","#","[","0.017020374536514282",",","-0.023255806416273117",",","...","]","``","`","Or","for","embedding","models","hosted","on","paid","https",":","\/\/huggingface.co\/inference-endpoints","endpoint",",","and\/or","your","own","custom","TEI","endpoint",".","In","these","two","cases",",","you","'ll","need","to","provide","the","URL","of","the","endpoint","as","well","as","a","valid","token",":","``","`","python","from","haystack.dataclasses","import","Document","from","haystack.components.embedders","import","HuggingFaceTEIDocumentEmbedder","doc","=","Document","(","content=","''","I","love","pizza","!","''",")","document_embedder","=","HuggingFaceTEIDocumentEmbedder","(","model=","''","BAAI\/bge-small-en-v1.5","''",",","url=","''","<","your-tei-endpoint-url",">","''",",","token=","''","<","your-token",">","''",")","result","=","document_embedder.run","(","[","doc","]",")","print","(","result","[","``","documents","''","]","[","0","]",".embedding",")","#","[","0.017020374536514282",",","-0.023255806416273117",",","...","]","``","`","Key","Features","and","Compatibility",":","-","*","*","Primary","Compatibility","*","*",":","Designed","to","work","seamlessly","with","any","embedding","model","deployed","using","the","TEI","framework",".","For","more","information","on","TEI",",","visit","https",":","\/\/github.com\/huggingface\/text-embeddings-inference",".","-","*","*","Hugging","Face","Inference","Endpoints","*","*",":","Supports","inference","of","TEI","embedding","models","deployed","on","Hugging","Face","Inference","endpoints",".","For","more","details","refer","to","https",":","\/\/huggingface.co\/inference-endpoints",".","-","*","*","Inference","API","Support","*","*",":","Supports","inference","of","TEI","embedding","models","hosted","on","the","rate-limited","Inference","API","tier",".","Learn","more","about","the","Inference","API","at",":","https",":","\/\/huggingface.co\/inference-api","Discover","available","embedding","models","using","the","following","command",":","``","`","wget","-qO-","https",":","\/\/api-inference.huggingface.co\/framework\/sentence-transformers","``","`","And","simply","use","the","model","ID","as","the","model","parameter","for","this","component",".","You","'ll","also","need","to","provide","a","valid","Hugging","Face","API","token","as","the","token","parameter",".","-","*","*","Custom","TEI","Endpoints","*","*",":","Supports","inference","of","embedding","models","deployed","on","custom","TEI","endpoints",".","Anyone","can","deploy","their","own","TEI","endpoint","using","the","TEI","framework",".","For","more","details","refer","to","https",":","\/\/huggingface.co\/inference-endpoints","."]
docstr: Data that is sent to Posthog for usage analytics.
docstr_tok: ["Data","that","is","sent","to","Posthog","for","usage","analytics","."]
code: def _get_telemetry_data(self) -> Dict[str, Any]:
      """
      Data that is sent to Posthog for usage analytics.
      """
      # Don't send URL as it is sensitive information
      return {"model": self.model}
  
file_path: haystack/haystack/components/embedders/hugging_face_tei_document_embedder.py
imports: import logging
  import os
  from typing import Any, Dict, List, Optional
  from urllib.parse import urlparse
  from tqdm import tqdm
  from haystack import component, default_to_dict
  from haystack.components.embedders.hf_utils import check_valid_model
  from haystack.dataclasses import Document
  from haystack.lazy_imports import LazyImport
label_desc: Use image node_id 3 for calling the HuggingFaceTEIDocumentEmbedder obj's underlying member method code with example usage: obj._get_telemetry_data() and returns: dict