Must provide an 'engine' or 'deployment_id' parameter to create a <class 'openai.api_resources.embedding.Embedding'>
Labels: name: area: embeddings, name: auto:bug

### System Info

I am getting an error on FAISS.from_documents(). "openai.error.InvalidRequestError: Must provide an 'engine' or 'deployment_id' parameter to create a <class 'openai.api_resources.embedding.Embedding'>" I tried everything and did they change something recently? This code worked fine and now it doesn't not sure what has changed. I used Chroma.from_documents as well and I still get the same error.

```
openai.api_type = "azure"
openai.api_version = os.environ["OPENAI_API_VERSION"]
openai.api_base = os.environ["OPENAI_API_BASE"]
openai.api_key = os.environ["OPENAI_API_KEY"]

bot.gpt_turbo = Model_LLM(OPENAI_DEPLOYMENT_NAME).model

embeddings = OpenAIEmbeddings(model=OPENAI_EMBEDDING_MODEL_NAME)

fileLoaded = FileLoader("Data/filename.pdf", TokenTextSplitter(chunk_size=1000, chunk_overlap=1))

text = fileLoaded.load_file()
#vectorStore = Chroma.from_documents(text,embedding=embeddings)
vectorStore = FAISS.from_documents(text,embedding=embeddings)

qa = RetrievalEngine(llm=bot.gpt_turbo, retriever=vectorStore.as_retriever(),chain_type="stuff")

#query = "Please give me the list of sampleID"

while True:
    askQuestion  = input("Ask me a question about the file?: ")
    print(qa.initialize_qa_engine().run(askQuestion))


#Class Code

import os
from langchain.chains import RetrievalQA, ConversationalRetrievalChain
from langchain.chat_models import AzureChatOpenAI
from langchain.document_loaders import Docx2txtLoader, PyPDFLoader, CSVLoader, UnstructuredFileLoader


class Model_LLM:
    def __init__(self, deployment_name):
        self.model = AzureChatOpenAI(deployment_name=deployment_name)

class FileLoader:
    def __init__(self, file, text_splitter):
        self.file = file
        self.text_splitter = text_splitter
        self._ext = os.path.splitext(self.file)[-1].lower()

    def load_file(self):
        if self._ext in ['.docx', '.doc']:
            return self._call_file_loader(Docx2txtLoader)
        elif self._ext == '.pdf':
            return self._call_file_loader(PyPDFLoader)
        elif self._ext in ['.csv']:
            return self._call_file_loader(CSVLoader)
        #elif self._ext in ['.json']:
            #return self._call_file_loader(JSONLoader)
        elif self._ext in ['.txt', '.json']:
            return self._call_file_loader(UnstructuredFileLoader)
        else:
            return []

    def _call_file_loader(self, loader_class):

        loader = loader_class(self.file)
        _text  = loader.load_and_split(text_splitter=self.text_splitter)
        #documents = loader.load()
        #_text = self.text_splitter.split_documents(documents)

        return _text


class RetrievalEngine:
    def __init__(self, llm, retriever, chain_type='stuff', max_tokens=500):
        self.llm = llm
        self.retriever = retriever
        self.chain_type = chain_type
        self.max_tokens = max_tokens

    def initialize_qa_engine(self):
        return RetrievalQA.from_chain_type(llm=self.llm,
                                                           chain_type=self.chain_type,
                                                           retriever=self.retriever,
                                                           return_source_documents=False)

    def initialize_chat_engine(self):
        return ConversationalRetrievalChain.from_llm(self.llm,
                                                     retriever=self.retriever,
                                                     max_tokens_limit=self.max_tokens)

```

### Who can help?

_No response_

### Information

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

### Related Components

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

### Reproduction

```
Traceback (most recent call last):
  File "C:\Users\spate246\source\repos\Assay-Development\Azure_OpenAI\main.py", line 13, in <module>
    vectorstore = Chroma.from_documents(documents=text,embedding=OpenAIEmbeddings())
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\spate246\source\repos\Assay-Development\Azure_OpenAI\Lib\site-packages\langchain\vectorstores\chroma.py", line 578, in from_documents
    return cls.from_texts(
           ^^^^^^^^^^^^^^^
  File "C:\Users\spate246\source\repos\Assay-Development\Azure_OpenAI\Lib\site-packages\langchain\vectorstores\chroma.py", line 542, in from_texts
    chroma_collection.add_texts(texts=texts, metadatas=metadatas, ids=ids)
  File "C:\Users\spate246\source\repos\Assay-Development\Azure_OpenAI\Lib\site-packages\langchain\vectorstores\chroma.py", line 175, in add_texts
    embeddings = self._embedding_function.embed_documents(list(texts))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\spate246\source\repos\Assay-Development\Azure_OpenAI\Lib\site-packages\langchain\embeddings\openai.py", line 508, in embed_documents
    return self._get_len_safe_embeddings(texts, engine=self.deployment)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\spate246\source\repos\Assay-Development\Azure_OpenAI\Lib\site-packages\langchain\embeddings\openai.py", line 358, in _get_len_safe_embeddings
    response = embed_with_retry(
               ^^^^^^^^^^^^^^^^^
  File "C:\Users\spate246\source\repos\Assay-Development\Azure_OpenAI\Lib\site-packages\langchain\embeddings\openai.py", line 107, in embed_with_retry
    return _embed_with_retry(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\spate246\source\repos\Assay-Development\Azure_OpenAI\Lib\site-packages\tenacity\__init__.py", line 289, in wrapped_f
    return self(f, *args, **kw)
           ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\spate246\source\repos\Assay-Development\Azure_OpenAI\Lib\site-packages\tenacity\__init__.py", line 379, in __call__
    do = self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\spate246\source\repos\Assay-Development\Azure_OpenAI\Lib\site-packages\tenacity\__init__.py", line 314, in iter
    return fut.result()
           ^^^^^^^^^^^^
  File "C:\Users\spate246\AppData\Local\Programs\Python\Python311\Lib\concurrent\futures\_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\spate246\AppData\Local\Programs\Python\Python311\Lib\concurrent\futures\_base.py", line 401, in __get_result
    raise self._exception
  File "C:\Users\spate246\source\repos\Assay-Development\Azure_OpenAI\Lib\site-packages\tenacity\__init__.py", line 382, in __call__
    result = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\spate246\source\repos\Assay-Development\Azure_OpenAI\Lib\site-packages\langchain\embeddings\openai.py", line 104, in _embed_with_retry
    response = embeddings.client.create(**kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\spate246\source\repos\Assay-Development\Azure_OpenAI\Lib\site-packages\openai\api_resources\embedding.py", line 33, in create
    response = super().create(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\spate246\source\repos\Assay-Development\Azure_OpenAI\Lib\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 149, in create
    ) = cls.__prepare_create_request(
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\spate246\source\repos\Assay-Development\Azure_OpenAI\Lib\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 83, in __prepare_create_request
    raise error.InvalidRequestError(
openai.error.InvalidRequestError: Must provide an 'engine' or 'deployment_id' parameter to create a <class 'openai.api_resources.embedding.Embedding'>
```

### Expected behavior

I would expect it not have this issue because it has worked before. It would run the while loop and the user can ask the questions.