Co-authored-by: luowei <glpat-EjySCyNjWiLqAED-YmwM> Co-authored-by: crazywoola <427733928@qq.com> Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>tags/0.4.0
| @@ -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)) | |||