diff --git a/api_service/dashboard_api_endpoints.py b/api_service/dashboard_api_endpoints.py index 539b9e2..4fa5cc6 100644 --- a/api_service/dashboard_api_endpoints.py +++ b/api_service/dashboard_api_endpoints.py @@ -1075,19 +1075,20 @@ async def update_global_settings( ) # Convert from GlobalSettings to UserSettings + # Provide default values for required fields when they are None user_settings = UserSettings( - model_id=settings.model, - temperature=settings.temperature, - max_tokens=settings.max_tokens, + model_id=settings.model or "openai/gpt-3.5-turbo", + temperature=settings.temperature if settings.temperature is not None else 0.7, + max_tokens=settings.max_tokens if settings.max_tokens is not None else 1000, system_message=settings.system_message, character=settings.character, character_info=settings.character_info, custom_instructions=settings.custom_instructions, custom_bot_token=settings.custom_bot_token, - custom_bot_enabled=settings.custom_bot_enabled, - custom_bot_prefix=settings.custom_bot_prefix, - custom_bot_status_text=settings.custom_bot_status_text, - custom_bot_status_type=settings.custom_bot_status_type + custom_bot_enabled=settings.custom_bot_enabled if settings.custom_bot_enabled is not None else False, + custom_bot_prefix=settings.custom_bot_prefix or "!", + custom_bot_status_text=settings.custom_bot_status_text or "!help", + custom_bot_status_type=settings.custom_bot_status_type or "listening" ) # Add theme settings if provided