Summarize tone: re-summarize in a chosen voice (backend)

POST /reprocess?job=summarize&tone=<voice> persists the voice on the job
row (queue carries only ids, so a sweep re-enqueue keeps it), the LLM
prompt appends 'write every field in a <tone> tone — the tone colors
the wording, never the facts', and the resulting summary records its
tone (SummaryOut.tone). Plain re-summarize clears a previous tone.
Migration tone0000000001 (summaries.tone, processing_jobs.tone).
78 passed, 1 skipped; ruff clean.
This commit is contained in:
avi 2026-09-15 14:24:36 -05:00
commit b63f49241d
11 changed files with 82 additions and 13 deletions

View file

@ -95,7 +95,7 @@ class FakeLlm:
self.fail = fail
self.seen = []
async def summarize(self, transcript, *, title=None):
async def summarize(self, transcript, *, title=None, tone=None):
self.seen.append(transcript)
if self.fail is not None:
raise self.fail

View file

@ -131,7 +131,7 @@ async def test_user_edit_survives_auto_pipeline(client, monkeypatch):
class FakeLlm:
name = "fake-llm"
async def summarize(self, transcript, *, title=None):
async def summarize(self, transcript, *, title=None, tone=None):
return SummaryResult(short="s", detailed="d", key_points=(),
decisions=(), action_items=(), questions=(),
model="fake-llm-1")