class_docstr: A component for embedding strings using OpenAI models.
  
  Usage example:
  ```python
  from haystack.components.embedders import OpenAITextEmbedder
  
  text_to_embed = "I love pizza!"
  
  text_embedder = OpenAITextEmbedder()
  
  print(text_embedder.run(text_to_embed))
  
  # {'embedding': [0.017020374536514282, -0.023255806416273117, ...],
  # 'meta': {'model': 'text-embedding-ada-002-v2',
  #          'usage': {'prompt_tokens': 4, 'total_tokens': 4}}}
  ```
docstr: This method overrides the default serializer in order to avoid leaking the `api_key` value passed
  to the constructor.
docstr_tok: ["This","method","overrides","the","default","serializer","in","order","to","avoid","leaking","the","`","api_key","`","value","passed","to","the","constructor","."]
code: def to_dict(self) -> Dict[str, Any]:
      """
      This method overrides the default serializer in order to avoid leaking the `api_key` value passed
      to the constructor.
      """
  
      return default_to_dict(
          self,
          model=self.model,
          organization=self.organization,
          prefix=self.prefix,
          suffix=self.suffix,
      )
  
imports: from typing import List, Optional, Dict, Any
  from openai import OpenAI
  from haystack import component, default_to_dict
label_desc: Use image node_id 3 for calling the OpenAITextEmbedder obj's underlying member method code with example usage: obj.to_dict() and returns: default_to_dict