Files
jianli-boss/client/config.py
T
2026-08-25 22:53:57 +08:00

60 lines
2.1 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""
客户端配置
"""
from pydantic_settings import BaseSettings
class ClientSettings(BaseSettings):
# -------------------------------------------------------
# 云端服务端地址
# -------------------------------------------------------
SERVER_URL: str = "http://127.0.0.1:8000"
# -------------------------------------------------------
# 本地 Web 控制面板
# -------------------------------------------------------
WEB_HOST: str = "127.0.0.1"
WEB_PORT: int = 8088
# -------------------------------------------------------
# 浏览器模式:chrome = 本机真实 Chrome/Edge(默认,免费)
# adspower = AdsPower 指纹浏览器
# -------------------------------------------------------
BROWSER_MODE: str = "chrome"
# chrome 模式:浏览器可执行文件路径(空=自动探测,优先 Chrome 其次 Edge)
BROWSER_PATH: str = ""
# chrome 模式:独立用户数据目录(空=默认 client/data/chrome_profile,持久化登录态)
BROWSER_PROFILE_DIR: str = ""
# chrome 模式:CDP 调试端口
BROWSER_DEBUG_PORT: int = 9222
# adspower 模式:本地 API 与 Profile ID
ADSPOWER_API_URL: str = "http://local.adspower.net:50325"
ADSPOWER_USER_ID: str = ""
# -------------------------------------------------------
# AI 大模型(OpenAI 兼容接口)
# -------------------------------------------------------
AI_BASE_URL: str = "https://api.deepseek.com"
AI_MODEL: str = "deepseek-chat"
AI_API_KEY: str = "" # 建议通过环境变量 AI_API_KEY 注入
AI_MIN_SCORE: int = 65
# -------------------------------------------------------
# Token 持久化路径
# -------------------------------------------------------
TOKEN_FILE: str = "client/.token"
# -------------------------------------------------------
# 心跳(秒):需小于服务端在线窗口(90s)
# -------------------------------------------------------
HEARTBEAT_INTERVAL: int = 30
class Config:
env_file = "client/.env"
env_file_encoding = "utf-8"
client_settings = ClientSettings()