Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: openai model name (#1474)

zxhlyh6bcafdbc8729
diff --git a/web/app/components/app/configuration/config-model/model-name.tsx b/web/app/components/app/configuration/config-model/model-name.tsx
index efc4a800b4e..123960edb90 100644
--- a/web/app/components/app/configuration/config-model/model-name.tsx
+++ b/web/app/components/app/configuration/config-model/model-name.tsx
@@ -1,7 +1,6 @@
'use client'
import type { FC } from 'react'
import React from 'react'
-import { useTranslation } from 'react-i18next'
export type IModelNameProps = {
modelId: string
@@ -16,19 +15,11 @@ export const supportI18nModelName = [
]
const ModelName: FC<IModelNameProps> = ({
- modelId,
modelDisplayName,
}) => {
- const { t } = useTranslation()
- let name = modelId
- if (supportI18nModelName.includes(modelId))
- name = t(`common.modelName.${modelId}`)
- else if (modelDisplayName)
- name = modelDisplayName
-
return (
- <span title={name}>
- {name}
+ <span title={modelDisplayName}>
+ {modelDisplayName}
</span>
)
}
diff --git a/web/app/components/header/account-setting/model-page/model-selector/index.tsx b/web/app/components/header/account-setting/model-page/model-selector/index.tsx
index 326f4a3a936..ce6f806052b 100644
--- a/web/app/components/header/account-setting/model-page/model-selector/index.tsx
+++ b/web/app/components/header/account-setting/model-page/model-selector/index.tsx
@@ -13,7 +13,7 @@ import { XCircle } from '@/app/components/base/icons/src/vender/solid/general'
import { AlertCircle } from '@/app/components/base/icons/src/vender/line/alertsAndFeedback'
import Tooltip from '@/app/components/base/tooltip'
import ModelIcon from '@/app/components/app/configuration/config-model/model-icon'
-import ModelName, { supportI18nModelName } from '@/app/components/app/configuration/config-model/model-name'
+import ModelName from '@/app/components/app/configuration/config-model/model-name'
import ProviderName from '@/app/components/app/configuration/config-model/provider-name'
import { useProviderContext } from '@/context/provider-context'
import ModelModeTypeLabel from '@/app/components/app/configuration/config-model/model-mode-type-label'
@@ -75,8 +75,8 @@ const ModelSelector: FC<Props> = ({
return {}
const res: Record<string, string> = {}
- modelList.forEach(({ model_name }) => {
- res[model_name] = supportI18nModelName.includes(model_name) ? t(`common.modelName.${model_name}`) : model_name
+ modelList.forEach(({ model_name, model_display_name }) => {
+ res[model_name] = model_display_name
})
return res
})()