def _doc_chunk_to_node()

in datastore/providers/llama_datastore.py [0:0]


def _doc_chunk_to_node(doc_chunk: DocumentChunk, source_doc_id: str) -> Node:
    """Convert document chunk to Node"""
    return Node(
        doc_id=doc_chunk.id,
        text=doc_chunk.text,
        embedding=doc_chunk.embedding,
        extra_info=doc_chunk.metadata.dict(),
        relationships={DocumentRelationship.SOURCE: source_doc_id},
    )