I created some code like below as a way to pass metadata. For now it's a wrapper function for myself. I'm only passing the title as metadata, but can add to the dictionary if needed.
def createSimpleVectorIndex(self, directory: str = 'sample'):
# Read documents from disk
def filename_to_metadata(filename: str) -> Dict[str, Any]:
return {"episode-title": filename}
documents = SimpleDirectoryReader(directory, file_metadata=filename_to_metadata).load_data()
# Create index
index = GPTSimpleVectorIndex(documents, include_extra_info=True)
# Save index to disk
index.save_to_disk(f'index/vector-index-{directory}.json')