Skip to content

Commit e7ed4a0

Browse files
committed
📝(backend) move and improve summary method documentation
1 parent 463afb1 commit e7ed4a0

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

src/summary/summary/core/celery_worker.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
broker=settings.celery_broker_url,
5959
backend=settings.celery_result_backend,
6060
broker_connection_retry_on_startup=True,
61-
# To store the tasks args too in results and make the
61+
# To store the tasks args too in results and make the
6262
# V2 API work
6363
result_extended=True,
6464
)
@@ -309,7 +309,13 @@ def task_failure_handler(task_id, exception=None, **kwargs):
309309
def summarize_transcription_internals(
310310
*, owner_id: str, transcript: str, session_id: str
311311
) -> str:
312-
"""Generate a summary from the provided transcription text."""
312+
"""Generate a summary from the provided transcription text.
313+
314+
1. Uses an LLM to generate a TL;DR summary of the transcription.
315+
2. Breaks the transcription into parts and summarizes each part.
316+
3. Cleans up the combined summary
317+
4. Generates next steps.
318+
"""
313319
logger.info(
314320
"Starting summarization task | Owner: %s",
315321
owner_id,
@@ -391,11 +397,8 @@ def summarize_transcription(
391397
"""Generate a summary from the provided transcription text.
392398
393399
This Celery task performs the following operations:
394-
1. Uses an LLM to generate a TL;DR summary of the transcription.
395-
2. Breaks the transcription into parts and summarizes each part.
396-
3. Cleans up the combined summary
397-
4. Generates next steps.
398-
5. Sends the final summary via webhook.
400+
1. Run summary internals
401+
2. Sends the final summary via webhook.
399402
"""
400403
summary = summarize_transcription_internals(
401404
owner_id=owner_id, transcript=transcript, session_id=self.request.id
@@ -521,11 +524,8 @@ def summarize_v2_task(
521524
"""Generate a summary from the provided content.
522525
523526
This Celery task performs the following operations:
524-
1. Uses an LLM to generate a TL;DR summary of the content.
525-
2. Breaks the content into parts and summarizes each part.
526-
3. Cleans up the combined summary
527-
4. Generates next steps.
528-
5. Sends the final summary via webhook.
527+
1. Run summary internals
528+
2. Sends the final summary via webhook.
529529
"""
530530
payload = SummarizeTaskV2Payload.model_validate(payload)
531531
summary = summarize_transcription_internals(

src/summary/summary/core/webhook_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def call_webhook_v2(
102102
) -> None:
103103
"""Call webhook with a payload to a specific tenant.
104104
105-
Request is performed wihtout retry, retry should be handled at the task level.
105+
Request is performed without retry, retry should be handled at the task level.
106106
"""
107107
tenant = settings.get_authorized_tenant(tenant_id=tenant_id)
108108

0 commit comments

Comments
 (0)