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
bb7a02c6
Commit
bb7a02c6
authored
Jul 14, 2023
by
Joel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add claude model list
parent
20514ff2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
index.tsx
web/app/components/app/configuration/config-model/index.tsx
+16
-2
app.ts
web/types/app.ts
+5
-0
No files found.
web/app/components/app/configuration/config-model/index.tsx
View file @
bb7a02c6
...
...
@@ -9,7 +9,7 @@ import ParamItem from './param-item'
import
Radio
from
'@/app/components/base/radio'
import
Panel
from
'@/app/components/base/panel'
import
type
{
CompletionParams
}
from
'@/models/debug'
import
{
AppType
}
from
'@/types/app'
import
{
AppType
,
ProviderType
}
from
'@/types/app'
import
{
TONE_LIST
}
from
'@/config'
import
Toast
from
'@/app/components/base/toast'
import
{
AlertTriangle
}
from
'@/app/components/base/icons/src/vender/solid/alertsAndFeedback'
...
...
@@ -29,12 +29,26 @@ const options = [
{
id
:
'gpt-3.5-turbo'
,
name
:
'gpt-3.5-turbo'
,
type
:
AppType
.
chat
},
{
id
:
'gpt-3.5-turbo-16k'
,
name
:
'gpt-3.5-turbo-16k'
,
type
:
AppType
.
chat
},
{
id
:
'gpt-4'
,
name
:
'gpt-4'
,
type
:
AppType
.
chat
},
// 8k version
{
id
:
'claude-instant-1'
,
name
:
'claude-instant-1'
,
type
:
AppType
.
chat
,
provide
:
ProviderType
.
anthropic
},
// set 30k
{
id
:
'claude-2'
,
name
:
'claude-2'
,
type
:
AppType
.
chat
,
provide
:
ProviderType
.
anthropic
},
// set 30k
{
id
:
'gpt-3.5-turbo'
,
name
:
'gpt-3.5-turbo'
,
type
:
AppType
.
completion
},
{
id
:
'gpt-3.5-turbo-16k'
,
name
:
'gpt-3.5-turbo-16k'
,
type
:
AppType
.
completion
},
{
id
:
'text-davinci-003'
,
name
:
'text-davinci-003'
,
type
:
AppType
.
completion
},
{
id
:
'gpt-4'
,
name
:
'gpt-4'
,
type
:
AppType
.
completion
},
// 8k version
{
id
:
'claude-instant-1'
,
name
:
'claude-instant-1'
,
type
:
AppType
.
completion
,
provide
:
ProviderType
.
anthropic
},
// set 30k
{
id
:
'claude-2'
,
name
:
'claude-2'
,
type
:
AppType
.
completion
,
provide
:
ProviderType
.
anthropic
},
// set 30k
]
const
getMaxToken
=
(
modelId
:
string
)
=>
{
if
([
'claude-instant-1'
,
'claude-2'
].
includes
(
modelId
))
return
30
*
1000
if
([
'gpt-4'
,
'gpt-3.5-turbo-16k'
].
includes
(
modelId
))
return
8000
return
4000
}
const
ModelIcon
=
({
className
}:
{
className
?:
string
})
=>
(
<
svg
className=
{
`w-4 h-4 ${className}`
}
width=
"20"
height=
"20"
viewBox=
"0 0 20 20"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<
rect
width=
"20"
height=
"20"
rx=
"6"
fill=
"black"
/>
...
...
@@ -99,7 +113,7 @@ const ConifgModel: FC<IConifgModelProps> = ({
key
:
'max_tokens'
,
tip
:
t
(
'common.model.params.maxTokenTip'
),
step
:
100
,
max
:
(
modelId
===
'gpt-4'
||
modelId
===
'gpt-3.5-turbo-16k'
)
?
8000
:
4000
,
max
:
getMaxToken
(
modelId
)
,
},
]
...
...
web/types/app.ts
View file @
bb7a02c6
export
enum
ProviderType
{
openai
=
'openai'
,
anthropic
=
'anthropic'
,
}
export
enum
AppType
{
'chat'
=
'chat'
,
'completion'
=
'completion'
,
...
...
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