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
54cf870d
Commit
54cf870d
authored
Jul 21, 2023
by
金伟强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: show intro logic problem
parent
efbc8468
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
index.tsx
web/app/components/app/chat/index.tsx
+4
-4
index.tsx
web/app/components/explore/universal-chat/index.tsx
+1
-2
No files found.
web/app/components/app/chat/index.tsx
View file @
54cf870d
...
@@ -46,6 +46,7 @@ export type IChatProps = {
...
@@ -46,6 +46,7 @@ export type IChatProps = {
suggestionList
?:
string
[]
suggestionList
?:
string
[]
isShowSpeechToText
?:
boolean
isShowSpeechToText
?:
boolean
answerIconClassName
?:
string
answerIconClassName
?:
string
isShowConfigElem
?:
boolean
}
}
const
Chat
:
FC
<
IChatProps
>
=
({
const
Chat
:
FC
<
IChatProps
>
=
({
...
@@ -69,6 +70,7 @@ const Chat: FC<IChatProps> = ({
...
@@ -69,6 +70,7 @@ const Chat: FC<IChatProps> = ({
suggestionList
,
suggestionList
,
isShowSpeechToText
,
isShowSpeechToText
,
answerIconClassName
,
answerIconClassName
,
isShowConfigElem
,
})
=>
{
})
=>
{
const
{
t
}
=
useTranslation
()
const
{
t
}
=
useTranslation
()
const
{
notify
}
=
useContext
(
ToastContext
)
const
{
notify
}
=
useContext
(
ToastContext
)
...
@@ -145,13 +147,11 @@ const Chat: FC<IChatProps> = ({
...
@@ -145,13 +147,11 @@ const Chat: FC<IChatProps> = ({
})
})
}
}
const
hasChatStart
=
chatList
.
some
(
item
=>
!
item
.
isAnswer
)
return
(
return
(
<
div
className=
{
cn
(
'px-3.5'
,
'h-full'
)
}
>
<
div
className=
{
cn
(
'px-3.5'
,
'h-full'
)
}
>
{
!
hasChatStart
&&
(
configElem
||
null
)
}
{
isShowConfigElem
&&
(
configElem
||
null
)
}
{
/* Chat List */
}
{
/* Chat List */
}
<
div
className=
{
cn
((
!
hasChatStart
&&
configElem
)
?
'h-0'
:
'h-full'
,
'space-y-[30px]'
)
}
>
<
div
className=
{
cn
((
isShowConfigElem
&&
configElem
)
?
'h-0'
:
'h-full'
,
'space-y-[30px]'
)
}
>
{
chatList
.
map
((
item
)
=>
{
{
chatList
.
map
((
item
)
=>
{
if
(
item
.
isAnswer
)
{
if
(
item
.
isAnswer
)
{
const
isLast
=
item
.
id
===
chatList
[
chatList
.
length
-
1
].
id
const
isLast
=
item
.
id
===
chatList
[
chatList
.
length
-
1
].
id
...
...
web/app/components/explore/universal-chat/index.tsx
View file @
54cf870d
...
@@ -472,7 +472,6 @@ const Main: FC<IMainProps> = () => {
...
@@ -472,7 +472,6 @@ const Main: FC<IMainProps> = () => {
setAbortController
(
abortController
)
setAbortController
(
abortController
)
},
},
onData
:
(
message
:
string
,
isFirstMessage
:
boolean
,
{
conversationId
:
newConversationId
,
messageId
,
taskId
}:
any
)
=>
{
onData
:
(
message
:
string
,
isFirstMessage
:
boolean
,
{
conversationId
:
newConversationId
,
messageId
,
taskId
}:
any
)
=>
{
// console.log('get message...')
responseItem
.
content
=
responseItem
.
content
+
message
responseItem
.
content
=
responseItem
.
content
+
message
responseItem
.
id
=
messageId
responseItem
.
id
=
messageId
if
(
isFirstMessage
&&
newConversationId
)
if
(
isFirstMessage
&&
newConversationId
)
...
@@ -511,7 +510,6 @@ const Main: FC<IMainProps> = () => {
...
@@ -511,7 +510,6 @@ const Main: FC<IMainProps> = () => {
},
},
onThought
(
thought
)
{
onThought
(
thought
)
{
// thought then start to return message
// thought then start to return message
// console.log('thought...');
(
responseItem
as
any
).
agent_thoughts
.
push
(
thought
)
(
responseItem
as
any
).
agent_thoughts
.
push
(
thought
)
},
},
onError
()
{
onError
()
{
...
@@ -626,6 +624,7 @@ const Main: FC<IMainProps> = () => {
...
@@ -626,6 +624,7 @@ const Main: FC<IMainProps> = () => {
)
}
)
}
<
div
className=
{
cn
((
!
isNewConversation
||
isResponsing
)
&&
'pt-[90px]'
,
'pc:w-[794px] max-w-full mobile:w-full mx-auto h-full overflow-y-auto'
)
}
ref=
{
chatListDomRef
}
>
<
div
className=
{
cn
((
!
isNewConversation
||
isResponsing
)
&&
'pt-[90px]'
,
'pc:w-[794px] max-w-full mobile:w-full mx-auto h-full overflow-y-auto'
)
}
ref=
{
chatListDomRef
}
>
<
Chat
<
Chat
isShowConfigElem=
{
isNewConversation
&&
!
chatList
.
some
(
item
=>
item
.
isAnswer
)
}
configElem=
{
<
Init
configElem=
{
<
Init
modelId=
{
modelId
}
modelId=
{
modelId
}
onModelChange=
{
setModeId
}
onModelChange=
{
setModeId
}
...
...
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