Remove unused config fields

This commit is contained in:
Thales Maciel 2026-02-07 15:45:10 -03:00
parent bb7780c461
commit 7b1e94f6d7
2 changed files with 7 additions and 31 deletions

View file

@ -17,21 +17,16 @@ class Config:
whisper_model: str = "base"
whisper_lang: str = "en"
whisper_device: str = "cpu"
whisper_extra_args: str = ""
whisper_timeout_sec: int = 300
record_timeout_sec: int = 120
segment_sec: int = 5
streaming: bool = False
injection_backend: str = "clipboard"
ai_enabled: bool = False
ai_provider: str = "ollama"
ai_model: str = "llama3.2:3b"
ai_temperature: float = 0.0
ai_system_prompt_file: str = ""
ai_base_url: str = "http://localhost:11434"
ai_base_url: str = "http://localhost:11434/v1/chat/completions"
ai_api_key: str = ""
ai_timeout_sec: int = 20
@ -56,16 +51,8 @@ def load(path: str | None) -> Config:
cfg.whisper_lang = os.environ["WHISPER_LANG"]
if os.getenv("WHISPER_DEVICE"):
cfg.whisper_device = os.environ["WHISPER_DEVICE"]
if os.getenv("WHISPER_EXTRA_ARGS"):
cfg.whisper_extra_args = os.environ["WHISPER_EXTRA_ARGS"]
if os.getenv("WHISPER_FFMPEG_IN"):
cfg.ffmpeg_input = os.environ["WHISPER_FFMPEG_IN"]
if os.getenv("WHISPER_STREAM"):
cfg.streaming = _parse_bool(os.environ["WHISPER_STREAM"])
if os.getenv("WHISPER_SEGMENT_SEC"):
cfg.segment_sec = int(os.environ["WHISPER_SEGMENT_SEC"])
if os.getenv("WHISPER_TIMEOUT_SEC"):
cfg.whisper_timeout_sec = int(os.environ["WHISPER_TIMEOUT_SEC"])
if os.getenv("LEL_FFMPEG_PATH"):
cfg.ffmpeg_path = os.environ["LEL_FFMPEG_PATH"]
@ -78,8 +65,6 @@ def load(path: str | None) -> Config:
if os.getenv("LEL_AI_ENABLED"):
cfg.ai_enabled = _parse_bool(os.environ["LEL_AI_ENABLED"])
if os.getenv("LEL_AI_PROVIDER"):
cfg.ai_provider = os.environ["LEL_AI_PROVIDER"]
if os.getenv("LEL_AI_MODEL"):
cfg.ai_model = os.environ["LEL_AI_MODEL"]
if os.getenv("LEL_AI_TEMPERATURE"):
@ -97,9 +82,6 @@ def load(path: str | None) -> Config:
raise ValueError("hotkey cannot be empty")
if cfg.record_timeout_sec <= 0:
raise ValueError("record_timeout_sec must be > 0")
if cfg.whisper_timeout_sec <= 0:
raise ValueError("whisper_timeout_sec must be > 0")
return cfg