diff --git a/app/shared/config.py b/app/shared/config.py new file mode 100644 index 0000000..3eeb3b8 --- /dev/null +++ b/app/shared/config.py @@ -0,0 +1,24 @@ +from pydantic_settings import BaseSettings + + +class Settings(BaseSettings): + db_path: str = "/data/linkedstorm.db" + clips_dir: str = "/data/clips" + speaches_url: str = "http://192.168.86.150:8000" + ollama_url: str = "http://192.168.86.150:11434" + ollama_model: str = "qwen2.5:14b" + livekit_url: str = "ws://192.168.86.150:7880" + livekit_api_key: str = "devkey" + livekit_api_secret: str = "devsecret" + pipeline_internal_url: str = "http://linkedstorm-pipeline:8300" + clip_retention_days: int = 30 + speaker_known_threshold: float = 0.85 + speaker_ambiguous_threshold: float = 0.60 + vad_silence_ms: int = 600 + vad_min_speech_ms: int = 500 + + model_config = {"env_file": ".env", "env_file_encoding": "utf-8"} + + +def get_settings() -> Settings: + return Settings() diff --git a/app/shared/models.py b/app/shared/models.py new file mode 100644 index 0000000..e7d5089 --- /dev/null +++ b/app/shared/models.py @@ -0,0 +1,54 @@ +from dataclasses import dataclass +from datetime import datetime +from typing import Optional + + +@dataclass +class Room: + id: int + name: str + device_label: Optional[str] + is_active: bool + last_seen: Optional[datetime] + created_at: datetime + + +@dataclass +class Speaker: + id: int + name: str + created_at: datetime + updated_at: datetime + + +@dataclass +class VoiceEmbedding: + id: int + speaker_id: int + embedding: bytes # packed float32 + audio_sample: Optional[bytes] + created_at: datetime + + +@dataclass +class Utterance: + id: int + room_id: int + speaker_id: Optional[int] + transcript: str + embedding: Optional[bytes] + match_status: str # known | unknown | ambiguous | unreviewed + match_confidence: Optional[float] + start_time: datetime + end_time: datetime + audio_clip_path: Optional[str] + livekit_room: Optional[str] + created_at: datetime + + +@dataclass +class DailySummary: + id: int + date: str # YYYY-MM-DD + summary_text: str + generated_at: datetime