MCPcopy
hub / github.com/VectifyAI/PageIndex / get_node_summary

Function get_node_summary

pageindex/page_index_md.py:10–16  ·  view source on GitHub ↗
(node, summary_token_threshold=200, model=None)

Source from the content-addressed store, hash-verified

8 from utils import *
9
10async def get_node_summary(node, summary_token_threshold=200, model=None):
11 node_text = node.get('text')
12 num_tokens = count_tokens(node_text, model=model)
13 if num_tokens < summary_token_threshold:
14 return node_text
15 else:
16 return await generate_node_summary(node, model=model)
17
18
19async def generate_summaries_for_structure_md(structure, summary_token_threshold, model=None):

Callers 1

Calls 2

count_tokensFunction · 0.85
generate_node_summaryFunction · 0.85

Tested by

no test coverage detected