hi! i think i found a bug or a mistake and i need help. i want to upload nodes to azure and save it in a txt. then i want to downlad and create a vector store index.
to achieve this i run the following commands:
HERE IS THE PART FROM DOCUMENTS TO NODES: documents = SimpleDirectoryReader("/content/data").load_data()
nodes_str = [x.dict() for x in nodes] data=str(nodes_str)
ruta_en_dbfs = "/dbfs/nodes_architectures.txt"
Escribir la variable en el archivo en DBFS
with open(ruta_en_dbfs, 'w') as archivo: archivo.write(data)
print("Variable guardada en DBFS con éxito.")
here are some commands of azure that i skipped and then: with open(local_file_path, "rb") as data: blob_client.upload_blob(data, overwrite=True)
HERE IS THE PART FROM NODES IN TXT FORMAT TO ADD IT TO VECTOR STORE INDEX (THIS IS IN ANOTHER SCRIPT): with open(file_path, 'r', encoding='utf-8') as file: #with open(file_path, 'r') as file: # Leer cada línea en el archivo my_list = file.readlines()
nodes_str = json.loads(my_list[0]) nodes = [TextNode.parse_obj(x) for x in nodes_str]
index = VectorStoreIndex(nodes_str)
This worked fine until the last big update of llamaindex. Now i found my_list[0] with ' instead of " so i run the following command: mi_lista=my_list[0].replace("'", """). But if i have in text for example microsoft"s, then the JSON format is not correct
Also, Now in nodes_str it appears like 'relationships': {<NodeRelationship.SOURCE: '1'>: {'node_id': instead of "relationships": {"1": {"node_id": so there is no good format for JSON