Skip to content

Commit

Permalink
feat: show provider in mesage
Browse files Browse the repository at this point in the history
  • Loading branch information
duanyongcheng77 authored and kangfenmao committed Feb 17, 2025
1 parent 266f909 commit 09a347c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/renderer/src/services/ModelService.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import store from '@renderer/store'
import { Model } from '@renderer/types'
import { t } from 'i18next'
import { pick } from 'lodash'

export const getModelUniqId = (m?: Model) => {
Expand All @@ -17,5 +18,8 @@ export const hasModel = (m?: Model) => {
}

export function getModelName(model?: Model) {
return model?.name || model?.id || ''
const provider = store.getState().llm.providers.find((p) => p.id === model?.provider)
const modelName = model?.name || model?.id || ''
const providerName = provider?.isSystem ? t(`provider.${provider.id}`) : provider?.name
return `${modelName} | ${providerName}`
}

0 comments on commit 09a347c

Please sign in to comment.