perf: Assistant ds

This commit is contained in:
fit2cloud-chenyw
2025-07-29 20:38:35 +08:00
parent a404cd8be7
commit 8f7f67dd55
2 changed files with 2 additions and 3 deletions
+1 -1
View File
@@ -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(
+1 -2
View File
@@ -29,9 +29,8 @@ def get_assistant_user(*, id: int):
email="[email protected]")
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