MCPcopy Create free account
hub / github.com/modelscope/ms-agent / get_memory_meta_safe

Function get_memory_meta_safe

ms_agent/memory/utils.py:19–29  ·  view source on GitHub ↗
(config: DictConfig,
                         key: str,
                         default_user_id: str | None = None)

Source from the content-addressed store, hash-verified

17
18
19def get_memory_meta_safe(config: DictConfig,
20 key: str,
21 default_user_id: str | None = None):
22 if not hasattr(config, key):
23 return None, None, None, None
24 trigger_config = getattr(config, key, OmegaConf.create({}))
25 user_id = getattr(trigger_config, 'user_id', default_user_id)
26 agent_id = getattr(trigger_config, 'agent_id', None)
27 run_id = getattr(trigger_config, 'run_id', None)
28 memory_type = getattr(trigger_config, 'memory_type', None)
29 return user_id, agent_id, run_id, memory_type

Callers 2

_get_step_memory_infoMethod · 0.90
_get_run_memory_infoMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected