From ccb216e76abaf942979f20c66968ec6c6216a1ca Mon Sep 17 00:00:00 2001 From: kangfenmao Date: Fri, 27 Dec 2024 17:22:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A8=A1=E5=9E=8B=E5=90=8D=E5=90=8E?= =?UTF-8?q?=E9=9D=A2=E6=A0=87=E6=B3=A8=E4=B8=80=E4=B8=8B=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=95=86=20#557?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- electron.vite.config.ts | 2 +- src/renderer/src/components/Popups/SelectModelPopup.tsx | 2 +- .../src/pages/home/components/SelectModelButton.tsx | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/electron.vite.config.ts b/electron.vite.config.ts index 88fe6e500..f25f7da29 100644 --- a/electron.vite.config.ts +++ b/electron.vite.config.ts @@ -50,7 +50,7 @@ export default defineConfig({ } }, optimizeDeps: { - exclude: [] + exclude: ['chunk-QH6N6I7P.js', 'chunk-PB73W2YU.js'] } } }) diff --git a/src/renderer/src/components/Popups/SelectModelPopup.tsx b/src/renderer/src/components/Popups/SelectModelPopup.tsx index bc444fbac..a3e137cf1 100644 --- a/src/renderer/src/components/Popups/SelectModelPopup.tsx +++ b/src/renderer/src/components/Popups/SelectModelPopup.tsx @@ -115,7 +115,7 @@ const PopupContainer: React.FC = ({ model, resolve }) => { .flatMap((p) => p.models || []) .filter((m) => pinnedModels.includes(getModelUniqId(m))) .map((m) => ({ - key: getModelUniqId(m), + key: getModelUniqId(m) + '_pinned', label: ( {m?.name} {isVisionModel(m) && } diff --git a/src/renderer/src/pages/home/components/SelectModelButton.tsx b/src/renderer/src/pages/home/components/SelectModelButton.tsx index 00a1f4eb2..ab2da4b64 100644 --- a/src/renderer/src/pages/home/components/SelectModelButton.tsx +++ b/src/renderer/src/pages/home/components/SelectModelButton.tsx @@ -4,6 +4,7 @@ import SelectModelPopup from '@renderer/components/Popups/SelectModelPopup' import { isLocalAi } from '@renderer/config/env' import { isVisionModel } from '@renderer/config/models' import { useAssistant } from '@renderer/hooks/useAssistant' +import { getProviderByModel } from '@renderer/services/AssistantService' import { Assistant } from '@renderer/types' import { Button } from 'antd' import { FC } from 'react' @@ -34,7 +35,10 @@ const SelectModelButton: FC = ({ assistant }) => { - {model ? model.name : t('button.select_model')} + + {model ? model.name : t('button.select_model')} |{' '} + {t(`provider.${model?.provider}`, { defaultValue: getProviderByModel(model)?.name })} + {isVisionModel(model) && }