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

Function build_profile_update_result

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

Build a normalized profile-update payload.

(
    action: str,
    direction: str,
    topic: str,
    *,
    strip_domain_suffix: bool = False,
    weight_target: Optional[float] = None,
)

Source from the content-addressed store, hash-verified

1361
1362
1363def build_profile_update_result(
1364 action: str,
1365 direction: str,
1366 topic: str,
1367 *,
1368 strip_domain_suffix: bool = False,
1369 weight_target: Optional[float] = None,
1370) -> Optional[Dict[str, Any]]:
1371 """Build a normalized profile-update payload."""
1372 cleaned_topic = clean_profile_topic_text(topic, strip_domain_suffix=strip_domain_suffix)
1373 if not cleaned_topic:
1374 return None
1375 result = {
1376 "action": action,
1377 "direction": direction,
1378 "topic": cleaned_topic,
1379 }
1380 if weight_target is not None:
1381 result["weight_target"] = weight_target
1382 return result
1383
1384
1385def parse_profile_update_request(text: str, profile: Optional[Dict[str, Any]] = None) -> Optional[Dict[str, Any]]:

Callers 1

Calls 1

clean_profile_topic_textFunction · 0.85

Tested by

no test coverage detected