diff --git a/api/controllers/console/app/app.py b/api/controllers/console/app/app.py index c5d24f049..7f6502373 100644 --- a/api/controllers/console/app/app.py +++ b/api/controllers/console/app/app.py @@ -141,15 +141,9 @@ class AppListApi(Resource): model_type=ModelType.LLM ) except ProviderTokenNotInitError: - raise ProviderNotInitializeError( - f"No Default System Reasoning Model available. Please configure " - f"in the Settings -> Model Provider.") + model_instance = None - if not model_instance: - raise ProviderNotInitializeError( - f"No Default System Reasoning Model available. Please configure " - f"in the Settings -> Model Provider.") - else: + if model_instance: model_dict = app_model_config.model_dict model_dict['provider'] = model_instance.provider model_dict['name'] = model_instance.model diff --git a/api/core/provider_manager.py b/api/core/provider_manager.py index 82c149673..60a388a63 100644 --- a/api/core/provider_manager.py +++ b/api/core/provider_manager.py @@ -401,10 +401,13 @@ class ProviderManager: Provider.tenant_id == tenant_id, Provider.provider_name == provider_name, Provider.provider_type == ProviderType.SYSTEM.value, - Provider.quota_type == ProviderQuotaType.TRIAL.value, - Provider.is_valid == True + Provider.quota_type == ProviderQuotaType.TRIAL.value ).first() + if provider_record and not provider_record.is_valid: + provider_record.is_valid = True + db.session.commit() + provider_name_to_provider_records_dict[provider_name].append(provider_record) return provider_name_to_provider_records_dict