mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-31 16:39:48 +00:00
fix(chat_history): chat_history_db mysql message query bug (#989)
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user