Repository navigation
Expand file tree
/
Copy path.env.example
More file actions
121 lines (105 loc) · 4.94 KB
/
Copy path.env.example
File metadata and controls
121 lines (105 loc) · 4.94 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# === AI Backend: "claude" | "deepseek" | "openai" ===
AI_BACKEND=deepseek
# === Claude / Anthropic (only needed if AI_BACKEND=claude) ===
ANTHROPIC_API_KEY=
# Anthropic API Base URL (可填兼容代理/中转服务)
ANTHROPIC_BASE_URL=https://api.anthropic.com
# Model: claude-haiku-4-5-20251001 (fast/cheap) or claude-sonnet-4-5-20250929 (better quality)
SUMMARIZE_MODEL=claude-haiku-4-5-20251001
# === DeepSeek (only needed if AI_BACKEND=deepseek) ===
# 在此填入你的 DeepSeek API Key: https://platform.deepseek.com/api_keys
DEEPSEEK_API_KEY=
# DeepSeek API Base URL (可填 OpenAI-compatible 代理/中转服务)
DEEPSEEK_BASE_URL=https://api.deepseek.com
# 模型: deepseek-v4-flash (推荐, 极速/极低价格) 或 deepseek-v4-pro (1M上下文, 旗舰)
DEEPSEEK_MODEL=deepseek-v4-flash
# === OpenAI 兼容 (only needed if AI_BACKEND=openai) ===
# 任意 OpenAI 兼容服务商: OpenAI / GLM(智谱) / Moonshot / Qwen 等。
OPENAI_API_KEY=
# Base URL,GLM 填 https://open.bigmodel.cn/api/paas/v4/,OpenAI 官方填 https://api.openai.com/v1
OPENAI_BASE_URL=https://api.openai.com/v1
# 模型名,如 gpt-4o-mini / glm-4-flash / moonshot-v1-8k
OPENAI_MODEL=gpt-4o-mini
# === WeChat 数据目录(可选,留空则自动检测)===
# 如果微信聊天记录不在默认路径(Documents\xwechat_files 或 Documents\WeChat Files),
# 请在此填写包含 wxid_* 文件夹的父目录绝对路径。
# 例如: D:\WeChatData 或 C:\Users\xxx\AppData\Roaming\Tencent\WeChat
WECHAT_DATA_DIR=
# === WeChat Backend ===
# Windows: wcdb. macOS: mac_hybrid (WeFlow WCDB read + Accessibility send) or mac_ui fallback.
WECHAT_BACKEND=wcdb
# Optional: override the detected macOS WeChat account data directory.
MAC_WEFLOW_DATA_DIR=
# macOS WeChat send shortcut: enter or cmd_enter.
MAC_WECHAT_SEND_SHORTCUT=enter
# Comma-separated group names. "*" = auto-discover all groups.
WECHAT_GROUPS=
# === Bot Identity ===
# Your bot's WeChat display name. Used for @mention detection.
BOT_DISPLAY_NAME=群聊小助手
# === Trigger Keywords ===
# Comma-separated. The bot also responds to @mentions regardless of keywords.
TRIGGER_KEYWORDS=总结一下,之前发了什么,错过了什么,summarize,what did i miss,聊天总结,帮我总结,前面说了什么,说了啥,发生了什么
# === Database ===
DB_PATH=data/messages.db
# === Features ===
# 趣味功能 — @机器人抽签,返回随机运势签文(true/false)
FUN_ENABLED=true
# === Feishu Knowledge Base ===
# 开启后,@机器人说“同步到飞书”等触发词会自动创建/维护一个多维表格知识库。
FEISHU_EXPORT_ENABLED=false
FEISHU_APP_ID=
FEISHU_APP_SECRET=
FEISHU_EXPORT_MODE=knowledge
FEISHU_EXPORT_WINDOW_HOURS=8
FEISHU_EXPORT_TRIGGER_KEYWORDS=同步到飞书,导出到飞书,写到飞书,沉淀到飞书
# 开启后,最近窗口消息数达到阈值时会无感自动沉淀,不回群消息。
FEISHU_AUTO_SYNC_ENABLED=false
FEISHU_AUTO_SYNC_MIN_MESSAGES=20
FEISHU_AUTO_SYNC_COOLDOWN_SEC=1800
FEISHU_KNOWLEDGE_BASE_NAME=webot 群聊沉淀
# 可选:指定飞书文件夹 token;留空则使用应用默认创建位置。
FEISHU_KNOWLEDGE_FOLDER_TOKEN=
# === Tuning ===
# Seconds between message polls (default: 1.0, increase for lower CPU usage)
POLL_INTERVAL_SEC=1.0
# Minimum seconds between trigger responses in the same chat (dedup)
DEDUP_WINDOW_SEC=60
# Max messages to include in summary prompt.
# For groups with 999+ messages, increase this value.
# The bot uses token estimation + automatic chunking (map-reduce) to handle
# very large conversations safely within the model's context window.
MAX_MESSAGES_FOR_SUMMARY=5000
# Messages per chunk when map-reduce is triggered (default: 400)
CHUNK_SIZE=400
# If requester has no prior message, or the detected window is too small,
# expand to this many hours (minimum summary window)
FALLBACK_WINDOW_HOURS=8
# === Welcome New Member ===
# Master switch — automatically send a welcome message when a new
# member joins a group chat. Templates and per-group settings are
# stored in data/welcome_templates.json.
WELCOME_ENABLED=false
# === Proactive Participation ===
# Master switch — enable autonomous chat participation without @mention
PROACTIVE_ENABLED=false
# Rate calculation window in seconds (default: 120 = 2 minutes)
PROACTIVE_RATE_WINDOW_SEC=120
# Message rate thresholds (msgs/min) for each mode.
# Calibrate by running: python tools/analyze_chat_rhythm.py
PROACTIVE_RATE_QUIET=1.5
PROACTIVE_RATE_CASUAL=4.0
PROACTIVE_RATE_LIVELY=6.5
PROACTIVE_RATE_BURST=8.5
# === Sticky Mention ===
# When a user sends @bot with no message text, the bot enters sticky
# listening mode. The user's next message in the same group is treated
# as if it were @mentioned (one-shot — consumed on first non-empty follow-up).
# Set to false to disable entirely.
STICKY_MENTION_ENABLED=true
# Max seconds to wait for the follow-up message after an empty @mention
STICKY_MENTION_TTL_SEC=60
# === Logging ===
LOG_LEVEL=INFO
# Optional log file (leave empty for console only)
LOG_FILE=data/bot.log