parthsarthi03 / raptor

The official implementation of RAPTOR: Recursive Abstractive Processing for Tree-Organized Retrieval
https://arxiv.org/abs/2401.18059
MIT License
688 stars 98 forks source link

How does .answer_question works? #5

Open FallenComet7 opened 4 months ago

FallenComet7 commented 4 months ago

I saved the tree in a path and I am using it in a different instance. When I use RA.answer_question(question) it come back with answer along with this:

2024-03-07 12:04:53,593 - HTTP Request: POST https://api.openai.com/v1/embeddings "HTTP/1.1 200 OK" 2024-03-07 12:04:54,608 - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK"

I haven't set my Open AI key in this new instance? So I am wondering how it is working?

parthsarthi03 commented 4 months ago

I am unable to reproduce the error, if just load the tree and do not set the OpenAI key, I get the following expected error while trying to call RA.answer_question().

openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable

The Tree structure should not store your OpenAI Key. How are you configuring the OpenAI API key in your setup? Please double-check your environment settings and ensure that the OpenAI API key is not set in unexpected places, such as hidden environment variables or within the code itself.