add top K to vector stores

This commit is contained in:
Henry
2023-06-10 17:21:27 +01:00
parent 617b3bea96
commit d11cb5f4b4
36 changed files with 925 additions and 238 deletions
@@ -46,7 +46,7 @@ class MultiRetrievalQAChain_Chains implements INode {
for (const vs of vectorStoreRetriever) {
retrieverNames.push(vs.name)
retrieverDescriptions.push(vs.description)
retrievers.push(vs.vectorStore.asRetriever())
retrievers.push(vs.vectorStore.asRetriever((vs.vectorStore as any).k ?? 4))
}
const chain = MultiRetrievalQAChain.fromRetrievers(model, retrieverNames, retrieverDescriptions, retrievers, undefined, {