- Add missing core module files: crud_ops.py, db_tables.py, init_db.py, user_context.py - Ensure all .dspy scripts properly use get_user() for user_id acquisition - Fix user context handling in module functions via get_current_user_id() - Maintain proper async/await patterns throughout the codebase - Complete module implementation following module-development-spec - All database operations use sqlor framework with proper user isolation
22 lines
929 B
Plaintext
22 lines
929 B
Plaintext
1|# Save general settings
|
|
2|# This .dspy file uses functions provided by load_hermes_web_cli()
|
|
3|
|
|
4|try:
|
|
5| default_model = request.form.get('default-model', '')
|
|
6| session_timeout = request.form.get('session-timeout', '30')
|
|
7| auto_save = request.form.get('auto-save', 'false') == 'true'
|
|
8|
|
|
9| try:
|
|
10| session_timeout = int(session_timeout)
|
|
11| except:
|
|
12| session_timeout = 30
|
|
13|
|
|
14| # Save settings using the module function
|
|
15| await save_setting('general', 'default_model', default_model)
|
|
16| await save_setting('general', 'session_timeout', session_timeout)
|
|
17| await save_setting('general', 'auto_save', auto_save)
|
|
18|
|
|
19| return {"success": True, "message": "General settings saved successfully"}
|
|
20|
|
|
21|except Exception as e:
|
|
22| return {"error": str(e)} |