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

Function detect_expand_push_request

agents/master-coordinator/main.py:1194–1221  ·  view source on GitHub ↗
(text: Any)

Source from the content-addressed store, hash-verified

1192
1193
1194def detect_expand_push_request(text: Any) -> Optional[Dict[str, Any]]:
1195 cleaned = first_meaningful_line(text)
1196 lowered = cleaned.lower().strip()
1197 if not lowered:
1198 return None
1199 if not any(token in cleaned for token in ("展开", "再看看", "遗漏", "补看", "看看")):
1200 return None
1201
1202 category = ""
1203 if any(token in cleaned for token in ("🔒", "必读", "lock")):
1204 category = "must_read"
1205 elif any(token in cleaned for token in ("🔴", "红", "高度相关", "red")):
1206 category = "high_relevant"
1207 elif any(token in cleaned for token in ("🟡", "黄", "可能感兴趣")):
1208 category = "maybe_interested"
1209 elif any(token in cleaned for token in ("🔵", "蓝", "边缘相关")):
1210 category = "edge_relevant"
1211
1212 query = ""
1213 match = re.search(r"展开\s*([^\s,。,;;]+?)\s*(?:分组|方向)?$", cleaned)
1214 if match:
1215 query = match.group(1).strip()
1216 elif "遗漏" in cleaned and not category:
1217 category = "maybe_interested"
1218
1219 if not category and not query:
1220 return None
1221 return {"category": category, "query": query}
1222
1223
1224def detect_classification_correction_request(text: Any) -> Optional[Dict[str, Any]]:

Callers 1

detect_intentMethod · 0.85

Calls 1

first_meaningful_lineFunction · 0.85

Tested by

no test coverage detected