diff --git a/api/core/memory/read_only_conversation_token_db_buffer_shared_memory.py b/api/core/memory/read_only_conversation_token_db_buffer_shared_memory.py index 4123521ae3fae9..9840c5c22da5c3 100644 --- a/api/core/memory/read_only_conversation_token_db_buffer_shared_memory.py +++ b/api/core/memory/read_only_conversation_token_db_buffer_shared_memory.py @@ -27,7 +27,7 @@ def buffer(self) -> List[BaseMessage]: # 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))