diff --git a/backend/apps/chat/task/llm.py b/backend/apps/chat/task/llm.py index f59d6ad9..9e4e832c 100644 --- a/backend/apps/chat/task/llm.py +++ b/backend/apps/chat/task/llm.py @@ -365,7 +365,7 @@ class LLMService: datasource_msg: List[Union[BaseMessage, dict[str, Any]]] = [] datasource_msg.append(SystemMessage(self.chat_question.datasource_sys_question())) if self.current_assistant: - _ds_list = get_assistant_ds(llm_service=self) + _ds_list = get_assistant_ds(session=self.session, llm_service=self) else: oid: str = self.current_user.oid stmt = select(CoreDatasource.id, CoreDatasource.name, CoreDatasource.description).where( diff --git a/backend/apps/system/crud/assistant.py b/backend/apps/system/crud/assistant.py index 090c4f1b..8238ab45 100644 --- a/backend/apps/system/crud/assistant.py +++ b/backend/apps/system/crud/assistant.py @@ -29,9 +29,8 @@ def get_assistant_user(*, id: int): email="sqlbot-inner-assistant@sqlbot.com") -def get_assistant_ds(llm_service) -> list[dict]: +def get_assistant_ds(session: Session, llm_service) -> list[dict]: assistant: AssistantHeader = llm_service.current_assistant - session: Session = llm_service.session type = assistant.type if type == 0: configuration = assistant.configuration