trouble with LlamaIndexRetriever! #27680
Unanswered
neuralninja7
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
however - i mean to use this vectorDB in my existing langchain chatbot
So what I did was:
from langchain_community.retrievers.llama_index import LlamaIndexRetriever
retriever = LlamaIndexRetriever(query_engine=query_engine)
query = "tell me about dataset PubLayNet"
response = retriever.invoke(query)
print(response)
Above code should have worked fine.
however I get following error:
AttributeError Traceback (most recent call last)
Cell In[37], line 1
----> 1 response = retriever.invoke("What is the capital of France?")
File c:\Code\Github\LlamaIndex\venv\lib\site-packages\langchain_core\retrievers.py:254, in BaseRetriever.invoke(self, input, config, **kwargs)
252 except Exception as e:
253 run_manager.on_retriever_error(e)
--> 254 raise e
255 else:
256 run_manager.on_retriever_end(
257 result,
258 )
File c:\Code\Github\LlamaIndex\venv\lib\site-packages\langchain_core\retrievers.py:247, in BaseRetriever.invoke(self, input, config, **kwargs)
245 _kwargs = kwargs if self._expects_other_args else {}
246 if self._new_arg_supported:
--> 247 result = self._get_relevant_documents(
248 input, run_manager=run_manager, **_kwargs
249 )
250 else:
251 result = self._get_relevant_documents(input, **_kwargs)
File c:\Code\Github\LlamaIndex\venv\lib\site-packages\langchain_community\retrievers\llama_index.py:33, in LlamaIndexRetriever._get_relevant_documents(self, query, run_manager)
28 raise ImportError(
...
---> 33 response = index.query(query, **self.query_kwargs)
34 response = cast(Response, response)
35 # parse source nodes
AttributeError: 'NoneType' object has no attribute 'query'
System Info
my requirement.txt:
langchain_openai
python-dotenv
ipykernel
llama-index-core
llama-parse
llama-index-readers-file
llama-index-llms-openai
llama-index-embeddings-openai
langchain
langchain_community
llama-index
langgraph
Beta Was this translation helpful? Give feedback.
All reactions