Unverified Commit 6b57e4e0 authored by Charlie.Wei's avatar Charlie.Wei Committed by GitHub

Fix chitchat lost context (#1828)

Co-authored-by: luowei <glpat-EjySCyNjWiLqAED-YmwM>
Co-authored-by: 's avatarcrazywoola <427733928@qq.com>
Co-authored-by: 's avatarcrazywoola <100913391+crazywoola@users.noreply.github.com>
parent 6da3a33e
......@@ -27,7 +27,7 @@ class ReadOnlyConversationTokenDBBufferSharedMemory(BaseChatMemory):
# fetch limited messages desc, and return reversed
messages = db.session.query(Message).filter(
Message.conversation_id == self.conversation.id,
Message.answer_tokens > 0
Message.answer != ''
).order_by(Message.created_at.desc()).limit(self.message_limit).all()
messages = list(reversed(messages))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment