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
d59cf7fa
Commit
d59cf7fa
authored
Jul 25, 2023
by
Joel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: selected model icon
parent
36c84fb2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
index.tsx
...ents/explore/universal-chat/config/model-config/index.tsx
+11
-4
index.tsx
web/app/components/explore/universal-chat/index.tsx
+1
-1
No files found.
web/app/components/explore/universal-chat/config/model-config/index.tsx
View file @
d59cf7fa
...
...
@@ -7,7 +7,7 @@ import { ChevronDownIcon } from '@heroicons/react/24/outline'
import
{
useTranslation
}
from
'react-i18next'
import
ModelIcon
from
'@/app/components/app/configuration/config-model/model-icon'
import
{
UNIVERSAL_CHAT_MODEL_LIST
as
MODEL_LIST
}
from
'@/config'
import
{
Checked
as
CheckedIcon
}
from
'@/app/components/base/icons/src/public/model'
export
type
IModelConfigProps
=
{
modelId
:
string
onChange
?:
(
model
:
string
)
=>
void
...
...
@@ -32,17 +32,24 @@ const ModelConfig: FC<IModelConfigProps> = ({
<
div
className=
'flex items-center justify-between h-[52px] px-3 rounded-xl bg-gray-50'
>
<
div
className=
'text-sm font-semibold text-gray-800'
>
{
t
(
'explore.universalChat.model'
)
}
</
div
>
<
div
className=
"relative z-10"
>
<
div
ref=
{
triggerRef
}
onClick=
{
()
=>
!
readonly
&&
toogleOption
()
}
className=
{
cn
(
readonly
?
'cursor-not-allowed'
:
'cursor-pointer'
,
'flex items-center h-9 px-3 space-x-2 rounded-lg bg-gray-50 '
)
}
>
<
div
ref=
{
triggerRef
}
onClick=
{
()
=>
!
readonly
&&
toogleOption
()
}
className=
{
cn
(
readonly
?
'cursor-not-allowed'
:
'cursor-pointer'
,
'flex items-center h-9 px-3 space-x-2 rounded-lg'
,
isShowOption
&&
'bg-gray-100'
,
)
}
>
<
ModelIcon
modelId=
{
currModel
?.
id
as
string
}
/>
<
div
className=
"text-sm gray-900"
>
{
currModel
?.
name
}
</
div
>
{
!
readonly
&&
<
ChevronDownIcon
className=
{
cn
(
isShowOption
&&
'rotate-180'
,
'w-[14px] h-[14px] text-gray-500'
)
}
/>
}
</
div
>
{
isShowOption
&&
(
<
div
className=
{
cn
(
'
min-w-[159px] absolute right-0 bg-gray-50
rounded-lg shadow'
)
}
>
<
div
className=
{
cn
(
'
absolute top-10 right-0 bg-white
rounded-lg shadow'
)
}
>
{
MODEL_LIST
.
map
(
item
=>
(
<
div
key=
{
item
.
id
}
onClick=
{
()
=>
onChange
?.(
item
.
id
)
}
className=
"
flex items-center h-9 px-3
rounded-lg cursor-pointer hover:bg-gray-100"
>
<
div
key=
{
item
.
id
}
onClick=
{
()
=>
onChange
?.(
item
.
id
)
}
className=
"
w-[232px] flex items-center h-9 px-4
rounded-lg cursor-pointer hover:bg-gray-100"
>
<
ModelIcon
className=
'shrink-0 mr-2'
modelId=
{
item
?.
id
}
/>
<
div
className=
"text-sm gray-900 whitespace-nowrap"
>
{
item
.
name
}
</
div
>
{
(
item
.
id
===
currModel
?.
id
)
&&
<
CheckedIcon
className=
'absolute right-4'
/>
}
</
div
>
))
}
</
div
>
...
...
web/app/components/explore/universal-chat/index.tsx
View file @
d59cf7fa
...
...
@@ -40,7 +40,7 @@ import ConfigSummary from '@/app/components/explore/universal-chat/config-view/s
import
ConfigDetail
from
'@/app/components/explore/universal-chat/config-view/detail'
import
{
fetchDatasets
}
from
'@/service/datasets'
const
APP_ID
=
'universal-chat'
const
DEFAULT_MODEL_ID
=
'
claude-2
'
// gpt-4, claude-2
const
DEFAULT_MODEL_ID
=
'
gpt-3.5-turbo
'
// gpt-4, claude-2
const
DEFAULT_PLUGIN
=
{
google_search
:
false
,
web_reader
:
true
,
...
...
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