39 lines
1.0 KiB
Python
39 lines
1.0 KiB
Python
|
|
from pathlib import Path
|
||
|
|
from pydantic_settings import BaseSettings
|
||
|
|
|
||
|
|
|
||
|
|
class Settings(BaseSettings):
|
||
|
|
api_key: str = "sk-your-api-key-here"
|
||
|
|
api_port: int = 8000
|
||
|
|
|
||
|
|
browser_headless: bool = False
|
||
|
|
doubao_url: str = "https://www.doubao.com/chat/"
|
||
|
|
doubao_model: str = "doubao-pro"
|
||
|
|
viewport_width: int = 1280
|
||
|
|
viewport_height: int = 720
|
||
|
|
|
||
|
|
data_dir: Path = Path("/app/data")
|
||
|
|
cookies_file: Path = Path("/app/data/cookies.json")
|
||
|
|
state_file: Path = Path("/app/data/browser_state.json")
|
||
|
|
|
||
|
|
response_timeout: int = 120
|
||
|
|
page_load_timeout: int = 30000
|
||
|
|
typing_delay_min: int = 30
|
||
|
|
typing_delay_max: int = 80
|
||
|
|
inter_message_delay: float = 0.5
|
||
|
|
|
||
|
|
log_level: str = "INFO"
|
||
|
|
|
||
|
|
vnc_port: int = 5900
|
||
|
|
novnc_port: int = 6080
|
||
|
|
vnc_view_only: bool = False
|
||
|
|
screen_width: int = 1280
|
||
|
|
screen_height: int = 720
|
||
|
|
screen_depth: int = 24
|
||
|
|
|
||
|
|
model_config = {"env_file": ".env", "env_file_encoding": "utf-8"}
|
||
|
|
|
||
|
|
|
||
|
|
settings = Settings()
|
||
|
|
settings.data_dir.mkdir(parents=True, exist_ok=True)
|