MCPcopy
hub / github.com/aiming-lab/MetaClaw / from_state

Method from_state

metaclaw/memory/policy.py:29–41  ·  view source on GitHub ↗
(cls, state: MemoryPolicyState)

Source from the content-addressed store, hash-verified

27
28 @classmethod
29 def from_state(cls, state: MemoryPolicyState) -> "MemoryPolicy":
30 kwargs: dict = dict(
31 max_injected_units=state.max_injected_units,
32 max_injected_tokens=state.max_injected_tokens,
33 recent_bonus_hours=state.recent_bonus_hours,
34 keyword_weight=state.keyword_weight,
35 metadata_weight=state.metadata_weight,
36 importance_weight=state.importance_weight,
37 recency_weight=state.recency_weight,
38 )
39 if state.type_boosts:
40 kwargs["type_boosts"] = dict(state.type_boosts)
41 return cls(**kwargs)
42
43 @classmethod
44 def from_profile(cls, profile: str) -> "MemoryPolicy":

Callers 3

from_configMethod · 0.45
_refresh_policyMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected