- новый api/: /pipeline/process (yt-dlp, субтитры или Vosk, LLM/экстрактивная суммаризация), /videos, /llm; старый код перенесён в api_legacy/ - web/: Flet UI (flet 0.28.3 + flet-web, порт 8550) - Dockerfile.api: ffmpeg слоем из mwader/static-ffmpeg, pip с кэш-маунтом - requirements/pyproject: убраны moviepy, imageio-ffmpeg, битый asyncio - README с инструкцией запуска и загрузкой Vosk-модели Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
39 lines
1.4 KiB
Python
39 lines
1.4 KiB
Python
import os
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
DB_USER: str = os.getenv("DB_USER", "postgres")
|
|
DB_PASS: str = os.getenv("DB_PASS", "postgres")
|
|
DB_NAME: str = os.getenv("DB_NAME", "test_db")
|
|
DB_HOST: str = os.getenv("DB_HOST", "db")
|
|
DB_PORT: str = os.getenv("DB_PORT", "5432")
|
|
|
|
DEFAULT_VOSK_MODEL: str = os.getenv(
|
|
"DEFAULT_VOSK_MODEL", "models/vosk-model-small-ru-0.22"
|
|
)
|
|
SUBTITLE_LANGS: str = os.getenv("SUBTITLE_LANGS", "ru,en")
|
|
|
|
# External LLM (OpenAI-compatible). The LLM itself is NOT hosted in this container —
|
|
# point at any provider/proxy/local server that speaks /v1/chat/completions.
|
|
LLM_BASE_URL: str = os.getenv("LLM_BASE_URL", "")
|
|
LLM_API_KEY: str = os.getenv("LLM_API_KEY", "")
|
|
LLM_MODEL: str = os.getenv("LLM_MODEL", "")
|
|
LLM_TIMEOUT: int = int(os.getenv("LLM_TIMEOUT", "120"))
|
|
LLM_MAX_TOKENS: int = int(os.getenv("LLM_MAX_TOKENS", "1000"))
|
|
LLM_TEMPERATURE: float = float(os.getenv("LLM_TEMPERATURE", "0.3"))
|
|
|
|
@property
|
|
def database_url(self) -> str:
|
|
return (
|
|
f"postgresql+asyncpg://{self.DB_USER}:{self.DB_PASS}"
|
|
f"@{self.DB_HOST}:{self.DB_PORT}/{self.DB_NAME}"
|
|
)
|
|
|
|
@property
|
|
def subtitle_langs_list(self) -> list[str]:
|
|
return [x.strip() for x in self.SUBTITLE_LANGS.split(",") if x.strip()]
|
|
|
|
|
|
settings = Settings()
|