Find answers from the community

Home
Members
mardadi
m
mardadi
Offline, last seen 3 months ago
Joined September 25, 2024
m
mardadi
·

Doc id

Has there been a change in the way meta data can be assigned with latest versions? Code below was working before using my doc_id, but now the doc_id in metadata is random in embeddings metadata.

documents = SimpleDirectoryReader(dir).load_data()

for document in documents:
document.metadata = {"user_id": user_id, "bot_id": bot_id, "filename": filename, "doc_id" : doc_id}
print(f"metadata = {document.metadata}")

index = VectorStoreIndex.from_documents(documents, storage_context=vector_storage_context)

index.storage_context.persist()
7 comments
m
L
how does one get the document_id from a node created from sentence parser... i want to store this so i can delete related nodes later when reindexing... anyone have sample code?
30 comments
m
L