mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 09:17:06 +08:00
perf: Assistant ds
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user