Mbox Reader

%env OPENAI_API_KEY=sk-************
from llama_index import MboxReader, GPTVectorStoreIndex
documents = MboxReader().load_data('mbox_data_dir', max_count=1000) # Returns list of documents 
index = GPTVectorStoreIndex.from_documents(documents) # Initialize index with documents
query_engine = index.as_query_engine()
res = query_engine.query('When did i have that call with the London office?')
> [query] Total LLM token usage: 100 tokens
> [query] Total embedding token usage: 10 tokens
> There is a call scheduled with the London office at 12am GMT on the 10th of February.