Skip to content

Commit

Permalink
fix: 模型名后面标注一下服务商 #557
Browse files Browse the repository at this point in the history
  • Loading branch information
kangfenmao committed Dec 27, 2024
1 parent 60931b8 commit ccb216e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion electron.vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default defineConfig({
}
},
optimizeDeps: {
exclude: []
exclude: ['chunk-QH6N6I7P.js', 'chunk-PB73W2YU.js']
}
}
})
2 changes: 1 addition & 1 deletion src/renderer/src/components/Popups/SelectModelPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const PopupContainer: React.FC<PopupContainerProps> = ({ model, resolve }) => {
.flatMap((p) => p.models || [])
.filter((m) => pinnedModels.includes(getModelUniqId(m)))
.map((m) => ({
key: getModelUniqId(m),
key: getModelUniqId(m) + '_pinned',
label: (
<ModelItem>
{m?.name} {isVisionModel(m) && <VisionIcon />}
Expand Down
6 changes: 5 additions & 1 deletion src/renderer/src/pages/home/components/SelectModelButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -34,7 +35,10 @@ const SelectModelButton: FC<Props> = ({ assistant }) => {
<DropdownButton size="small" type="default" onClick={onSelectModel}>
<ButtonContent>
<ModelAvatar model={model} size={20} />
<ModelName>{model ? model.name : t('button.select_model')}</ModelName>
<ModelName>
{model ? model.name : t('button.select_model')} |{' '}
{t(`provider.${model?.provider}`, { defaultValue: getProviderByModel(model)?.name })}
</ModelName>
{isVisionModel(model) && <VisionIcon style={{ marginLeft: 0 }} />}
</ButtonContent>
</DropdownButton>
Expand Down

0 comments on commit ccb216e

Please sign in to comment.