openai_key = "" #<--- Your API KEY openai.api_key = openai_key
Retrieving with query id None: Tell me about some issues on 12/11 --------------------------------------------------------------------------- AuthenticationError Traceback (most recent call last) <ipython-input-50-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'}}
import os os.environ["OPENAI_API_KEY"] = "<Your OpenAI API Key>"
OpenAI
class:from llama_index.llms import OpenAI llm = OpenAI(model="text-davinci-003", api_key="<Your OpenAI API Key>")
<Your OpenAI API Key>
with your actual OpenAI API key. If you're still facing issues, please ensure that your OpenAI API key is correct. You can find your API key at <> () as mentioned in the error message.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, )
nodes = recursive_retriever.retrieve("Tell me about some issues on 12/11") print(f"Number of source nodes: {len(nodes)}") nodes[0].node.metadata
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'}}
import os os.environ["OPENAI_API_KEY"] = "<Your OpenAI API Key>"
OpenAI
class:from llama_index.llms import OpenAI llm = OpenAI(model="text-davinci-003", api_key="<Your OpenAI API Key>")
<Your OpenAI API Key>
with your actual OpenAI API key. If you're still facing issues, please ensure that your OpenAI API key is correct. You can find your API key at <> () as mentioned in the error message.nodes = recursive_retriever.retrieve("Tell me about some issues on 12/11") print(f"Number of source nodes: {len(nodes)}") nodes[0].node.metadata
os.environ["OPENAI_API_KEY"] = "<Your OpenAI API Key>"
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'}}
import os os.environ["OPENAI_API_KEY"] = "<Your OpenAI API Key>"
OpenAI
class:from llama_index.llms import OpenAI llm = OpenAI(model="text-davinci-003", api_key="<Your OpenAI API Key>")
<Your OpenAI API Key>
with your actual OpenAI API key. If you're still facing issues, please ensure that your OpenAI API key is correct. You can find your API key at <> () as mentioned in the error message.