mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-06-03 10:53:59 +08:00
Fix:Setting the message_history_window_size to 0 does not take effect (#7842)
### What problem does this PR solve? Close #7830 The caller method should already have code to handle this. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
1f32e6e4f4
commit
ae171956e8
@ -304,6 +304,8 @@ class Canvas:
|
||||
|
||||
def get_history(self, window_size):
|
||||
convs = []
|
||||
if window_size <= 0:
|
||||
return convs
|
||||
for role, obj in self.history[window_size * -1:]:
|
||||
if isinstance(obj, list) and obj and all([isinstance(o, dict) for o in obj]):
|
||||
convs.append({"role": role, "content": '\n'.join([str(s.get("content", "")) for s in obj])})
|
||||
|
Loading…
x
Reference in New Issue
Block a user