import os from pathlib import Path from pydantic_settings import BaseSettings from typing import ClassVar, Optional class Settings(BaseSettings): """Uygulama genelinde kullanılan ayarlar.""" # Temel ayarlar ENVIRONMENT: str = "production" DEBUG: bool = False ENCRYPTION_KEY: str = os.environ.get("ENCRYPTION_KEY", "your-secret-key-here") API_PREFIX: str = "/api/v1" # Hugging Face ayarları HF_TOKEN: str = "" # Hugging Face API token'ı HF_CACHE_DIR: Path = Path("/root/.cache/huggingface") # Hugging Face cache dizini # ASR ve Diarization ayarları ASR_MODEL: str = "small" # Whisper model (tiny, base, small, medium, large-v3) DIARIZATION_MODEL: str = "pyannote/speaker-diarization-3.0" # İşlem ayarları ANONYMIZE_DATA: bool = True ENHANCE_AUDIO: bool = True # Dosya ayarları MAX_UPLOAD_SIZE: int = 25 * 1024 * 1024 # 25 MB ALLOWED_EXTENSIONS: set[str] = {"wav", "mp3", "m4a", "ogg"} # Dil ayarları LANGUAGE: str = "tr" SPACY_MODEL: str = "tr_core_news_sm" # Küçük Türkçe model # Özel tıbbi terimler dosyası MEDICAL_TERMS_FILE: str = "medical_terms.json" # Diarization ayarları MIN_SPEAKER_DURATION: float = 1.0 MAX_SPEAKERS: int = 5 SAMPLE_RATE: int = 16000 # Cache ayarları CACHE_DIR: Path = Path("/tmp/voice_to_write_cache") class Config: env_file = ".env" env_file_encoding = "utf-8" settings = Settings()