Closed sarthak263 closed 9 months ago
Any updates on this?
Answer generated by a 🤖
I understand that you're encountering an error stating "Must provide an 'engine' or 'deployment_id' parameter to create a <class 'openai.api_resources.embedding.Embedding'>". This error is occurring when you're trying to create an instance of the 'OpenAIEmbeddings' class in your code.
The error message suggests that the 'engine' or 'deployment_id' parameter is missing when creating an instance of the 'openai.api_resources.embedding.Embedding' class. In your code, you're creating an instance of 'OpenAIEmbeddings' with only the 'model' parameter:
embeddings = OpenAIEmbeddings(model=OPENAI_EMBEDDING_MODEL_NAME)
According to the documentation of the 'OpenAIEmbeddings' class, you should also provide the 'deployment' parameter when creating an instance of 'OpenAIEmbeddings'.
Here's how you can modify your code to include the 'deployment' parameter:
embeddings = OpenAIEmbeddings(model=OPENAI_EMBEDDING_MODEL_NAME, deployment="your-embeddings-deployment-name")
Please replace "your-embeddings-deployment-name" with the actual name of your deployment. This modification should help resolve the error you're facing.
Please note that this is one potential solution based on the information provided. If this doesn't resolve your issue, or if your experience contradicts this solution, I would recommend checking if you're using the latest version of the LangChain framework, as the issue might have been resolved in a more recent update.
If you believe this is a bug that could impact other users and you're comfortable doing so, you're encouraged to make a pull request with the necessary changes. This would greatly benefit the LangChain community.
This response is meant to be useful, save you time, and share context. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
Hello,
I am getting the same error when running a search with Milvus Vector Database. Everything was working fine when using LangChain 0.0.183. I have upgraded to the latest version 0.0.249 and I have started getting the error.
I have updated my code to pass the deployment name to the OpenAIEmbeddings call as indicated above and that did not fix the issue.
Thanks, Marcelo
Hi,
I was having the same issue, but was able to resolve this by providing the engine
argument to the OpenAIEmbeddings
call. Maybe give this a try and see if it works for you.
I am still facing the same error even I have defined model, deployment in the embeddings vectordb = Chroma.from_documents( documents=texts, embedding=embedding )
InvalidRequestError: Must provide an 'engine' or 'deployment_id' parameter to create
Hi, @sarthak263. I'm Dosu, and I'm here to help the LangChain team manage our backlog. I wanted to let you know that we are marking this issue as stale.
Based on my understanding of the current state of the issue, you encountered an error when using FAISS.from_documents()
in your code. In the comments, I suggested that you should provide the 'deployment' parameter when creating an instance of 'OpenAIEmbeddings'. Another user, magallardo, mentioned that they are also encountering the same error after upgrading to the latest version of LangChain. dreysco suggested providing the 'engine' argument to the 'OpenAIEmbeddings' call as a potential solution.
Now, I'd like to ask you if this issue is still relevant to the latest version of the LangChain repository. If it is, please let the LangChain team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or the issue will be automatically closed in 7 days.
If you have any further questions or need additional assistance, please don't hesitate to ask.
Hi, the issue got resolved by adding openai_api_type="azure", OpenAIEmbeddings(model=TEXT_ADA_EMBEDDING_NAME,chunk_size=1,openai_api_type="azure"),
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.
Who can help?
No response
Information
Related Components
Reproduction
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.