Selaa lähdekoodia

fix: remove the latest message from the user that does not have any answer yet (#9297)

tags/0.9.2
kurokobo 1 vuosi sitten
vanhempi
commit
857055b797
No account linked to committer's email address
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2
    2
      api/core/memory/token_buffer_memory.py

+ 2
- 2
api/core/memory/token_buffer_memory.py Näytä tiedosto

@@ -60,8 +60,8 @@ class TokenBufferMemory:
thread_messages = extract_thread_messages(messages)

# for newly created message, its answer is temporarily empty, we don't need to add it to memory
if thread_messages and not thread_messages[-1].answer:
thread_messages.pop()
if thread_messages and not thread_messages[0].answer:
thread_messages.pop(0)

messages = list(reversed(thread_messages))


Loading…
Peruuta
Tallenna