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
d4ece25c
Commit
d4ece25c
authored
Jul 26, 2023
by
Joel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: new conversation not steaming and thinking can not be stopped
parent
b2160c71
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
9 deletions
+10
-9
index.tsx
web/app/components/app/chat/index.tsx
+2
-2
index.tsx
web/app/components/explore/universal-chat/index.tsx
+5
-4
index.tsx
web/app/components/share/chat/index.tsx
+3
-3
No files found.
web/app/components/app/chat/index.tsx
View file @
d4ece25c
...
@@ -49,7 +49,6 @@ export type IChatProps = {
...
@@ -49,7 +49,6 @@ export type IChatProps = {
isShowSpeechToText
?:
boolean
isShowSpeechToText
?:
boolean
answerIconClassName
?:
string
answerIconClassName
?:
string
isShowConfigElem
?:
boolean
isShowConfigElem
?:
boolean
isThoughting
?:
boolean
dataSets
?:
DataSet
[]
dataSets
?:
DataSet
[]
}
}
...
@@ -183,7 +182,8 @@ const Chat: FC<IChatProps> = ({
...
@@ -183,7 +182,8 @@ const Chat: FC<IChatProps> = ({
{
{
!
isHideSendInput
&&
(
!
isHideSendInput
&&
(
<
div
className=
{
cn
(
!
feedbackDisabled
&&
'!left-3.5 !right-3.5'
,
'absolute z-10 bottom-0 left-0 right-0'
)
}
>
<
div
className=
{
cn
(
!
feedbackDisabled
&&
'!left-3.5 !right-3.5'
,
'absolute z-10 bottom-0 left-0 right-0'
)
}
>
{
(
isResponsing
&&
canStopResponsing
)
&&
(
{
/* Thinking is sync and can not be stopped */
}
{
(
isResponsing
&&
canStopResponsing
&&
!!
chatList
[
chatList
.
length
-
1
]?.
content
)
&&
(
<
div
className=
'flex justify-center mb-4'
>
<
div
className=
'flex justify-center mb-4'
>
<
Button
className=
'flex items-center space-x-1 bg-white'
onClick=
{
()
=>
abortResponsing
?.()
}
>
<
Button
className=
'flex items-center space-x-1 bg-white'
onClick=
{
()
=>
abortResponsing
?.()
}
>
{
stopIcon
}
{
stopIcon
}
...
...
web/app/components/explore/universal-chat/index.tsx
View file @
d4ece25c
...
@@ -466,7 +466,8 @@ const Main: FC<IMainProps> = () => {
...
@@ -466,7 +466,8 @@ const Main: FC<IMainProps> = () => {
isAnswer
:
true
,
isAnswer
:
true
,
}
}
let
tempNewConversationId
=
''
const
prevTempNewConversationId
=
getCurrConversationId
()
||
'-1'
let
tempNewConversationId
=
prevTempNewConversationId
setHasStopResponded
(
false
)
setHasStopResponded
(
false
)
setResponsingTrue
()
setResponsingTrue
()
...
@@ -485,9 +486,8 @@ const Main: FC<IMainProps> = () => {
...
@@ -485,9 +486,8 @@ const Main: FC<IMainProps> = () => {
tempNewConversationId
=
newConversationId
tempNewConversationId
=
newConversationId
setMessageTaskId
(
taskId
)
setMessageTaskId
(
taskId
)
// has switched to other conversation
// has switched to other conversation
if
(
t
empNewConversationId
!==
getCurrConversationId
())
{
if
(
prevT
empNewConversationId
!==
getCurrConversationId
())
{
setIsResponsingConCurrCon
(
false
)
setIsResponsingConCurrCon
(
false
)
return
return
}
}
...
@@ -530,7 +530,8 @@ const Main: FC<IMainProps> = () => {
...
@@ -530,7 +530,8 @@ const Main: FC<IMainProps> = () => {
responseItem
.
id
=
thought
.
message_id
;
responseItem
.
id
=
thought
.
message_id
;
(
responseItem
as
any
).
agent_thoughts
=
[...(
responseItem
as
any
).
agent_thoughts
,
thought
]
// .push(thought)
(
responseItem
as
any
).
agent_thoughts
=
[...(
responseItem
as
any
).
agent_thoughts
,
thought
]
// .push(thought)
// has switched to other conversation
// has switched to other conversation
if
(
tempNewConversationId
!==
getCurrConversationId
())
{
if
(
prevTempNewConversationId
!==
getCurrConversationId
())
{
setIsResponsingConCurrCon
(
false
)
setIsResponsingConCurrCon
(
false
)
return
return
}
}
...
...
web/app/components/share/chat/index.tsx
View file @
d4ece25c
...
@@ -461,8 +461,8 @@ const Main: FC<IMainProps> = ({
...
@@ -461,8 +461,8 @@ const Main: FC<IMainProps> = ({
content
:
''
,
content
:
''
,
isAnswer
:
true
,
isAnswer
:
true
,
}
}
const
prevTempNewConversationId
=
getCurrConversationId
()
||
'-1'
let
tempNewConversationId
=
''
let
tempNewConversationId
=
prevTempNewConversationId
setHasStopResponded
(
false
)
setHasStopResponded
(
false
)
setResponsingTrue
()
setResponsingTrue
()
...
@@ -480,7 +480,7 @@ const Main: FC<IMainProps> = ({
...
@@ -480,7 +480,7 @@ const Main: FC<IMainProps> = ({
setMessageTaskId
(
taskId
)
setMessageTaskId
(
taskId
)
// has switched to other conversation
// has switched to other conversation
if
(
t
empNewConversationId
!==
getCurrConversationId
())
{
if
(
prevT
empNewConversationId
!==
getCurrConversationId
())
{
setIsResponsingConCurrCon
(
false
)
setIsResponsingConCurrCon
(
false
)
return
return
}
}
...
...
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