-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathconfig.py
More file actions
49 lines (38 loc) · 1.7 KB
/
config.py
File metadata and controls
49 lines (38 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from pathlib import Path
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
database_url: str = "postgresql://transcriber:transcriber@localhost:5433/transcriber"
redis_url: str = "redis://localhost:6380/0"
llm_provider: str = "openrouter" # "openrouter" or "ollama"
openrouter_api_key: str = ""
openrouter_model: str = "anthropic/claude-sonnet-4"
ollama_base_url: str = "http://localhost:11434"
ollama_model: str = "gemma3:1b"
whisper_cli_path: str = "../whisper.cpp/build/bin/whisper-cli"
whisper_model_path: str = "./models/kb_whisper_ggml_medium.bin"
whisper_small_model_path: str = "./models/kb_whisper_ggml_small.bin"
storage_path: str = "./storage"
hf_auth_token: str = ""
cors_origins: str = "" # Comma-separated, e.g. "http://localhost:3000,http://myapp.com"
# Live mode settings
live_chunk_overlap_seconds: float = 2.5
live_speaker_threshold: float = 0.45
live_min_segment_duration: float = 2.0
class Config:
env_file = ".env"
settings = Settings()
# Warn about missing critical config at import time
import logging as _logging
_config_log = _logging.getLogger(__name__)
if not settings.hf_auth_token:
_config_log.warning("HF_AUTH_TOKEN is not set — speaker diarization will not work")
if settings.llm_provider == "openrouter" and not settings.openrouter_api_key:
_config_log.warning("OPENROUTER_API_KEY is not set — LLM features will fail")
def get_storage_path() -> Path:
p = Path(settings.storage_path)
p.mkdir(parents=True, exist_ok=True)
return p
def get_meeting_path(meeting_id: str) -> Path:
p = get_storage_path() / meeting_id
p.mkdir(parents=True, exist_ok=True)
return p