raise ValueError("Client secrets must be for a web or installed app.")
ValueError: Client secrets must be for a web or installed app.
def load_and_index(self):
try:
docs = self.loader()
loaded_doc_ids = {doc.id_ for doc in docs}
print(len(docs))
if docs:
for doc in docs:
nodes = self.pipeline.run(documents=[doc])
print(f"Ingestão de {len(nodes)} Nodes do documento: {doc.metadata['file_name']}")
docstore_hashes = set(self.pipeline.docstore.get_all_document_hashes().keys())
print(f"Hashs docstore: {docstore_hashes}")
docstore_ids = set(self.pipeline.docstore.get_all_ref_doc_info().keys())
print(f"IDs docstore: {docstore_ids}")
docs_exclu = docstore_ids - loaded_docs_ids
if self.exclude_docs:
for doc_id in docs_exclu:
self.pipeline.docstore.delete_document(doc_id)
self.index.delete_ref_doc(doc_id, delete_from_docstore=True)
print(f"Doc delete: {doc_id}")