style: apply ruff formatting
This commit is contained in:
@@ -1283,10 +1283,7 @@ Examples:
|
|||||||
for chunk_text in chunk_texts:
|
for chunk_text in chunk_texts:
|
||||||
# TODO: Enhance create_text_chunks to return metadata alongside text
|
# TODO: Enhance create_text_chunks to return metadata alongside text
|
||||||
# For now, we store chunks with empty metadata
|
# For now, we store chunks with empty metadata
|
||||||
all_texts.append({
|
all_texts.append({"text": chunk_text, "metadata": {}})
|
||||||
"text": chunk_text,
|
|
||||||
"metadata": {}
|
|
||||||
})
|
|
||||||
|
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
print(
|
print(
|
||||||
@@ -1319,10 +1316,7 @@ Examples:
|
|||||||
nodes = parser.get_nodes_from_documents([doc])
|
nodes = parser.get_nodes_from_documents([doc])
|
||||||
|
|
||||||
for node in nodes:
|
for node in nodes:
|
||||||
all_texts.append({
|
all_texts.append({"text": node.get_content(), "metadata": chunk_metadata})
|
||||||
"text": node.get_content(),
|
|
||||||
"metadata": chunk_metadata
|
|
||||||
})
|
|
||||||
|
|
||||||
print(f"Loaded {len(documents)} documents, {len(all_texts)} chunks")
|
print(f"Loaded {len(documents)} documents, {len(all_texts)} chunks")
|
||||||
return all_texts
|
return all_texts
|
||||||
|
|||||||
Reference in New Issue
Block a user