41 lines
986 B
Python
41 lines
986 B
Python
from pydantic_settings import BaseSettings
|
|
from functools import lru_cache
|
|
from typing import Optional
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
telegram_bot_token: str = ""
|
|
telegram_proxy_url: Optional[str] = None
|
|
telegram_proxy_type: str = "socks5"
|
|
|
|
allowed_usernames: str = ""
|
|
bot_name: str = "Валера"
|
|
|
|
default_tool: str = "opencode"
|
|
qwen_command: str = "qwen-code"
|
|
opencode_command: str = "opencode"
|
|
tool_timeout: int = 120
|
|
|
|
memory_messages_count: int = 10
|
|
chroma_persist_dir: str = "./chroma_db"
|
|
|
|
scheduler_enabled: bool = True
|
|
idea_interval_hours: int = 4
|
|
|
|
stt_enabled: bool = True
|
|
stt_model: str = "vosk"
|
|
|
|
gigachat_credentials: Optional[str] = None
|
|
yandex_api_key: Optional[str] = None
|
|
|
|
database_url: str = "sqlite+aiosqlite:///./valera.db"
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
extra = "allow"
|
|
|
|
|
|
@lru_cache()
|
|
def get_settings() -> Settings:
|
|
return Settings()
|