FAISS.from_documents(docs, embeddings) and Chroma.from_documents(docs, embeddings) result in `AttributeError: data`.
Labels: name: area: embeddings, name: area: vector store, name: auto:bug, name: integration: chroma

### System Info

Platform: local development on MacOS Ventura
Python version: 3.10.12

langchain.__version__: 0.0.288
faiss.__version__: 1.7.4
chromadb.__version__: 0.4.10
openai.__version__: 0.28.0

### Who can help?

@hwchase17

### Information

- [X] The official example notebooks/scripts
- [ ] My own modified scripts

### Related Components

- [ ] LLMs/Chat Models
- [X] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [ ] Document Loaders
- [X] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [ ] Chains
- [ ] Callbacks/Tracing
- [ ] Async

### Reproduction

**Reproducible example**

I tried to reproduce an example from this page: https://python.langchain.com/docs/integrations/vectorstores/faiss

The reproducible example (with path to the file https://github.com/hwchase17/chat-your-data/blob/master/state_of_the_union.txt adjusted) can be found below.

```
from langchain.embeddings.openai import OpenAIEmbeddings
from langchain.text_splitter import CharacterTextSplitter
from langchain.vectorstores import FAISS
from langchain.vectorstores import Chroma
from langchain.document_loaders import TextLoader
import os

# Get documents
loader = TextLoader("../src/data/raw_files/state_of_the_union.txt") # path adjusted
documents = loader.load()
text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
docs = text_splitter.split_documents(documents)

# Prepare embedding function
headers = {"x-api-key": os.environ["OPENAI_API_KEY"]}
embeddings = OpenAIEmbeddings(model="text-embedding-ada-002", headers=headers)

# Try to get vectordb with FAISS
db = FAISS.from_documents(docs, embeddings)

# Try to get vectordb with Chroma
db = Chroma.from_documents(docs, embeddings)
```

**Error**

The problem is, that I get an `AttributeError: data` error for both `db = FAISS.from_documents(docs, embeddings)` and `db = Chroma.from_documents(docs, embeddings)`

The traceback is as follows: 

```
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
File ~/mambaforge/envs/streamlit-chatbot/lib/python3.10/site-packages/openai/openai_object.py:59, in OpenAIObject.__getattr__(self, k)
     58 try:
---> 59     return self[k]
     60 except KeyError as err:

KeyError: 'data'

During handling of the above exception, another exception occurred:

AttributeError                            Traceback (most recent call last)
Cell In[14], line 1
----> 1 db = Chroma.from_documents(docs, embeddings)

File ~/mambaforge/envs/streamlit-chatbot/lib/python3.10/site-packages/langchain/vectorstores/chroma.py:637, in Chroma.from_documents(cls, documents, embedding, ids, collection_name, persist_directory, client_settings, client, collection_metadata, **kwargs)
    635 texts = [doc.page_content for doc in documents]
    636 metadatas = [doc.metadata for doc in documents]
--> 637 return cls.from_texts(
    638     texts=texts,
    639     embedding=embedding,
    640     metadatas=metadatas,
    641     ids=ids,
    642     collection_name=collection_name,
    643     persist_directory=persist_directory,
    644     client_settings=client_settings,
    645     client=client,
    646     collection_metadata=collection_metadata,
    647     **kwargs,
    648 )

File ~/mambaforge/envs/streamlit-chatbot/lib/python3.10/site-packages/langchain/vectorstores/chroma.py:601, in Chroma.from_texts(cls, texts, embedding, metadatas, ids, collection_name, persist_directory, client_settings, client, collection_metadata, **kwargs)
    573 """Create a Chroma vectorstore from a raw documents.
    574 
    575 If a persist_directory is specified, the collection will be persisted there.
   (...)
    590     Chroma: Chroma vectorstore.
    591 """
    592 chroma_collection = cls(
    593     collection_name=collection_name,
    594     embedding_function=embedding,
   (...)
    599     **kwargs,
    600 )
--> 601 chroma_collection.add_texts(texts=texts, metadatas=metadatas, ids=ids)
    602 return chroma_collection

File ~/mambaforge/envs/streamlit-chatbot/lib/python3.10/site-packages/langchain/vectorstores/chroma.py:188, in Chroma.add_texts(self, texts, metadatas, ids, **kwargs)
    186 texts = list(texts)
    187 if self._embedding_function is not None:
--> 188     embeddings = self._embedding_function.embed_documents(texts)
    189 if metadatas:
    190     # fill metadatas with empty dicts if somebody
    191     # did not specify metadata for all texts
    192     length_diff = len(texts) - len(metadatas)

File ~/mambaforge/envs/streamlit-chatbot/lib/python3.10/site-packages/langchain/embeddings/openai.py:483, in OpenAIEmbeddings.embed_documents(self, texts, chunk_size)
    471 """Call out to OpenAI's embedding endpoint for embedding search docs.
    472 
    473 Args:
   (...)
    479     List of embeddings, one for each text.
    480 """
    481 # NOTE: to keep things simple, we assume the list may contain texts longer
    482 #       than the maximum context and use length-safe embedding function.
--> 483 return self._get_len_safe_embeddings(texts, engine=self.deployment)

File ~/mambaforge/envs/streamlit-chatbot/lib/python3.10/site-packages/langchain/embeddings/openai.py:367, in OpenAIEmbeddings._get_len_safe_embeddings(self, texts, engine, chunk_size)
    364     _iter = range(0, len(tokens), _chunk_size)
    366 for i in _iter:
--> 367     response = embed_with_retry(
    368         self,
    369         input=tokens[i : i + _chunk_size],
    370         **self._invocation_params,
    371     )
    372     batched_embeddings.extend(r["embedding"] for r in response["data"])
    374 results: List[List[List[float]]] = [[] for _ in range(len(texts))]

File ~/mambaforge/envs/streamlit-chatbot/lib/python3.10/site-packages/langchain/embeddings/openai.py:107, in embed_with_retry(embeddings, **kwargs)
    104     response = embeddings.client.create(**kwargs)
    105     return _check_response(response, skip_empty=embeddings.skip_empty)
--> 107 return _embed_with_retry(**kwargs)

File ~/mambaforge/envs/streamlit-chatbot/lib/python3.10/site-packages/tenacity/__init__.py:289, in BaseRetrying.wraps.<locals>.wrapped_f(*args, **kw)
    287 @functools.wraps(f)
    288 def wrapped_f(*args: t.Any, **kw: t.Any) -> t.Any:
--> 289     return self(f, *args, **kw)

File ~/mambaforge/envs/streamlit-chatbot/lib/python3.10/site-packages/tenacity/__init__.py:379, in Retrying.__call__(self, fn, *args, **kwargs)
    377 retry_state = RetryCallState(retry_object=self, fn=fn, args=args, kwargs=kwargs)
    378 while True:
--> 379     do = self.iter(retry_state=retry_state)
    380     if isinstance(do, DoAttempt):
    381         try:

File ~/mambaforge/envs/streamlit-chatbot/lib/python3.10/site-packages/tenacity/__init__.py:314, in BaseRetrying.iter(self, retry_state)
    312 is_explicit_retry = fut.failed and isinstance(fut.exception(), TryAgain)
    313 if not (is_explicit_retry or self.retry(retry_state)):
--> 314     return fut.result()
    316 if self.after is not None:
    317     self.after(retry_state)

File ~/mambaforge/envs/streamlit-chatbot/lib/python3.10/concurrent/futures/_base.py:451, in Future.result(self, timeout)
    449     raise CancelledError()
    450 elif self._state == FINISHED:
--> 451     return self.__get_result()
    453 self._condition.wait(timeout)
    455 if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:

File ~/mambaforge/envs/streamlit-chatbot/lib/python3.10/concurrent/futures/_base.py:403, in Future.__get_result(self)
    401 if self._exception:
    402     try:
--> 403         raise self._exception
    404     finally:
    405         # Break a reference cycle with the exception in self._exception
    406         self = None

File ~/mambaforge/envs/streamlit-chatbot/lib/python3.10/site-packages/tenacity/__init__.py:382, in Retrying.__call__(self, fn, *args, **kwargs)
    380 if isinstance(do, DoAttempt):
    381     try:
--> 382         result = fn(*args, **kwargs)
    383     except BaseException:  # noqa: B902
    384         retry_state.set_exception(sys.exc_info())  # type: ignore[arg-type]

File ~/mambaforge/envs/streamlit-chatbot/lib/python3.10/site-packages/langchain/embeddings/openai.py:104, in embed_with_retry.<locals>._embed_with_retry(**kwargs)
    102 @retry_decorator
    103 def _embed_with_retry(**kwargs: Any) -> Any:
--> 104     response = embeddings.client.create(**kwargs)
    105     return _check_response(response, skip_empty=embeddings.skip_empty)

File ~/mambaforge/envs/streamlit-chatbot/lib/python3.10/site-packages/openai/api_resources/embedding.py:38, in Embedding.create(cls, *args, **kwargs)
     35 # If a user specifies base64, we'll just return the encoded string.
     36 # This is only for the default case.
     37 if not user_provided_encoding_format:
---> 38     for data in response.data:
     39 
     40         # If an engine isn't using this optimization, don't do anything
     41         if type(data["embedding"]) == str:
     42             assert_has_numpy()

File ~/mambaforge/envs/streamlit-chatbot/lib/python3.10/site-packages/openai/openai_object.py:61, in OpenAIObject.__getattr__(self, k)
     59     return self[k]
     60 except KeyError as err:
---> 61     raise AttributeError(*err.args)

AttributeError: data
```

### Expected behavior

The function should complete without an error.