SurfSense/surfsense_backend/app/podcasts/generation/transcript/config.py
CREDO23 7fb0707933 refactor(backend): rename search_space -> workspace across app bulk (Phase 2 Wave D)
Scoped codemod over surfsense_backend/app (excluding routes/, Wave E): renames
search_space_id -> workspace_id, search_space -> workspace, SearchSpace -> Workspace
across services, utils, tasks, agents, gateway, event_bus, notifications, podcasts,
automations, observability params, and prompt .md files. Also flips the camelCase
payload key searchSpaceId -> workspaceId (no backend reader; hard cutover).

Preserved carve-outs (verbatim): Celery task names "delete_search_space_background"
and "ai_sort_search_space" (wire names), and the OTel/metric key "search_space.id"
(dashboards depend on it). Enum values 'SEARCH_SPACE' and SearchSourceConnector
untouched.
2026-06-26 18:30:47 +02:00

26 lines
761 B
Python

"""Configurable inputs for the transcript-drafting graph."""
from __future__ import annotations
from dataclasses import dataclass, fields
from langchain_core.runnables import RunnableConfig
from app.podcasts.schemas import PodcastSpec
@dataclass(kw_only=True)
class TranscriptConfig:
"""The approved spec and user focus that drive drafting."""
workspace_id: int
spec: PodcastSpec
focus: str | None = None
@classmethod
def from_runnable_config(
cls, config: RunnableConfig | None = None
) -> TranscriptConfig:
configurable = (config.get("configurable") or {}) if config else {}
names = {f.name for f in fields(cls) if f.init}
return cls(**{k: v for k, v in configurable.items() if k in names})