From 1b4a1446503e24a2d041295e16944b1005a615d6 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Wed, 17 Sep 2025 21:35:00 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7(summary)=20add=20settings=20to=20d?= =?UTF-8?q?isable=20summary=20feature=20entirely?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduce FastAPI settings configuration option to completely disable the summary feature. This improves developer experience by allowing developers to skip summary-related setup when not needed for their workflow. --- src/summary/summary/core/celery_worker.py | 5 ++++- src/summary/summary/core/config.py | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/summary/summary/core/celery_worker.py b/src/summary/summary/core/celery_worker.py index e9744bb7..506d4c40 100644 --- a/src/summary/summary/core/celery_worker.py +++ b/src/summary/summary/core/celery_worker.py @@ -318,7 +318,10 @@ def process_audio_transcribe_summarize_v2( metadata_manager.capture(task_id, settings.posthog_event_success) - if analytics.is_feature_enabled("summary-enabled", distinct_id=sub): + if ( + analytics.is_feature_enabled("summary-enabled", distinct_id=sub) + and settings.is_summary_enabled + ): logger.info("Queuing summary generation task.") summarize_transcription.apply_async( args=[formatted_transcription, email, sub, title], diff --git a/src/summary/summary/core/config.py b/src/summary/summary/core/config.py index 038c99f4..77dc7aa3 100644 --- a/src/summary/summary/core/config.py +++ b/src/summary/summary/core/config.py @@ -57,6 +57,9 @@ class Settings(BaseSettings): ) summary_title_template: Optional[str] = "Résumé de {title}" + # Summary related settings + is_summary_enabled: bool = True + # Sentry sentry_is_enabled: bool = False sentry_dsn: Optional[str] = None