Back to Llama Index

Mbox Reader

docs/examples/data_connectors/MboxReaderDemo.ipynb

0.14.21991 B
Original Source

<a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/data_connectors/MboxReaderDemo.ipynb" target="_parent"></a>

Mbox Reader

If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.

python
%pip install llama-index-readers-mbox
python
!pip install llama-index
python
%env OPENAI_API_KEY=sk-************
python
from llama_index.readers.mbox import MboxReader
from llama_index.core import VectorStoreIndex
python
documents = MboxReader().load_data(
    "mbox_data_dir", max_count=1000
)  # Returns list of documents
python
index = VectorStoreIndex.from_documents(
    documents
)  # Initialize index with documents
python
query_engine = index.as_query_engine()
res = query_engine.query("When did i have that call with the London office?")
python
res.response