hwchase17 / chat-your-data

MIT License
901 stars 266 forks source link

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

Open johnemartines opened 1 year ago

johnemartines commented 1 year ago

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 commented 12 months ago

@hwchase17 any idea how to fix this issue ?

frandominguezl commented 11 months ago

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.

https://github.com/hwchase17/chat-your-data/blob/ab58895333ec08f106aa003adf03d15257b626b3/query_data.py#L31

ihor-shndr commented 10 months ago

It helped @frandominguezl Thanks!

Robert-Wang-08 commented 10 months ago

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.

https://github.com/hwchase17/chat-your-data/blob/ab58895333ec08f106aa003adf03d15257b626b3/query_data.py#L31

pydantic.error_wrappers.ValidationError: 1 validation error

wangdong2023 commented 10 months ago

where to put qa_prompt then?