Ver código fonte

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)
tags/v0.19.1
Stephen Hu 5 meses atrás
pai
commit
ae171956e8
Nenhuma conta vinculada ao e-mail do autor do commit
1 arquivos alterados com 2 adições e 0 exclusões
  1. 2
    0
      agent/canvas.py

+ 2
- 0
agent/canvas.py Ver arquivo

@@ -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])})

Carregando…
Cancelar
Salvar