Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not getting an answer #1145

Closed
BoccheseGiacomo opened this issue Apr 11, 2023 · 2 comments
Closed

Not getting an answer #1145

BoccheseGiacomo opened this issue Apr 11, 2023 · 2 comments

Comments

@BoccheseGiacomo
Copy link

BoccheseGiacomo commented Apr 11, 2023

`
from llama_index import GPTSimpleVectorIndex, SimpleDirectoryReader
import openai
import os

os.environ['OPENAI_API_KEY'] = 'sk-xxxxx' # my api key
documents=SimpleDirectoryReader('data').load_data()
index=GPTSimpleVectorIndex.from_documents(documents)

response=index.query('what is a cat?')
print(response)
`

This is the basic code to get an answer, and should work, but in the response i only get some runtime messages and not the answer:

INFO:llama_index.token_counter.token_counter:> [query] Total LLM token usage: 0 tokens
INFO:llama_index.token_counter.token_counter:> [query] Total embedding token usage: 5 tokens

and the value of the variable response is None

why? thank you

@arpitsr
Copy link
Contributor

arpitsr commented Apr 12, 2023

Are you sure there is data in the data directory ?
documents=SimpleDirectoryReader('data').load_data()

@BoccheseGiacomo
Copy link
Author

I solved thank you. I thought "data" was a built-in example data folder, but it wasn't so.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants