feat: optimize prompt caching and add Telegram push

Add system prompt caching, custom prompt, and Telegram push settings.

Co-authored-by: Jason <159670257+Jasonzhu1207@users.noreply.github.com>
This commit is contained in:
v0andJason committed 2026-04-06 09:56:11 +00:00
1 parent 7fa26b0716
commit cf40d3ad63
4 files changed
+253 -24

No files matched your search

+13 -1
View File
@@ -78,6 +78,14 @@ interface ConfigSchema {
aiInsightScanIntervalHours: number
/** 发送上下文时的最大消息条数 */
aiInsightContextCount: number
/** 自定义 system prompt,空字符串表示使用内置默认值 */
aiInsightSystemPrompt: string
/** 是否启用 Telegram 推送 */
aiInsightTelegramEnabled: boolean
/** Telegram Bot Token */
aiInsightTelegramToken: string
/** Telegram 接收 Chat ID,逗号分隔,支持多个 */
aiInsightTelegramChatIds: string
}
// 需要 safeStorage 加密的字段(普通模式)
@@ -162,7 +170,11 @@ export class ConfigService {
aiInsightWhitelist: [],
aiInsightCooldownMinutes: 120,
aiInsightScanIntervalHours: 4,
aiInsightContextCount: 40
aiInsightContextCount: 40,
aiInsightSystemPrompt: '',
aiInsightTelegramEnabled: false,
aiInsightTelegramToken: '',
aiInsightTelegramChatIds: ''
}
const storeOptions: any = {