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: Embed a string.
docstr_tok: ["Embed","a","string","."]
code: def run(self, text: str):
      """Embed a string."""
      if not isinstance(text, str):
          raise TypeError(
              "OpenAITextEmbedder expects a string as an input."
              "In case you want to embed a list of Documents, please use the OpenAIDocumentEmbedder."
          )
  
      text_to_embed = self.prefix + text + self.suffix
  
      # copied from OpenAI embedding_utils (https://github.com/openai/openai-python/blob/main/openai/embeddings_utils.py)
      # replace newlines, which can negatively affect performance.
      text_to_embed = text_to_embed.replace("\n", " ")
  
      response = self.client.embeddings.create(
          model=self.model, input=text_to_embed
      )
      meta = {"model": response.model, "usage": dict(response.usage)}
  
      return {"embedding": response.data[0].embedding, "meta": meta}
  
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 4 for calling the OpenAITextEmbedder obj's underlying member method code with example usage: obj.run(text) and returns: dict