DEV Community

parmarjatin4911@gmail.com
parmarjatin4911@gmail.com

Posted on

Llama Index Beginners

Llama Index Beginners

from llama_index import VectorStoreIndex, SimpleDirectoryReader

documents = SimpleDirectoryReader('data').load_data()
index = VectorStoreIndex.from_documents(documents)
index.storage_context.persist()

query_engine = index.as_query_engine()
response = query_engine.query("What did the author do growing up?")
print(response)

Put all the .txt in the data folder.

Top comments (0)