from llama_index.retrievers import RecursiveRetriever
# note: can pass `agents` dict as `query_engine_dict` since every agent can be used as a query engine
recursive_retriever = RecursiveRetriever(
"vector",
retriever_dict={"vector": index_retriever, **retriever_dict},
# query_engine_dict=query_engine_dict,
verbose=True,
)
os.environ["OPENAI_API_KEY"] = "" nodes = recursive_retriever.retrieve("Tell me about some issues on 12/11")
print(f"Number of source nodes: {len(nodes)}")
nodes[0].node.metadata
gives error:
Retrieving with query id None: Tell me about some issues on 12/11
---------------------------------------------------------------------------
AuthenticationError Traceback (most recent call last)
<ipython-input-57-e465b1a12d99> in <cell line: 1>()
----> 1 nodes = recursive_retriever.retrieve("Tell me about some issues on 12/11")
2
3 print(f"Number of source nodes: {len(nodes)}")
4 nodes[0].node.metadata
15 frames
/usr/local/lib/python3.10/dist-packages/openai/_base_client.py in _request(self, cast_to, options, remaining_retries, stream, stream_cls)
928 err.response.read()
929
--> 930 raise self._make_status_error_from_response(err.response) from None
931
932 return self._process_response(
AuthenticationError: Error code: 401 - {'error': {'message': 'Incorrect API key provided: sk-NgwJh***************************************ViNP. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}