from llama_parse import LlamaParse # pip install llama-parse
from llama_index.core import SimpleDirectoryReader # pip install llama-index
parser = LlamaParse(
api_key=LLAMA_CLOUD_API_KEY, # can also be set in your env as LLAMA_CLOUD_API_KEY
result_type="markdown" # "markdown" and "text" are available
)
Uncomment if you are in a Jupyter Notebook
import nest_asyncio nest_asyncio.apply()
from llama_parse import LlamaParse # pip install llama-parse from llama_index.core import SimpleDirectoryReader # pip install llama-index
parser = LlamaParse( api_key=LLAMA_CLOUD_API_KEY, # can also be set in your env as LLAMA_CLOUD_API_KEY result_type="markdown" # "markdown" and "text" are available )
file_extractor = {".pdf": parser} reader = SimpleDirectoryReader("/path/to/directory", file_extractor=file_extractor) documents = reader.load_data() --
this creates the error ImportError: cannot import name 'DocxReader' from 'llama_index.readers.file' (unknown location)