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
ee2857de
Commit
ee2857de
authored
Jul 12, 2023
by
John Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: chat histories not exists
parent
3afb0192
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
structured_chat.py
api/core/agent/agent/structured_chat.py
+3
-2
No files found.
api/core/agent/agent/structured_chat.py
View file @
ee2857de
...
...
@@ -70,7 +70,7 @@ class AutoSummarizingStructuredChatAgent(StructuredChatAgent, CalcTokenMixin):
raise
ExceededLLMTokensLimitError
(
error_msg
)
summary_handler
=
SummarizerMixin
(
llm
=
self
.
summary_llm
)
if
self
.
moving_summary_buffer
:
if
self
.
moving_summary_buffer
and
'chat_history'
in
kwargs
:
kwargs
[
"chat_history"
]
.
pop
()
self
.
moving_summary_buffer
=
summary_handler
.
predict_new_summary
(
...
...
@@ -78,6 +78,7 @@ class AutoSummarizingStructuredChatAgent(StructuredChatAgent, CalcTokenMixin):
existing_summary
=
self
.
moving_summary_buffer
)
kwargs
[
"chat_history"
]
.
append
(
AIMessage
(
content
=
self
.
moving_summary_buffer
))
if
'chat_history'
in
kwargs
:
kwargs
[
"chat_history"
]
.
append
(
AIMessage
(
content
=
self
.
moving_summary_buffer
))
return
self
.
get_full_inputs
([
intermediate_steps
[
-
1
]],
**
kwargs
)
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