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

Function get_profile_topic_context

agents/master-coordinator/main.py:567–579  ·  view source on GitHub ↗

Build a compact user-facing topic list to ground LLM profile edits.

(profile: Optional[Dict[str, Any]])

Source from the content-addressed store, hash-verified

565
566
567def get_profile_topic_context(profile: Optional[Dict[str, Any]]) -> List[str]:
568 """Build a compact user-facing topic list to ground LLM profile edits."""
569 if not profile:
570 return []
571
572 topics: List[str] = []
573 for container_name in ("core_directions", "topic_weights"):
574 container = profile.get(container_name, {}) or {}
575 for key in container.keys():
576 for alias in iter_topic_aliases(key):
577 if alias not in topics:
578 topics.append(alias)
579 return topics
580
581
582def find_profile_topic_key(profile: Dict[str, Any], topic_text: str) -> Optional[str]:

Callers 1

Calls 2

iter_topic_aliasesFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected