Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error - ChatVectorDBChain qa_prompt extra fields not permitted (type=value_error.extra) #19

Open
johnemartines opened this issue May 19, 2023 · 5 comments

Comments

@johnemartines
Copy link

Running on local URL: http://127.0.0.1:7860

To create a public link, set share=True in launch().
/home/jmartines/dev-ai/venv/lib/python3.11/site-packages/langchain/chains/conversational_retrieval/base.py:233: UserWarning: ChatVectorDBChain is deprecated - please use from langchain.chains import ConversationalRetrievalChain
warnings.warn(
Traceback (most recent call last):
File "/home/jmartines/dev-ai/venv/lib/python3.11/site-packages/gradio/routes.py", line 414, in run_predict
output = await app.get_blocks().process_api(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jmartines/dev-ai/venv/lib/python3.11/site-packages/gradio/blocks.py", line 1323, in process_api
result = await self.call_function(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jmartines/dev-ai/venv/lib/python3.11/site-packages/gradio/blocks.py", line 1051, in call_function
prediction = await anyio.to_thread.run_sync(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jmartines/dev-ai/venv/lib/python3.11/site-packages/anyio/to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jmartines/dev-ai/venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
^^^^^^^^^^^^
File "/home/jmartines/dev-ai/venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 867, in run
result = context.run(func, *args)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jmartines/dev-ai/chat-your-data/app.py", line 19, in set_openai_api_key
chain = get_chain(vectorstore)
^^^^^^^^^^^^^^^^^^^^^^
File "/home/jmartines/dev-ai/chat-your-data/query_data.py", line 28, in get_chain
qa_chain = ChatVectorDBChain.from_llm(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jmartines/dev-ai/venv/lib/python3.11/site-packages/langchain/chains/conversational_retrieval/base.py", line 267, in from_llm
return cls(
^^^^
File "pydantic/main.py", line 341, in pydantic.main.BaseModel.init
pydantic.error_wrappers.ValidationError: 1 validation error for ChatVectorDBChain
qa_prompt
extra fields not permitted (type=value_error.extra)

@RohanBS
Copy link

RohanBS commented May 22, 2023

@hwchase17 any idea how to fix this issue ?

@frandominguezl
Copy link

I'm going to assume that the param qa_prompt is no longer accepted. You can try to delete that argument and see if that works. I haven't tested locally.

qa_prompt=QA_PROMPT,

@ihor-shndr
Copy link

It helped @frandominguezl
Thanks!

@Robert-Wang-08
Copy link

same error, same soluthon worked!

I'm going to assume that the param qa_prompt is no longer accepted. You can try to delete that argument and see if that works. I haven't tested locally.

qa_prompt=QA_PROMPT,

pydantic.error_wrappers.ValidationError: 1 validation error

@wangdong2023
Copy link

where to put qa_prompt then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants