Open source video conferencing app powered by LiveKit. Built with Django and React.
✨(summary) add optional satisfaction survey footer
leo135b99aee7d0
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 628197b1..f3f934b9 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -12,6 +12,7 @@ and this project adheres to- ✨(frontend) allow disabling silent login via a URL parameter- ✨(frontend) allow hiding the login button via a URL parameter+- ✨(summary) add optional satisfaction survey footer### Changeddiff --git a/env.d/development/summary.dist b/env.d/development/summary.distindex f69b9fd5..ab83a629 100644--- a/env.d/development/summary.dist+++ b/env.d/development/summary.dist@@ -22,3 +22,6 @@ WEBHOOK_URL="https://configure-your-url.com"POSTHOG_API_KEY="your-posthog-key"POSTHOG_ENABLED="False"++# Transcription+TRANSCRIPTION_SATISFACTION_FORM_BASE_URL=diff --git a/src/summary/summary/core/celery_worker.py b/src/summary/summary/core/celery_worker.pyindex 567c67e9..944b1d46 100644--- a/src/summary/summary/core/celery_worker.py+++ b/src/summary/summary/core/celery_worker.py@@ -233,6 +233,7 @@ def format_transcript(recording_datetime: str | None,owner_timezone: str | None,download_link: str | None,+ form_link: str | None,) -> tuple[str, str]:"""Format a transcription into readable content with a title.@@ -250,6 +251,7 @@ def format_transcript(recording_datetime=recording_datetime,owner_timezone=owner_timezone,download_link=download_link,+ form_link=form_link,)@@ -346,6 +348,13 @@ def process_audio_transcribe_summarize_v2(task_id,)+ form_base_url = settings.transcription_satisfaction_form_base_url+ form_link = (+ f"{form_base_url}?room_id={room}"+ if (form_base_url and metadata_filename is not None)+ else None+ )+# Format outputcontent, title = format_transcript(transcription,@@ -355,6 +364,7 @@ def process_audio_transcribe_summarize_v2(recording_start_at,owner_timezone,download_link,+ form_link,)submit_content(content, title, email, sub)diff --git a/src/summary/summary/core/config.py b/src/summary/summary/core/config.pyindex 1e001003..28a4a44e 100644--- a/src/summary/summary/core/config.py+++ b/src/summary/summary/core/config.py@@ -122,6 +122,7 @@ class Settings(BaseSettings):# Summary related settingsis_summary_enabled: bool = True+ transcription_satisfaction_form_base_url: Optional[str] = None# Sentrysentry_is_enabled: bool = Falsediff --git a/src/summary/summary/core/locales/de.py b/src/summary/summary/core/locales/de.pyindex 9d13f413..10a8d2c7 100644--- a/src/summary/summary/core/locales/de.py+++ b/src/summary/summary/core/locales/de.py@@ -25,6 +25,10 @@ Einige Punkte, die wir Ihnen empfehlen zu überprüfen:download_header_template=("\n*[Laden Sie hier Ihre Aufnahme herunter (externer Link)]({download_link})*\n"),+ form_footer_template=(+ "\n\n*[Teilen Sie uns mit, wie Ihnen diese Transkription gefallen hat "+ "(externer Link)]({form_link})*\n"+ ),hallucination_replacement_text="[Text konnte nicht transkribiert werden]",document_default_title="Transkription",document_title_template=(diff --git a/src/summary/summary/core/locales/en.py b/src/summary/summary/core/locales/en.pyindex a70ef1a9..22841d84 100644--- a/src/summary/summary/core/locales/en.py+++ b/src/summary/summary/core/locales/en.py@@ -25,6 +25,10 @@ A few things we recommend you check:download_header_template=("\n*[Download your recording (external link)]({download_link})*\n"),+ form_footer_template=(+ "\n\n*[Tell us what you thought of this transcription "+ "(external link)]({form_link})*\n"+ ),hallucination_replacement_text="[Unable to transcribe text]",document_default_title="Transcription",document_title_template=(diff --git a/src/summary/summary/core/locales/fr.py b/src/summary/summary/core/locales/fr.pyindex 21214176..aab29617 100644--- a/src/summary/summary/core/locales/fr.py+++ b/src/summary/summary/core/locales/fr.py@@ -25,6 +25,9 @@ Quelques points que nous vous conseillons de vérifier :download_header_template=("\n*[Télécharger votre enregistrement Audio]({download_link})*\n"),+ form_footer_template=(+ "\n\n*[Donnez nous votre avis sur cette transcription]({form_link})*\n"+ ),hallucination_replacement_text="[Texte impossible à transcrire]",document_default_title="Transcription",document_title_template=(diff --git a/src/summary/summary/core/locales/nl.py b/src/summary/summary/core/locales/nl.pyindex d57e6cd5..3da0de7e 100644--- a/src/summary/summary/core/locales/nl.py+++ b/src/summary/summary/core/locales/nl.py@@ -25,6 +25,10 @@ Een paar punten die wij u aanraden te controleren:download_header_template=("\n*[Download hier je opname (externe link)]({download_link})*\n"),+ form_footer_template=(+ "\n\n*[Laat ons weten wat je van deze transcriptie vond "+ "(externe link)]({form_link})*\n"+ ),hallucination_replacement_text="[Tekst kon niet worden getranscribeerd]",document_default_title="Transcriptie",document_title_template=(diff --git a/src/summary/summary/core/locales/strings.py b/src/summary/summary/core/locales/strings.pyindex c182cfdf..77a20979 100644--- a/src/summary/summary/core/locales/strings.py+++ b/src/summary/summary/core/locales/strings.py@@ -10,6 +10,7 @@ class LocaleStrings:# transcript_formatter.pyempty_transcription: strdownload_header_template: str+ form_footer_template: strhallucination_replacement_text: strdocument_default_title: strdocument_title_template: strdiff --git a/src/summary/summary/core/transcript_formatter.py b/src/summary/summary/core/transcript_formatter.pyindex 4dec9e33..be1ff53e 100644--- a/src/summary/summary/core/transcript_formatter.py+++ b/src/summary/summary/core/transcript_formatter.py@@ -38,13 +38,14 @@ class TranscriptFormatter:return None- def format(+ def format( # noqa: PLR0913self,transcription,room: str | None = None,recording_datetime: str | None = None,owner_timezone: str | None = None,download_link: str | None = None,+ form_link: str | None = None,) -> Tuple[str, str]:"""Format transcription into the final document and its title."""segments = self._get_segments(transcription)@@ -55,6 +56,8 @@ class TranscriptFormatter:content = self._format_speaker(segments)content = self._remove_hallucinations(content)content = self._add_header(content, download_link)+ if form_link:+ content = self._add_footer(content, form_link)title = self._generate_title(room, recording_datetime, owner_timezone)@@ -93,9 +96,14 @@ class TranscriptFormatter:header = self._locale.download_header_template.format(download_link=download_link)- content = header + content+ return header + content- return content+ def _add_footer(self, content, form_link: str | None):+ if not form_link:+ return content++ footer = self._locale.form_footer_template.format(form_link=form_link)+ return content + footerdef _generate_title(self,diff --git a/src/summary/tests/api/test_api_tasks.py b/src/summary/tests/api/test_api_tasks.pyindex 07bffd1b..98ef066b 100644--- a/src/summary/tests/api/test_api_tasks.py+++ b/src/summary/tests/api/test_api_tasks.py@@ -27,6 +27,7 @@ class TestTasks:"owner_timezone": "UTC","language": None,"download_link": "https://example.com/file.mp4",+ "form_link": "https://satisfaction.com?room_id=test",},)