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

Function _profile_summary

deployments/desktop/shared/agents.py:342–356  ·  view source on GitHub ↗
(profile: Optional[Dict[str, Any]])

Source from the content-addressed store, hash-verified

340
341
342def _profile_summary(profile: Optional[Dict[str, Any]]) -> Optional[Dict[str, Any]]:
343 if not profile:
344 return None
345 directions = profile.get("core_directions") or {}
346 topics = profile.get("topic_weights") or {}
347 return {
348 "user_id": profile.get("user_id"),
349 "version": profile.get("version"),
350 "updated_at": profile.get("updated_at"),
351 "core_directions": directions,
352 "top_directions": sorted(directions.items(), key=lambda item: _to_float(item[1]), reverse=True)[:8],
353 "top_topics": sorted(topics.items(), key=lambda item: _to_float(item[1]), reverse=True)[:8],
354 "must_read": profile.get("must_read") or {},
355 "drift_state": profile.get("drift_state") or {},
356 }
357
358
359def _env_bool(name: str, default: bool = False) -> bool:

Callers 4

get_profileFunction · 0.85
update_must_readFunction · 0.85
create_or_update_profileFunction · 0.85
submit_gui_feedbackFunction · 0.85

Calls 2

_to_floatFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected