docs(podcasts): tighten comments and docstrings

This commit is contained in:
CREDO23 2026-06-10 20:51:59 +02:00
parent bae59140a6
commit b7604167d8
8 changed files with 21 additions and 31 deletions

View file

@ -1,8 +1,7 @@
"""Podcast generation: brief resolution, transcript drafting, and audio rendering.
"""Podcast feature: brief resolution, transcript drafting, and audio rendering.
The public surface grows as the module is built. For now it owns the
``podcasts`` table model, which :mod:`app.db` re-exports so existing
``from app.db import Podcast`` call sites keep working during the migration.
Owns the ``podcasts`` table model, which :mod:`app.db` re-exports so existing
``from app.db import Podcast`` imports keep resolving.
"""
from __future__ import annotations

View file

@ -1,9 +1,4 @@
"""HTTP API for the podcast lifecycle.
The router is mounted at cutover (replacing the legacy podcast routes); it is
kept separate here so it can be wired in one step without colliding with the old
routes during parallel development.
"""
"""HTTP API for the podcast lifecycle."""
from __future__ import annotations

View file

@ -1,8 +1,7 @@
"""Generation: the LLM-driven brief and transcript controlled graphs.
"""Generation: the controlled graphs that produce a brief and a transcript.
Two small graphs hold all the intelligence: ``brief`` proposes a reviewable spec
(language detection + resolution), and ``transcript`` drafts long-form dialogue
outline-first. Everything else in the podcast pipeline is deterministic.
``brief`` proposes a reviewable spec from deterministic defaults; ``transcript``
is the LLM-driven step, drafting long-form dialogue outline-first.
"""
from __future__ import annotations

View file

@ -1,9 +1,8 @@
"""Parse a model's reply into a Pydantic shape, tolerating chatty output.
Agent LLMs return JSON wrapped in prose, markdown fences, or reasoning blocks.
This mirrors the legacy podcaster's resilient parsing — strip fences, then fall
back to the outermost ``{...}`` span so every generation node validates the
reply the same way instead of repeating ad-hoc parsing.
Agent LLMs return JSON wrapped in prose, markdown fences, or reasoning blocks,
so a plain ``model_validate_json`` is unreliable. Centralising the tolerant
parse here keeps every generation node validating replies the same way.
"""
from __future__ import annotations

View file

@ -1,9 +1,8 @@
"""Transcript-drafting task: DRAFTING -> AWAITING_REVIEW.
The expensive, LLM-heavy step, so it runs under ``billable_call`` exactly like
the legacy generator. The API has already moved the row to DRAFTING and stored
the approved brief; this task drafts the long-form transcript and opens the
go/no-go gate.
The expensive, LLM-heavy step, so it runs under ``billable_call``. The API has
already moved the row to DRAFTING and stored the approved brief; this task
drafts the long-form transcript and opens the go/no-go gate.
"""
from __future__ import annotations

View file

@ -16,8 +16,8 @@ from ..request import SynthesisRequest
# Hosted providers return MP3-encoded bytes from ``aspeech``.
_CONTAINER = "mp3"
# Matches the legacy podcaster timeouts; long single segments still finish well
# under this, and retries cover transient upstream failures.
# A long single segment still finishes well under this; retries absorb transient
# upstream failures without failing the whole render.
_TIMEOUT_SECONDS = 600
_MAX_RETRIES = 2

View file

@ -1,8 +1,7 @@
"""Voices: the catalog of selectable TTS voices and the active provider.
Replaces the legacy hardcoded speaker-id voice maps. Callers obtain the
catalog via :func:`get_voice_catalog` and identify the configured provider via
:func:`provider_from_service`.
Callers obtain the catalog via :func:`get_voice_catalog` and identify the
configured provider via :func:`provider_from_service`.
"""
from __future__ import annotations

View file

@ -1,9 +1,9 @@
"""The voice catalog: look up and filter selectable voices.
A :class:`VoiceCatalog` is the single source of truth for which voices exist,
replacing the hardcoded speaker-id maps. Resolution uses it to pick defaults
for a brief, the API exposes it as picker options, and the renderer uses it to
turn a stored ``voice_id`` back into the provider-native reference.
A :class:`VoiceCatalog` is the single source of truth for which voices exist.
Resolution uses it to pick defaults for a brief, the API exposes it as picker
options, and the renderer uses it to turn a stored ``voice_id`` back into the
provider-native reference.
"""
from __future__ import annotations