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

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