Skip to content

Commit

Permalink
fix(chat_history): chat_history_db mysql message query bug (#989)
Browse files Browse the repository at this point in the history
  • Loading branch information
yhjun1026 authored Dec 28, 2023
1 parent fd3a5d2 commit 96474e9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion dbgpt/storage/chat_history/chat_history_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,11 @@ def raw_delete(self, conv_uid: int):
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

0 comments on commit 96474e9

Please sign in to comment.