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

Function save_session_data

ms_agent/app/doc_research.py:1056–1064  ·  view source on GitHub ↗

Save session data to file

(data, user_id: str)

Source from the content-addressed store, hash-verified

1054
1055
1056def save_session_data(data, user_id: str):
1057 """Save session data to file"""
1058 try:
1059 session_file = get_session_file_path(user_id)
1060 os.makedirs(os.path.dirname(session_file), exist_ok=True)
1061 with open(session_file, 'w', encoding='utf-8') as f:
1062 json.dump(data, f, ensure_ascii=False, indent=2)
1063 except Exception as e:
1064 logger.info(f'Failed to save session data: {e}')
1065
1066
1067def load_session_data(user_id: str):

Callers 1

Calls 2

get_session_file_pathFunction · 0.85
dumpMethod · 0.80

Tested by

no test coverage detected