-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathconfig.py
More file actions
64 lines (48 loc) ยท 3.09 KB
/
config.py
File metadata and controls
64 lines (48 loc) ยท 3.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
"""
config.py - Centralised configuration for NeoFish.
All platform tokens and shared settings are loaded from environment variables
(or a .env file) in one place. Import individual values from here instead of
calling os.getenv() scattered throughout the codebase.
"""
import os
from pathlib import Path
from dotenv import load_dotenv
load_dotenv(override=True)
# โโ Core / LLM โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
ANTHROPIC_API_KEY: str = os.getenv("ANTHROPIC_API_KEY", "")
ANTHROPIC_BASE_URL: str = os.getenv("ANTHROPIC_BASE_URL", "https://api.anthropic.com")
MODEL_NAME: str = os.getenv("MODEL_NAME", "claude-3-7-sonnet-20250219")
TOKEN_THRESHOLD: int = int(os.getenv("TOKEN_THRESHOLD", "800000"))
MAX_TOKEN: int = int(os.getenv("MAX_TOKEN", "1000000"))
# โโ Storage โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
WORKDIR: Path = Path(os.getenv("WORKDIR", "./workspace")).resolve()
TRANSCRIPT_DIR: Path = Path(os.getenv("TRANSCRIPT_DIR", "./.transcripts")).resolve()
TASKS_DIR: Path = Path(os.getenv("TASKS_DIR", "./.tasks")).resolve()
BG_TASK_TIMEOUT: int = int(os.getenv("BG_TASK_TIMEOUT", "300"))
# โโ Web platform โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
WEB_HOST: str = os.getenv("WEB_HOST", "0.0.0.0")
WEB_PORT: int = int(os.getenv("WEB_PORT", "8000"))
# โโ QQ platform โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# WebSocket URL for NapCat / go-cqhttp (events and API calls).
# Example: QQ_WS_URL=ws://127.0.0.1:3001
QQ_WS_URL: str = os.getenv("QQ_WS_URL", "")
# Access token for NapCat / go-cqhttp (leave empty if not configured).
QQ_ACCESS_TOKEN: str = os.getenv("QQ_ACCESS_TOKEN", "")
# Comma-separated list of allowed QQ user / group IDs (empty = allow everyone).
_qq_allowed_raw: str = os.getenv("QQ_ALLOWED_IDS", "")
QQ_ALLOWED_IDS: list[str] = (
[u.strip() for u in _qq_allowed_raw.split(",") if u.strip()]
if _qq_allowed_raw
else []
)
# โโ Telegram platform โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# Obtain a token from @BotFather on Telegram.
TELEGRAM_BOT_TOKEN: str = os.getenv("TELEGRAM_BOT_TOKEN", "")
# Comma-separated list of allowed Telegram user IDs (empty = allow everyone).
# Example: TELEGRAM_ALLOWED_USERS=123456789,987654321
_telegram_allowed_raw: str = os.getenv("TELEGRAM_ALLOWED_USERS", "")
TELEGRAM_ALLOWED_USERS: list[str] = (
[u.strip() for u in _telegram_allowed_raw.split(",") if u.strip()]
if _telegram_allowed_raw
else []
)