class_docstr: A component for computing Document embeddings using OpenAI 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 AzureOpenAIDocumentEmbedder
  
  doc = Document(content="I love pizza!")
  
  document_embedder = AzureOpenAIDocumentEmbedder()
  
  result = document_embedder.run([doc])
  print(result['documents'][0].embedding)
  
  # [0.017020374536514282, -0.023255806416273117, ...]
  ```
docstr: Create an AzureOpenAITextEmbedder component.
  
  :param azure_endpoint: The endpoint of the deployed model, e.g. `https://example-resource.azure.openai.com/`
  :param api_version: The version of the API to use. Defaults to 2023-05-15
  :param azure_deployment: The deployment of the model, usually the model name.
  :param api_key: The API key to use for authentication.
  :param azure_ad_token: Azure Active Directory token, see https://www.microsoft.com/en-us/security/business/identity-access/microsoft-entra-id
  :param azure_ad_token_provider: A function that returns an Azure Active Directory token, will be invoked
  on every request.
  :param organization: The Organization ID, defaults to `None`. See
  [production best practices](https://platform.openai.com/docs/guides/production-best-practices/setting-up-your-organization).
  :param prefix: A string to add to the beginning of each text.
  :param suffix: A string to add to the end of each text.
  :param batch_size: Number of Documents to encode at once.
  :param progress_bar: Whether to show a progress bar or not. Can be helpful to disable in production deployments
                       to keep the logs clean.
  :param meta_fields_to_embed: List of meta fields that should be embedded along with the Document text.
  :param embedding_separator: Separator used to concatenate the meta fields to the Document text.
code: def __init__(
      self,
      azure_endpoint: Optional[str] = None,
      api_version: Optional[str] = "2023-05-15",
      azure_deployment: str = "text-embedding-ada-002",
      api_key: Optional[str] = None,
      azure_ad_token: Optional[str] = None,
      azure_ad_token_provider: Optional[AzureADTokenProvider] = None,
      organization: Optional[str] = None,
      prefix: str = "",
      suffix: str = "",
      batch_size: int = 32,
      progress_bar: bool = True,
      meta_fields_to_embed: Optional[List[str]] = None,
      embedding_separator: str = "\n",
  ):
      """
      Create an AzureOpenAITextEmbedder component.
  
      :param azure_endpoint: The endpoint of the deployed model, e.g. `https://example-resource.azure.openai.com/`
      :param api_version: The version of the API to use. Defaults to 2023-05-15
      :param azure_deployment: The deployment of the model, usually the model name.
      :param api_key: The API key to use for authentication.
      :param azure_ad_token: Azure Active Directory token, see https://www.microsoft.com/en-us/security/business/identity-access/microsoft-entra-id
      :param azure_ad_token_provider: A function that returns an Azure Active Directory token, will be invoked
      on every request.
      :param organization: The Organization ID, defaults to `None`. See
      [production best practices](https://platform.openai.com/docs/guides/production-best-practices/setting-up-your-organization).
      :param prefix: A string to add to the beginning of each text.
      :param suffix: A string to add to the end of each text.
      :param batch_size: Number of Documents to encode at once.
      :param progress_bar: Whether to show a progress bar or not. Can be helpful to disable in production deployments
                           to keep the logs clean.
      :param meta_fields_to_embed: List of meta fields that should be embedded along with the Document text.
      :param embedding_separator: Separator used to concatenate the meta fields to the Document text.
      """
      # if not provided as a parameter, azure_endpoint is read from the env var AZURE_OPENAI_ENDPOINT
      azure_endpoint = azure_endpoint or os.environ.get(
          "AZURE_OPENAI_ENDPOINT"
      )
      if not azure_endpoint:
          raise ValueError(
              "Please provide an Azure endpoint or set the environment variable AZURE_OPENAI_ENDPOINT."
          )
  
      self.api_version = api_version
      self.azure_endpoint = azure_endpoint
      self.azure_deployment = azure_deployment
      self.organization = organization
      self.prefix = prefix
      self.suffix = suffix
      self.batch_size = batch_size
      self.progress_bar = progress_bar
      self.meta_fields_to_embed = meta_fields_to_embed or []
      self.embedding_separator = embedding_separator
  
      self._client = AzureOpenAI(
          api_version=api_version,
          azure_endpoint=azure_endpoint,
          azure_deployment=azure_deployment,
          api_key=api_key,
          azure_ad_token=azure_ad_token,
          azure_ad_token_provider=azure_ad_token_provider,
          organization=organization,
      )
  
file_path: haystack/haystack/components/embedders/azure_document_embedder.py
imports: import os
  from typing import List, Optional, Dict, Any, Tuple
  from openai.lib.azure import AzureADTokenProvider, AzureOpenAI
  from tqdm import tqdm
  from haystack import component, Document, default_to_dict
label_desc: Use image node_id 1 to create a new AzureOpenAIDocumentEmbedder object  with example: obj = AzureOpenAIDocumentEmbedder(azure_endpoint, api_version, azure_deployment, api_key, azure_ad_token, azure_ad_token_provider, organization, prefix, suffix, batch_size, progress_bar, meta_fields_to_embed, embedding_separator)