fix(chat_history): chat_history_db mysql message query bug (#989)

This commit is contained in:
明天
2023-12-28 14:26:22 +08:00
committed by GitHub
parent fd3a5d2bfa
commit 96474e9148

View File

@@ -106,4 +106,11 @@ class ChatHistoryDao(BaseDao):
chat_history.delete()
def get_by_uid(self, conv_uid: str) -> ChatHistoryEntity:
return ChatHistoryEntity.query.filter_by(conv_uid=conv_uid).first()
# return ChatHistoryEntity.query.filter_by(conv_uid=conv_uid).first()
session = self.get_raw_session()
chat_history = session.query(ChatHistoryEntity)
chat_history = chat_history.filter(ChatHistoryEntity.conv_uid == conv_uid)
result = chat_history.first()
session.close()
return result