- Remove deprecated UNKNOWN.egg-info and user_context.py - Refactor crud_ops, db_tables, and init modules - Update settings UI and save handlers (appearance, general, security) - Update services list, remove, and test DSPY files - Update sessions list DSPY file - Add multi-user test script - Update pyproject.toml dependencies
25 lines
883 B
Plaintext
25 lines
883 B
Plaintext
# Get all sessions for display in sessions.ui
|
|
# This .dspy file uses functions provided by load_hermes_web_cli()
|
|
|
|
try:
|
|
# Get current user ID using ahserver's built-in get_user() function
|
|
user_id = await get_user()
|
|
|
|
# Use the function provided by the hermes-web-cli module
|
|
sessions = await get_active_sessions(user_id)
|
|
|
|
# Format sessions for UI display
|
|
result = []
|
|
for session in sessions:
|
|
result.append({
|
|
"id": session.get("session_id"),
|
|
"name": session.get("session_name", f"Session {session.get('session_id')}"),
|
|
"model": session.get("service_name", "Unknown"),
|
|
"created_at": session.get("created_at"),
|
|
"last_active": session.get("last_active", session.get("created_at"))
|
|
})
|
|
|
|
return result
|
|
except Exception as e:
|
|
# On error, return empty array
|
|
return [] |