Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
6bcafdbc
Unverified
Commit
6bcafdbc
authored
Nov 07, 2023
by
zxhlyh
Committed by
GitHub
Nov 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: openai model name (#1474)
parent
059c089f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
14 deletions
+5
-14
model-name.tsx
.../components/app/configuration/config-model/model-name.tsx
+2
-11
index.tsx
...eader/account-setting/model-page/model-selector/index.tsx
+3
-3
No files found.
web/app/components/app/configuration/config-model/model-name.tsx
View file @
6bcafdbc
'use client'
'use client'
import
type
{
FC
}
from
'react'
import
type
{
FC
}
from
'react'
import
React
from
'react'
import
React
from
'react'
import
{
useTranslation
}
from
'react-i18next'
export
type
IModelNameProps
=
{
export
type
IModelNameProps
=
{
modelId
:
string
modelId
:
string
...
@@ -16,19 +15,11 @@ export const supportI18nModelName = [
...
@@ -16,19 +15,11 @@ export const supportI18nModelName = [
]
]
const
ModelName
:
FC
<
IModelNameProps
>
=
({
const
ModelName
:
FC
<
IModelNameProps
>
=
({
modelId
,
modelDisplayName
,
modelDisplayName
,
})
=>
{
})
=>
{
const
{
t
}
=
useTranslation
()
let
name
=
modelId
if
(
supportI18nModelName
.
includes
(
modelId
))
name
=
t
(
`common.modelName.
${
modelId
}
`
)
else
if
(
modelDisplayName
)
name
=
modelDisplayName
return
(
return
(
<
span
title=
{
n
ame
}
>
<
span
title=
{
modelDisplayN
ame
}
>
{
n
ame
}
{
modelDisplayN
ame
}
</
span
>
</
span
>
)
)
}
}
...
...
web/app/components/header/account-setting/model-page/model-selector/index.tsx
View file @
6bcafdbc
...
@@ -13,7 +13,7 @@ import { XCircle } from '@/app/components/base/icons/src/vender/solid/general'
...
@@ -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
{
AlertCircle
}
from
'@/app/components/base/icons/src/vender/line/alertsAndFeedback'
import
Tooltip
from
'@/app/components/base/tooltip'
import
Tooltip
from
'@/app/components/base/tooltip'
import
ModelIcon
from
'@/app/components/app/configuration/config-model/model-icon'
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
ProviderName
from
'@/app/components/app/configuration/config-model/provider-name'
import
{
useProviderContext
}
from
'@/context/provider-context'
import
{
useProviderContext
}
from
'@/context/provider-context'
import
ModelModeTypeLabel
from
'@/app/components/app/configuration/config-model/model-mode-type-label'
import
ModelModeTypeLabel
from
'@/app/components/app/configuration/config-model/model-mode-type-label'
...
@@ -75,8 +75,8 @@ const ModelSelector: FC<Props> = ({
...
@@ -75,8 +75,8 @@ const ModelSelector: FC<Props> = ({
return
{}
return
{}
const
res
:
Record
<
string
,
string
>
=
{}
const
res
:
Record
<
string
,
string
>
=
{}
modelList
.
forEach
(({
model_name
})
=>
{
modelList
.
forEach
(({
model_name
,
model_display_name
})
=>
{
res
[
model_name
]
=
supportI18nModelName
.
includes
(
model_name
)
?
t
(
`common.modelName.
${
model_name
}
`
)
:
model
_name
res
[
model_name
]
=
model_display
_name
})
})
return
res
return
res
})()
})()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment