mpaepper / content-chatbot

Build a chatbot or Q&A bot of your website's content
https://www.paepper.com/blog/posts/build-q-and-a-bot-of-your-website-using-langchain/
523 stars 56 forks source link

4 most similar docs #9

Closed m1o9h9o9r closed 1 year ago

m1o9h9o9r commented 1 year ago

If I understand correctly, the default is set to search for 4 most relevant docs. Is it possible to change this somehow?

mpaepper commented 1 year ago

Yep, it is:

default is k=4, but you can change it:

chain = VectorDBQAWithSourcesChain.from_llm(
          llm=OpenAI(temperature=0, verbose=True), vectorstore=store, k=10)