Skip to content

Commit e5fc5f8

Browse files
committed
fix: 'Session' object has no attribute 'exec'
1 parent 3c1d1e6 commit e5fc5f8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

backend/apps/chat/task/llm.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
dynamic_ds_types = [1, 3]
5757
dynamic_subsql_prefix = 'select * from sqlbot_dynamic_temp_table_'
5858

59-
session_maker = scoped_session(sessionmaker(bind=engine))
59+
session_maker = scoped_session(sessionmaker(bind=engine, class_=Session))
6060

6161

6262
class LLMService:
@@ -88,7 +88,6 @@ def __init__(self, session: Session, current_user: CurrentUser, chat_question: C
8888
current_assistant: Optional[CurrentAssistant] = None, no_reasoning: bool = False,
8989
embedding: bool = False, config: LLMConfig = None):
9090
self.chunk_list = []
91-
session.exec = session.exec if hasattr(session, "exec") else session.execute
9291
self.current_user = current_user
9392
self.current_assistant = current_assistant
9493
chat_id = chat_question.chat_id

0 commit comments

Comments
 (0)