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

Function _format_subjects

agents/reading-agent/main.py:1025–1038  ·  view source on GitHub ↗
(paper: Dict[str, Any])

Source from the content-addressed store, hash-verified

1023
1024
1025def _format_subjects(paper: Dict[str, Any]) -> str:
1026 for key in ("subjects", "categories", "category", "primary_category", "tags", "topics"):
1027 value = paper.get(key)
1028 if value in (None, "", [], {}):
1029 continue
1030 if isinstance(value, dict):
1031 values = [str(item).strip() for item in value.values() if str(item).strip()]
1032 elif isinstance(value, (list, tuple, set)):
1033 values = [str(item).strip() for item in value if str(item).strip()]
1034 else:
1035 values = [str(value).strip()]
1036 if values:
1037 return ", ".join(_unique_preserve_order(values))
1038 return "未知"
1039
1040
1041def _collect_report_action_pairs(paper: Dict[str, Any], response_language: str = "zh") -> List[Tuple[str, str]]:

Callers 1

generate_reading_reportFunction · 0.85

Calls 2

_unique_preserve_orderFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected