# SPDX-License-Identifier: GPL-3.0-only """Pydantic models mirroring api/openapi.yaml. Keep the two in sync.""" from __future__ import annotations from enum import Enum from pydantic import BaseModel class SyncState(str, Enum): local = "local" uploaded = "uploaded" ingested = "ingested" transcribed = "transcribed" summarised = "summarised" class Recording(BaseModel): id: str device_id: str | None = None started_at: str duration_s: float sample_rate: int channels: int codec: str size_bytes: int | None = None sha256: str | None = None source: str = "device" sync_state: SyncState = SyncState.ingested transcript_ref: str | None = None summary_ref: str | None = None class RecordingPage(BaseModel): items: list[Recording] next_cursor: str | None = None class TranscriptSegment(BaseModel): start: float end: float text: str speaker: str | None = None class Transcript(BaseModel): recording_id: str language: str model: str text: str segments: list[TranscriptSegment] class Summary(BaseModel): recording_id: str model: str overview: str key_points: list[str] action_items: list[str]