MCPcopy Create free account
hub / github.com/Alibaba-NLP/ViDoRAG / onlchunkfile2node

Function onlchunkfile2node

utils/format_converter.py:28–41  ·  view source on GitHub ↗
(input_file)

Source from the content-addressed store, hash-verified

26 return nodes
27
28def onlchunkfile2node(input_file):
29 content_json = json.load(open(input_file, 'r'))
30 nodes = []
31 for data in content_json:
32 node = TextNode(text=data['title'] + data.get('hier_title', '') + data['content'], file_name=input_file)
33 nodes.append(node)
34 if len(nodes) > 1:
35 nodes[-1].relationships[NodeRelationship.PREVIOUS] = RelatedNodeInfo(
36 node_id=nodes[-2].node_id
37 )
38 nodes[-2].relationships[NodeRelationship.NEXT] = RelatedNodeInfo(
39 node_id=nodes[-1].node_id
40 )
41 return nodes
42
43
44def transform_idp2markdown(response_json: dict) -> str:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected