Skip to content

ValidationError: 1 validation error for RetrievalQA #17418

Answered by dosubot bot
siddhant250502 asked this question in Q&A
Discussion options

You must be logged in to vote

🤖

Hey @siddhant250502! Great to see you diving into new challenges with LangChain. How's everything going on your end?

Based on the error message you provided, it seems like there's a typo in your code. You're trying to set the return_soruce_document parameter, but it should be return_source_document.

Here's the corrected code:

def retrieval_qa_chain(llm, prompt, db):
    qa_chain = RetrievalQA.from_chain_type(
        llm=llm,
        chain_type="stuff",
        retriever = db.as_retriever(search_kwargs={'k':2}),
        return_source_document = True,
        chain_type_kwargs={'prompt':prompt}
    )
    
    return qa_chain

Also, based on the issue #16323 and issue #15700 in the LangCha…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@bushrashahzad
Comment options

@Shekhar-Maiti
Comment options

Answer selected by baskaryan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants