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

Function handleModelList

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

Source from the content-addressed store, hash-verified

1378}
1379
1380async function handleModelList(msg: Api.Message): Promise<void> {
1381 await msg.edit({ text: "🔍 获取可用模型..." });
1382
1383 try {
1384 const client = await getGeminiClient();
1385 const models = await client.listModels();
1386
1387 const modelText = `<b>可用模型:</b>\n\n${models.map(model => `• <code>${model}</code>`).join("\n")}`;
1388 await msg.edit({ text: modelText, parseMode: "html" });
1389 } catch (error: any) {
1390 await msg.edit({ text: Utils.handleError(error, '获取模型') });
1391 }
1392}
1393
1394async function handleContextClear(msg: Api.Message): Promise<void> {
1395 ConfigManager.set(CONFIG_KEYS.GEMINI_CHAT_HISTORY, "[]");

Callers 1

handleModelFunction · 0.85

Calls 4

getGeminiClientFunction · 0.85
listModelsMethod · 0.80
editMethod · 0.45
handleErrorMethod · 0.45

Tested by

no test coverage detected