for file_name,category,date in data:
docs = SimpleDirectoryReader(
input_files=[f"./documents/{file_name}"]
).load_data()
docs.metadata = {"filename": "<doc_file_name>","date":date,"category":category}
"SimpleDirectoryReader
class and make changes as per your requirement to add date and category file wise.index = VectorStoreIndex.from_documents(docs, transformations=[SentenceSplitter(chunk_size=512, chunk_overlap=20)], llm=llm)
" do i pass docs as an array of all those docs i just add , cuz in the bove code snippet i gave i'm loading several docs and each has its own metadatatotal_docs = [] # This will contain docs from all the files. file_name,category,date in data: docs = SimpleDirectoryReader( input_files=[f"./documents/{file_name}"] ).load_data() docs.metadata = {"filename": "<doc_file_name>","date":date,"category":category} total_docs.extend(docs) # extending new doc in total docs