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

Function _append_qa_block

agents/reading-agent/main.py:1093–1109  ·  view source on GitHub ↗

Append a single-layer Q/A block in papers.cool style.

(lines: List[str], label: str, question: str, body: Any)

Source from the content-addressed store, hash-verified

1091
1092def _append_qa_block(lines: List[str], label: str, question: str, body: Any) -> None:
1093 """Append a single-layer Q/A block in papers.cool style."""
1094 lines.append(f"### {label} {question}")
1095 lines.append("")
1096 if isinstance(body, (list, tuple)):
1097 any_item = False
1098 for item in body:
1099 text = _clean_text(item)
1100 if text:
1101 lines.append(f"- {text}")
1102 any_item = True
1103 if not any_item:
1104 lines.append("当前信息不足,建议回到原文核对。")
1105 else:
1106 text = _clean_text(body)
1107 lines.append(text or "当前信息不足,建议回到原文核对。")
1108 lines.append("")
1109
1110
1111def _build_recommendation_reason(payload: Dict[str, Any], response_language: str = "zh") -> str:
1112 language = _normalize_response_language(response_language)

Callers

nothing calls this directly

Calls 1

_clean_textFunction · 0.70

Tested by

no test coverage detected