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

Callers 1

generate_reading_reportFunction · 0.85

Calls 2

_unique_preserve_orderFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected