mirror of
https://github.com/suitenumerique/docs.git
synced 2026-09-18 07:37:56 +02:00
🚩(project) add more backend AI feature flags
The Blocknote AI feature is a bit flaky, we want to be able to disable it if to much issues arise, without having to do a new release. We add a bunch of feature flags to be able to disable the AI features if needed: - add AI_FEATURE_BLOCKNOTE_ENABLED, to display or not the feature powered by blocknote - add AI_FEATURE_LEGACY_ENABLED, to display or not the legacy AI features
This commit is contained in:
@@ -1852,7 +1852,7 @@ class DocumentViewSet(
|
||||
# Check permissions first
|
||||
self.get_object()
|
||||
|
||||
if not settings.AI_FEATURE_ENABLED:
|
||||
if not settings.AI_FEATURE_ENABLED or not settings.AI_FEATURE_BLOCKNOTE_ENABLED:
|
||||
raise ValidationError("AI feature is not enabled.")
|
||||
|
||||
ai_service = AIService()
|
||||
@@ -2572,6 +2572,8 @@ class ConfigView(drf.views.APIView):
|
||||
array_settings = [
|
||||
"AI_BOT",
|
||||
"AI_FEATURE_ENABLED",
|
||||
"AI_FEATURE_BLOCKNOTE_ENABLED",
|
||||
"AI_FEATURE_LEGACY_ENABLED",
|
||||
"API_USERS_SEARCH_QUERY_MIN_LENGTH",
|
||||
"COLLABORATION_WS_URL",
|
||||
"COLLABORATION_WS_NOT_CONNECTED_READY_ONLY",
|
||||
|
||||
Reference in New Issue
Block a user