MCPcopy Create free account
hub / github.com/Alibaba-NLP/VRAG / print_tree

Function print_tree

demo/vimrag_agent.py:493–503  ·  view source on GitHub ↗
(nid, prefix='', is_last=True)

Source from the content-addressed store, hash-verified

491 default_icon = '◆'
492
493 def print_tree(nid, prefix='', is_last=True):
494 icon = icons.get(nid, default_icon)
495 if not prefix:
496 print(f' {icon} {nid}')
497 else:
498 connector = '└── ' if is_last else '├── '
499 print(f' {prefix}{connector}{icon} {nid}')
500 child_list = children.get(nid, [])
501 for i, cid in enumerate(child_list):
502 ext = ' ' if is_last else '│ '
503 print_tree(cid, prefix + ext, i == len(child_list) - 1)
504
505 print_tree('root')
506

Callers 1

vimrag_agent.pyFile · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected