From 16781d002b69b343e21bd64bb296a4b9b1d9c652 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 29 Jul 2025 21:28:55 +0800 Subject: [PATCH] fix: sessionmaker miss exec --- backend/apps/chat/task/llm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/apps/chat/task/llm.py b/backend/apps/chat/task/llm.py index 9e4e832c..64992e52 100644 --- a/backend/apps/chat/task/llm.py +++ b/backend/apps/chat/task/llm.py @@ -71,7 +71,7 @@ class LLMService: engine = create_engine(str(settings.SQLALCHEMY_DATABASE_URI)) session_maker = sessionmaker(bind=engine) self.session = session_maker() - + self.session.exec = self.session.exec if hasattr(self.session, "exec") else self.session.execute self.current_user = current_user self.current_assistant = current_assistant # chat = self.session.query(Chat).filter(Chat.id == chat_question.chat_id).first()