Langchain retreival not functioning with pinecone serverless

from langchain.chains import RetrievalQA

rag_pipeline = RetrievalQA.from_chain_type(
    llm=llm, chain_type='stuff',
    retriever=vectorstore.as_retriever()
)
rag_pipeline(' Explain to me the difference between nuclear fission and fusion.')
The error I am getting when running this query
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-29-65fe28537cc4> in <cell line: 1>()
----> 1 rag_pipeline(' What motivates the use of ANY queries in DNS, and why might an authoritative DNS server choose not to respond to such queries')

10 frames
/usr/local/lib/python3.10/dist-packages/pinecone/data/index.py in query(self, top_k, vector, id, namespace, filter, include_values, include_metadata, sparse_vector, *args, **kwargs)
    376 
    377         if len(args) > 0:
--> 378             raise ValueError("The argument order for `query()` has changed; please use keyword arguments instead of positional arguments. Example: index.query(vector=[0.1, 0.2, 0.3], top_k=10, namespace='my_namespace')")
    379 
    380         if vector is not None and id is not None:

ValueError: The argument order for `query()` has changed; please use keyword arguments instead of positional arguments. Example: index.query(vector=[0.1, 0.2, 0.3], top_k=10, namespace='my_namespace')
1 Like

Hi @gptshared2. What versions of pinecone-client, langchain, and langchain-pinecone are you using?

1 Like

Thank you it was the langchain library, I had an old version installed. Now the pipeline is working but I am getting really long outputs for some reason which didn’t happen before. The two pictures I have posted show the difference. I am using the Llama13b retrievalqa code by James Calam. This is the link examples/learn/generation/llm-field-guide/llama-2/llama-2-13b-retrievalqa.ipynb at master · pinecone-io/examples · GitHub eg)


Would you know why this might be happening?

This is how it is currently looking