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:
parent
0d8f3be614
commit
b63f49241d
11 changed files with 82 additions and 13 deletions
36
backend/migrations/versions/tone0000000001_summary_tone.py
Normal file
36
backend/migrations/versions/tone0000000001_summary_tone.py
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
"""summary tone: summarize-in-a-different-voice support
|
||||
|
||||
Revision ID: tone0000000001
|
||||
Revises: m8models000001
|
||||
Create Date: 2026-09-15
|
||||
|
||||
- summaries.tone (voice the summary was written in; NULL = neutral)
|
||||
- processing_jobs.tone (pending request; survives sweep re-enqueue)
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Sequence
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
revision: str = "tone0000000001"
|
||||
down_revision: str | None = "m8models000001"
|
||||
branch_labels: str | Sequence[str] | None = None
|
||||
depends_on: str | Sequence[str] | None = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.add_column(
|
||||
"summaries",
|
||||
sa.Column("tone", sa.String(length=64), nullable=True),
|
||||
)
|
||||
op.add_column(
|
||||
"processing_jobs",
|
||||
sa.Column("tone", sa.String(length=64), nullable=True),
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_column("processing_jobs", "tone")
|
||||
op.drop_column("summaries", "tone")
|
||||
Loading…
Add table
Add a link
Reference in a new issue