MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _snippet

Function _snippet

agents/wiki-agent/retrieve/answer.py:70–76  ·  view source on GitHub ↗
(node: Dict[str, Any], max_chars: int = 700)

Source from the content-addressed store, hash-verified

68
69
70def _snippet(node: Dict[str, Any], max_chars: int = 700) -> str:
71 body = str(node.get("body") or "").strip()
72 if len(body) <= max_chars:
73 return body
74 head = body[: max_chars // 2].rstrip()
75 tail = body[-max_chars // 2 :].lstrip()
76 return f"{head}\n...\n{tail}"
77
78
79def _build_prompt(question: str, hits: List[Dict[str, Any]]) -> str:

Callers 3

_build_promptFunction · 0.85
_extractive_fallbackFunction · 0.85
_build_citationsFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected