From dd5e789e359fa1cf409778c43657d668b29d5cd9 Mon Sep 17 00:00:00 2001 From: Metona Fix Date: Mon, 6 Apr 2026 19:05:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=A8=A1=E5=9E=8B=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=A1=86=E9=80=89=E9=A1=B9=E6=98=BE=E7=A4=BA=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 每个模型选项文字后追加能力标记: - 🧠 Think(支持思考推理) - 👁️ Vision(支持图片理解) - 🔧 Tools(支持工具调用) 示例:qwen3:8b · 5.2GB 🧠🔧 --- src/renderer/components/model-bar.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/renderer/components/model-bar.ts b/src/renderer/components/model-bar.ts index 69ba749..f467475 100644 --- a/src/renderer/components/model-bar.ts +++ b/src/renderer/components/model-bar.ts @@ -70,6 +70,7 @@ export async function loadModels(): Promise { .forEach(m => { const opt = document.createElement('option'); opt.value = m.name; + opt.dataset.size = String(m.size || 0); const diskSize = formatSize(m.size || 0); opt.textContent = diskSize ? `${m.name} · ${diskSize}` : m.name; modelSelectEl.appendChild(opt); @@ -91,6 +92,21 @@ export async function loadModels(): Promise { } } +/** 根据能力为下拉框选项添加图标标记 */ +function updateOptionIcons(): void { + for (const opt of Array.from(modelSelectEl.options)) { + const caps = modelCapabilityCache.get(opt.value); + if (!caps) continue; + const diskSize = opt.dataset.size ? formatSize(parseInt(opt.dataset.size)) : ''; + const base = diskSize ? `${opt.value} · ${diskSize}` : opt.value; + const icons: string[] = []; + if (caps.think) icons.push('🧠'); + if (caps.vision) icons.push('👁️'); + if (caps.tools) icons.push('🔧'); + opt.textContent = icons.length > 0 ? `${base} ${icons.join('')}` : base; + } +} + async function filterEmbedModels(models: Array<{ name: string }>): Promise { const api = state.get(KEYS.API); if (!api) return; @@ -113,6 +129,8 @@ async function filterEmbedModels(models: Array<{ name: string }>): Promise } catch { /* ignore */ } } + updateOptionIcons(); + if (!modelSelectEl.value && modelSelectEl.options.length > 0) { modelSelectEl.value = modelSelectEl.options[0].value; state.set('_defaultModel', modelSelectEl.value);