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

Function load_session_data

ms_agent/app/doc_research.py:1067–1086  ·  view source on GitHub ↗

Load session data from file

(user_id: str)

Source from the content-addressed store, hash-verified

1065
1066
1067def load_session_data(user_id: str):
1068 """Load session data from file"""
1069 try:
1070 session_file = get_session_file_path(user_id)
1071 if os.path.exists(session_file):
1072 with open(session_file, 'r', encoding='utf-8') as f:
1073 return json.load(f)
1074 except Exception as e:
1075 logger.info(f'Failed to load session data: {e}')
1076
1077 # Return default data
1078 return {
1079 'workdir': '',
1080 'result': '',
1081 'markdown': '',
1082 'resources': '',
1083 'user_prompt': '',
1084 'urls_text': '',
1085 'timestamp': ''
1086 }
1087
1088
1089def get_user_status_html(request: gr.Request) -> str:

Callers 2

initialize_pageFunction · 0.85
restore_latest_resultsFunction · 0.85

Calls 2

get_session_file_pathFunction · 0.85
loadMethod · 0.80

Tested by

no test coverage detected