@@ -521,11 +521,12 @@ def select_datasource(self):
521521 datasource = _datasource ,
522522 engine_type = _engine_type )
523523 if self .ds :
524- self .chat_question .terminologies = get_terminology_template (self .session , self .chat_question .question ,
525- self .ds .oid if isinstance (self .ds ,
526- CoreDatasource ) else 1 )
527- self .chat_question .data_training = get_training_template (self .session , self .chat_question .question ,
528- self .ds .id , self .ds .oid )
524+ oid = self .ds .oid if isinstance (self .ds , CoreDatasource ) else 1
525+ dsId = self .ds .id if isinstance (self .ds , CoreDatasource ) else None
526+
527+ self .chat_question .terminologies = get_terminology_template (self .session , self .chat_question .question , 1 )
528+ self .chat_question .data_training = get_training_template (self .session , self .chat_question .question , dsId , oid )
529+
529530
530531 self .init_messages ()
531532
@@ -936,11 +937,11 @@ def run_task_cache(self, in_chat: bool = True):
936937 def run_task (self , in_chat : bool = True ):
937938 try :
938939 if self .ds :
939- self .chat_question . terminologies = get_terminology_template (self .session , self . chat_question . question ,
940- self .ds .oid if isinstance (self .ds ,
941- CoreDatasource ) else 1 )
942- self .chat_question .data_training = get_training_template (self .session , self .chat_question .question ,
943- self . ds . id , self . ds . oid )
940+ oid = self .ds . oid if isinstance (self .ds , CoreDatasource ) else 1
941+ dsId = self .ds .id if isinstance (self .ds , CoreDatasource ) else None
942+ self . chat_question . terminologies = get_terminology_template ( self . session , self . chat_question . question , oid )
943+ self .chat_question .data_training = get_training_template (self .session , self .chat_question .question , dsId , oid )
944+
944945
945946 self .init_messages ()
946947
0 commit comments