MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / getDB

Function getDB

sum/sum.ts:109–150  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

107 aiConfig: {
108 providers: {
109 openai: {
110 name: "OpenAI",
111 base_url: "https://api.openai.com",
112 api_key: "",
113 model: "gpt-4o",
114 type: "openai"
115 },
116 gemini: {
117 name: "Gemini",
118 base_url: "https://generativelanguage.googleapis.com",
119 api_key: "",
120 model: "gemini-2.0-flash",
121 type: "gemini"
122 }
123 },
124 default_provider: "openai",
125 default_prompt: "请总结以下群聊消息的主要内容,提取关键话题和重要信息:",
126 default_spoiler: false
127 }
128 });
129
130 // 兼容旧数据
131 if (!db.data.aiConfig) {
132 db.data.aiConfig = {
133 providers: {},
134 default_provider: "openai",
135 default_prompt: "请总结以下群聊消息的主要内容,提取关键话题和重要信息:"
136 };
137 }
138
139 if (!db.data.aiConfig.providers) {
140 db.data.aiConfig.providers = {};
141 }
142
143 return db;
144}
145
146function toInt(value: any): number | undefined {
147 const n = Number(value);
148 return Number.isFinite(n) ? Math.trunc(n) : undefined;
149}
150
151function makeCronKey(id: string) {
152 return `sum:${id}`;
153}

Callers 5

summarizeMessagesFunction · 0.70
executeSummaryFunction · 0.70
scheduleTaskFunction · 0.70
bootstrapTasksFunction · 0.70
SummaryPluginClass · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected