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

Function handleSettings

outdated/gemini/gemini.ts:1356–1378  ·  view source on GitHub ↗
(msg: Api.Message)

Source from the content-addressed store, hash-verified

1354}
1355
1356async function handleSettings(msg: Api.Message): Promise<void> {
1357 const switchToText = (value: string): string => value === "on" ? "开启" : "关闭";
1358 const tokensToText = (value: string): string => value === "0" ? "无限制" : value;
1359
1360 const settings = {
1361 "基础 URL": Utils.censorUrl(getConfig(CONFIG_KEYS.GEMINI_BASE_URL)),
1362 "聊天模型": getConfig(CONFIG_KEYS.GEMINI_CHAT_MODEL),
1363 "搜索模型": getConfig(CONFIG_KEYS.GEMINI_SEARCH_MODEL),
1364 "图片模型": getConfig(CONFIG_KEYS.GEMINI_IMAGE_MODEL),
1365 "TTS模型": getConfig(CONFIG_KEYS.GEMINI_TTS_MODEL),
1366 "TTS语音": getConfig(CONFIG_KEYS.GEMINI_TTS_VOICE),
1367 "最大Token数": tokensToText(getConfig(CONFIG_KEYS.GEMINI_MAX_TOKENS)),
1368 "上下文启用": switchToText(getConfig(CONFIG_KEYS.GEMINI_CONTEXT_ENABLED)),
1369 "Telegraph启用": switchToText(getConfig(CONFIG_KEYS.GEMINI_TELEGRAPH_ENABLED)),
1370 "折叠引用": switchToText(getConfig(CONFIG_KEYS.GEMINI_COLLAPSIBLE_QUOTE_ENABLED))
1371 };
1372
1373 const settingsText = "<b>Gemini 设置:</b>\n\n" + Object.entries(settings)
1374 .map(([key, value]) => `<b>• ${key}:</b> <code>${value}</code>`)
1375 .join("\n");
1376
1377 await msg.edit({ text: settingsText, parseMode: "html" });
1378}
1379
1380async function handleModelList(msg: Api.Message): Promise<void> {
1381 await msg.edit({ text: "🔍 获取可用模型..." });

Callers 1

handleGeminiRequestFunction · 0.85

Calls 5

tokensToTextFunction · 0.85
switchToTextFunction · 0.85
censorUrlMethod · 0.80
getConfigFunction · 0.70
editMethod · 0.45

Tested by

no test coverage detected