Find answers from the community

Updated last year

hi all for the line below new index

hi all for the line below: new_index = VectorStoreIndex.from_documents(
documents,
service_context=service_context,
)

can it handle PDF directly, or i need to convert it to csv or txt first ? thanks
H
a
3 comments
you should load the data first with a document loader that can handle pdf, then this works fine.

example:
Plain Text
documents = SimpleDirectoryReader("./documents").load_data()
yes. i have this line in my progrma. thanks.
Tried . Need to install pypdf first. And works.
Add a reply
Sign up and join the conversation on Discord