diff --git a/src/components/chat-view/chat-input/ModeSelect.tsx b/src/components/chat-view/chat-input/ModeSelect.tsx index dc17bb3..256b9a2 100644 --- a/src/components/chat-view/chat-input/ModeSelect.tsx +++ b/src/components/chat-view/chat-input/ModeSelect.tsx @@ -25,11 +25,11 @@ export function ModeSelect() { const getShortcutText = (slug: string) => { switch (slug) { case 'write': - return 'Cmd+Shift+.' + return 'Ctrl+Shift+.' case 'ask': - return 'Cmd+Shift+,' + return 'Ctrl+Shift+,' case 'research': - return 'Cmd+Shift+/' + return 'Ctrl+Shift+/' default: return null } diff --git a/src/components/chat-view/chat-input/ModelSelect.tsx b/src/components/chat-view/chat-input/ModelSelect.tsx index 53da8f7..0e3c331 100644 --- a/src/components/chat-view/chat-input/ModelSelect.tsx +++ b/src/components/chat-view/chat-input/ModelSelect.tsx @@ -1,6 +1,6 @@ import * as DropdownMenu from '@radix-ui/react-dropdown-menu' import Fuse, { FuseResult } from 'fuse.js' -import { Brain, ChevronDown, ChevronUp, Star } from 'lucide-react' +import { ChevronDown, ChevronUp, Star } from 'lucide-react' import { useEffect, useMemo, useRef, useState } from 'react' import { useSettings } from '../../../contexts/SettingsContext' @@ -12,28 +12,12 @@ import { GetAllProviders, GetProviderModelIds } from "../../../utils/api" const getOptimizedModelName = (modelId: string): string => { if (!modelId) return modelId; - // 移除常见的前缀 - let optimized = modelId - .replace(/^(anthropic\/|openai\/|google\/|meta\/|microsoft\/|huggingface\/|mistral\/|cohere\/|ai21\/|together\/|perplexity\/|groq\/|deepseek\/|qwen\/|alibaba\/|baichuan\/|chatglm\/|yi\/|moonshot\/|zhipu\/|minimax\/|sensetime\/|iflytek\/|tencent\/|baidu\/|bytedance\/|netease\/|360\/|xunfei\/|spark\/|ernie\/|wenxin\/|tongyi\/|claude\/|gpt-|llama-|gemini-|palm-|bard-|codex-|davinci-|curie-|babbage-|ada-)/i, '') - // 移除版本号和日期 - .replace(/(-v?\d+(\.\d+)*(-\w+)?|:\d+(\.\d+)*|@\d+(\.\d+)*|-\d{4}-\d{2}-\d{2}|-\d{8}|-latest|-preview|-beta|-alpha|-rc\d*|-instruct|-chat|-base|-turbo|-16k|-32k|-128k)$/i, '') - // 移除多余的连字符和下划线 - .replace(/[-_]+/g, '-') - .replace(/^-+|-+$/g, ''); - - // 如果优化后的名称太短或为空,返回原始名称的简化版本 - if (optimized.length < 3) { - // 尝试提取主要部分 - const parts = modelId.split(/[\/\-_:@]/); - optimized = parts.find(part => part.length >= 3) || modelId; - } - // 限制长度,如果太长则截断并添加省略号 - if (optimized.length > 25) { - optimized = optimized.substring(0, 22) + '...'; + if (modelId.length > 25) { + return modelId.substring(0, 22) + '...'; } - return optimized; + return modelId; }; type TextSegment = { @@ -317,7 +301,7 @@ export function ModelSelect() { >