Spaces:
Sleeping
Sleeping
Gemini CLI commited on
Commit ·
97e9ef1
1
Parent(s): c60e994
Fix SyntaxError in config.py
Browse files- app/core/config.py +61 -2
app/core/config.py
CHANGED
|
@@ -12,13 +12,72 @@ class Settings(BaseSettings):
|
|
| 12 |
|
| 13 |
# API Configuration
|
| 14 |
API_ENDPOINT: str = "https://chat.z.ai/api/v2/chat/completions"
|
| 15 |
-
|
| 16 |
# Authentication
|
| 17 |
AUTH_TOKEN: Optional[str] = os.getenv("AUTH_TOKEN")
|
| 18 |
|
| 19 |
# Token Pool Configuration
|
| 20 |
TOKEN_FAILURE_THRESHOLD: int = int(
|
| 21 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
# Admin Panel Authentication
|
| 23 |
ADMIN_PASSWORD: str = os.getenv("ADMIN_PASSWORD", "admin123")
|
| 24 |
SESSION_SECRET_KEY: str = os.getenv(
|
|
|
|
| 12 |
|
| 13 |
# API Configuration
|
| 14 |
API_ENDPOINT: str = "https://chat.z.ai/api/v2/chat/completions"
|
| 15 |
+
|
| 16 |
# Authentication
|
| 17 |
AUTH_TOKEN: Optional[str] = os.getenv("AUTH_TOKEN")
|
| 18 |
|
| 19 |
# Token Pool Configuration
|
| 20 |
TOKEN_FAILURE_THRESHOLD: int = int(
|
| 21 |
+
os.getenv("TOKEN_FAILURE_THRESHOLD", "3")
|
| 22 |
+
)
|
| 23 |
+
TOKEN_RECOVERY_TIMEOUT: int = int(
|
| 24 |
+
os.getenv("TOKEN_RECOVERY_TIMEOUT", "1800")
|
| 25 |
+
)
|
| 26 |
+
TOKEN_AUTO_IMPORT_ENABLED: bool = (
|
| 27 |
+
os.getenv("TOKEN_AUTO_IMPORT_ENABLED", "false").lower() == "true"
|
| 28 |
+
)
|
| 29 |
+
TOKEN_AUTO_IMPORT_SOURCE_DIR: str = os.getenv("TOKEN_AUTO_IMPORT_SOURCE_DIR", "")
|
| 30 |
+
TOKEN_AUTO_IMPORT_INTERVAL: int = int(
|
| 31 |
+
os.getenv("TOKEN_AUTO_IMPORT_INTERVAL", "300")
|
| 32 |
+
)
|
| 33 |
+
TOKEN_AUTO_MAINTENANCE_ENABLED: bool = (
|
| 34 |
+
os.getenv("TOKEN_AUTO_MAINTENANCE_ENABLED", "false").lower() == "true"
|
| 35 |
+
)
|
| 36 |
+
TOKEN_AUTO_MAINTENANCE_INTERVAL: int = int(
|
| 37 |
+
os.getenv("TOKEN_AUTO_MAINTENANCE_INTERVAL", "1800")
|
| 38 |
+
)
|
| 39 |
+
TOKEN_AUTO_REMOVE_DUPLICATES: bool = (
|
| 40 |
+
os.getenv("TOKEN_AUTO_REMOVE_DUPLICATES", "true").lower() == "true"
|
| 41 |
+
)
|
| 42 |
+
TOKEN_AUTO_HEALTH_CHECK: bool = (
|
| 43 |
+
os.getenv("TOKEN_AUTO_HEALTH_CHECK", "true").lower() == "true"
|
| 44 |
+
)
|
| 45 |
+
TOKEN_AUTO_DELETE_INVALID: bool = (
|
| 46 |
+
os.getenv("TOKEN_AUTO_DELETE_INVALID", "false").lower() == "true"
|
| 47 |
+
)
|
| 48 |
+
|
| 49 |
+
# Model Configuration
|
| 50 |
+
GLM45_MODEL: str = os.getenv("GLM45_MODEL", "GLM-4.5")
|
| 51 |
+
GLM45_THINKING_MODEL: str = os.getenv("GLM45_THINKING_MODEL", "GLM-4.5-Thinking")
|
| 52 |
+
GLM45_SEARCH_MODEL: str = os.getenv("GLM45_SEARCH_MODEL", "GLM-4.5-Search")
|
| 53 |
+
GLM45_AIR_MODEL: str = os.getenv("GLM45_AIR_MODEL", "GLM-4.5-Air")
|
| 54 |
+
GLM46V_MODEL: str = os.getenv("GLM46V_MODEL", "GLM-4.6V")
|
| 55 |
+
GLM5_MODEL: str = os.getenv("GLM5_MODEL", "GLM-5")
|
| 56 |
+
GLM47_MODEL: str = os.getenv("GLM47_MODEL", "GLM-4.7")
|
| 57 |
+
GLM47_THINKING_MODEL: str = os.getenv("GLM47_THINKING_MODEL", "GLM-4.7-Thinking")
|
| 58 |
+
GLM47_SEARCH_MODEL: str = os.getenv("GLM47_SEARCH_MODEL", "GLM-4.7-Search")
|
| 59 |
+
GLM47_ADVANCED_SEARCH_MODEL: str = os.getenv(
|
| 60 |
+
"GLM47_ADVANCED_SEARCH_MODEL",
|
| 61 |
+
"GLM-4.7-advanced-search",
|
| 62 |
+
)
|
| 63 |
+
|
| 64 |
+
# Server Configuration
|
| 65 |
+
LISTEN_PORT: int = int(os.getenv("LISTEN_PORT", "8080"))
|
| 66 |
+
DEBUG_LOGGING: bool = os.getenv("DEBUG_LOGGING", "true").lower() == "true"
|
| 67 |
+
SERVICE_NAME: str = os.getenv("SERVICE_NAME", "api-proxy-server")
|
| 68 |
+
ROOT_PATH: str = os.getenv("ROOT_PATH", "")
|
| 69 |
+
|
| 70 |
+
ANONYMOUS_MODE: bool = os.getenv("ANONYMOUS_MODE", "true").lower() == "true"
|
| 71 |
+
GUEST_POOL_SIZE: int = int(os.getenv("GUEST_POOL_SIZE", "3"))
|
| 72 |
+
TOOL_SUPPORT: bool = os.getenv("TOOL_SUPPORT", "true").lower() == "true"
|
| 73 |
+
SCAN_LIMIT: int = int(os.getenv("SCAN_LIMIT", "200000"))
|
| 74 |
+
SKIP_AUTH_TOKEN: bool = os.getenv("SKIP_AUTH_TOKEN", "false").lower() == "true"
|
| 75 |
+
|
| 76 |
+
# Proxy Configuration
|
| 77 |
+
HTTP_PROXY: Optional[str] = os.getenv("HTTP_PROXY")
|
| 78 |
+
HTTPS_PROXY: Optional[str] = os.getenv("HTTPS_PROXY")
|
| 79 |
+
SOCKS5_PROXY: Optional[str] = os.getenv("SOCKS5_PROXY")
|
| 80 |
+
|
| 81 |
# Admin Panel Authentication
|
| 82 |
ADMIN_PASSWORD: str = os.getenv("ADMIN_PASSWORD", "admin123")
|
| 83 |
SESSION_SECRET_KEY: str = os.getenv(
|