llama_index
llama_index copied to clipboard
Add Reader for String Iterable
This PR adds a reader for a string iterable. This is useful if you're working on an application in which you can easily produce, say, a list of strings you'd like to index. Usage:
from gpt_index import StringIterableReader, GPTTreeIndex
documents = StringIterableReader(["I went to the store", "I bought an apple"]).load_data()
index = GPTTreeIndex(documents)
index.query("what did I buy?")
# response should be something like "You bought an apple."