Andrea Bency
Andrea Bency

Reputation: 51

To query multiple files(specific files not all files) under a collection name in PGVector

I am using PGVector in openai. Consider i have a collection_name = "documents" where in that i have almost 20 files. I have a code for filtering a single file

    retriever = self.vector_store.as_retriever(
        search_kwargs={"filter": {"source": file_name}}
    )

    chain = RetrievalQAWithSourcesChain.from_chain_type(
        llm=llm,
        chain_type="stuff",
        retriever=retriever,
        chain_type_kwargs=chain_type_kwargs,
        return_source_documents=True,
    )

But i want to pass for example only 5 files under the collection name documents. How can we do it. Please let me know thanks

I want to retrieve and query only 5 or 6 files from collection_name="documents" that is stored in

pg_langchain_collection uisng RetrievalQAWithSourcesChain.

Upvotes: 0

Views: 35

Answers (0)

Related Questions