We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e2ed07 commit 1d4fe1fCopy full SHA for 1d4fe1f
backend/apps/chat/task/llm.py
@@ -1030,7 +1030,12 @@ def run_analysis_or_predict_task(self, action_type: str):
1030
def validate_history_ds(self):
1031
_invalid_ds = False
1032
_ds = self.ds
1033
- _assistant = self.current_assistant
+ if not self.current_assistant:
1034
+ current_ds = self.session.exec(CoreDatasource, _ds.id)
1035
+ _invalid_ds = not current_ds
1036
+ else:
1037
+ _ds_list: list[dict] = get_assistant_ds(session=self.session, llm_service=self)
1038
+ _invalid_ds = any(item.get("id") == _ds.id for item in _ds_list)
1039
if _invalid_ds:
1040
yield orjson.dumps({'content': 'ds is invalid', 'type': 'error'}).decode() + '\n\n'
1041
0 commit comments