Find answers from the community

Updated 3 months ago

I'm facing a weird issue. I'm using

I'm facing a weird issue. I'm using Astra DataStax to upload my embeddings. The issue arises when I load files from a local directory containing 6 PDF files; however, when I check documents.length, I'm getting 485. Why is that so? How to solve this ?
Plain Text
 const dataPath = path.resolve('../documents');
        const reader = new SimpleDirectoryReader();
        const documents = await reader.loadData({ directoryPath: dataPath });
W
i
6 comments
1 page per document is created. So the length signifies that you have in total of 485 pages in 6 PDF files.
but in the above step im just loading the documents files not creating any nodes
the issue is that i have to iterate over the documents files and then add file name in the meta data. due to the above mention issue im unable to acheive that.
If it is a pdf file, it will be adding filename and page number by itself in the metadata for each document
Yes the files are pdf but the metadata is not proper.
is there any way to add file name in the ts pacakge
Add a reply
Sign up and join the conversation on Discord