langchain icon indicating copy to clipboard operation
langchain copied to clipboard

Getting an error InvalidRequestError: Resource not found in VectorDBQA

Open srivatsanv1 opened this issue 1 year ago • 8 comments

HI, I am getting an error "InvalidRequestError: Resource not found" while using Chat model using VectorDBQA chain. This issue is coming up after v0.0.120 release and I was not getting this in the previous version which I used which was v0.0.118. I am using Chatmodel from Azure through AzureChatOpenAI and embeddings through Azure`s model.

srivatsanv1 avatar Mar 23 '23 11:03 srivatsanv1

Hi, same here ("InvalidRequestError: Resource not found"), it's working when using v0.0.119 but not with next versions (0.0.120 & 0.0121). Not using gpt 35 though, but davinci003.

Fanchouille avatar Mar 23 '23 15:03 Fanchouille

I have the same problem

happyPydog avatar Mar 24 '23 15:03 happyPydog

Getting the same error with ConversationalRetrievalChain also. Is this some issue with AzureOpenAI?

srivatsanv1 avatar Mar 27 '23 09:03 srivatsanv1

Getting the same error with ConversationalRetrievalChain also. Is this some issue with AzureOpenAI?

I also have the same problem, not found a solution up to now

stefanoscotta avatar Mar 28 '23 12:03 stefanoscotta

What worked for me was removing the import of openai when using the langchain.llms.AzureOpenAI module.

Try removing import openai even if none of your code appears to be using it.

I'm using version 2022-12-01.

devmart10 avatar Apr 19 '23 23:04 devmart10

You should put in the deployment name into AzureOpenAI:

llm = AzureOpenAI(model_name=deployment_name, deployment_id=deployment_name,deployment_name=deployment_name)

However for me this depends a lot if I take chatGPTs gpt35-turbo or gpt-4 version.

Here are the versions of my dependencies.

langchain: 0.0.118 openai: 0.27.4

domalbert avatar May 03 '23 10:05 domalbert

I have this "Resource Not Found" error using Azure OpenAI, OpenAIEmbeddings and ConversationalRetrievalChain. I found that when using OpenAIEmbeddings the api_version would be changed to "2022-12-01" and after that, using ConversationalRetrievalChain, the api_version will keep as "2022-12-01" and cause the "Resource Not Found" error. The workaround is to set the api_version back to "2023-03-15-preview" after calling OpenAIEmbeddings but before calling ConversationalRetrievalChain.

Enable the openai.log = "debug" so that you can trace all the endpoints and parameters to help you debugging.

nickwong64 avatar May 05 '23 08:05 nickwong64

I have same issue and none of the solutions works for me! In the debug logs, I see the api_version is None although I have already set os.environ["OPENAI_API_VERSION"] = "2023-03-15-preview". The OpenAIEmbeddings works well but ConversationalRetrievalChain raises the "Resource Not Found" error. The settings: os.environ["OPENAI_API_TYPE"] = "azure" os.environ["OPENAI_API_BASE"] = "https://my_be.openai.azure.com" os.environ["OPENAI_API_KEY"] = "my_key" os.environ["OPENAI_API_VERSION"] = "2023-03-15-preview"

langchain==0.0.200

vahidzangenehc avatar Jul 11 '23 07:07 vahidzangenehc

Hi, @srivatsanv1! I'm Dosu, and I'm here to help the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.

Based on my understanding, you are experiencing an "InvalidRequestError: Resource not found" error when using the Chat model with VectorDBQA chain. It seems that other users have also reported the same issue, and it may be related to the AzureOpenAI module. Some potential solutions have been suggested, such as removing the import of openai and setting the api_version back to "2023-03-15-preview" after calling OpenAIEmbeddings but before calling ConversationalRetrievalChain. However, it appears that these solutions have not worked for some users.

Before we proceed, we would like to confirm if this issue is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on this issue. Otherwise, feel free to close the issue yourself, or the issue will be automatically closed in 7 days.

Thank you for your understanding and cooperation. We look forward to hearing from you soon.

dosubot[bot] avatar Oct 10 '23 16:10 dosubot[bot]

commenting on this issue, yes, I verified this is still a problem.

truedat101 avatar Nov 03 '23 07:11 truedat101